Steve-  You rock.  It works perfectly.  Thank you so much.  I'm off to the
races.

-Adam


On 5/1/07, Steven Rowe <[EMAIL PROTECTED]> wrote:

Hi Adam,

You could interpolate ${url} in your tomcat-maven-plugin configuration:

<build>
  <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>tomcat-maven-plugin</artifactId>
      <configuration>
        <url>${url}</url>
      </configuration>
    </plugin>
  </plugins>
</build>

and then provide a property value for "url" on the cmdline:

  mvn -Durl="myurl" tomcat:deploy

As an alternative, for example in case you have a fixed list of URLs to
which you want to deploy, you could use profiles to provide more
convenient aliases, e.g.:

<profiles>
  <profile>
    <id>FirstURL</id>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-plugin</artifactId>
        <configuration>
          <url>http://first.example.org</url>
        </configuration>
      </plugin>
    </plugins>
  </profile>
  <profile>
    <id>SecondURL</id>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-plugin</artifactId>
        <configuration>
          <url>http://second.example.org</url>
        </configuration>
      </plugin>
    </plugins>
  </profile>
  ...
</profiles>

And then activate the appropriate profile on the cmdline, e.g.:

   mvn -PSecondURL tomcat:deploy

Hope it helps,
Steve

Adam Fisk wrote:
> This seems like a ridiculously simple problem, but I'm pulling my hair
out
> just specifying a property on the command line.  I'd like my properties
> defined on the command line to register at all with various plugins, but
I
> just can't get it to work.  For example, I'd like to do the following:
>
> mvn -Durl="myurl" tomcat:deploy or
> mvn tomcat:deploy -Durl="myurl"
>
> In my understanding, the plugin should use the "myurl" value for the
"url"
> property.  Is that not correct?  I can't get the tomcat plugin to
> understand
> the url change, nor can I get my own test plugins to use command line
> properties instead of properties defined in the pom.  Is there some
special
> annotation I need to use in the plugin?
>
> I can configure this fine in the pom or in the settings.xml, but I'm
> deploying to multiple servers and would therefore like to do it on the
> command line with a script.
>
> Thanks very much.
>
> -Adam



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to