[M2] System properties

View: New views
6 Messages — Rating Filter:   Alert me  

[M2] System properties

by ekio :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.  Does anyone know if there is a way to declare system properties from within a pom file, rather than doing it on the command line? (Ex: mvn -Dproperty=value scm:checkout)  I saw some examples on the web, some plugins do the following under <configuration> of <plugin>:

<systemProperties>
   <property>
      <name>property</name>
      <value>value</value>
   </property>
</systemProperties>

I am writing a scm-provider, and I want to use the System.getProperty() method in the provider to get the properties.  It works when I declare the properties on the command line, but not when I declare them from inside the pom...  

Any idea?  Thanks a lot!

Re: [M2] System properties

by Dan Tran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can have user to set the properties at a fixed file location ( ie ${
user.home}/.yourprovider.

Check out the source for cvs, svn,starteam, etc providers

-D

On 7/19/06, ekio <ekio83@...> wrote:

>
>
> Hello.  Does anyone know if there is a way to declare system properties
> from
> within a pom file, rather than doing it on the command line? (Ex: mvn
> -Dproperty=value scm:checkout)  I saw some examples on the web, some
> plugins
> do the following under <configuration> of <plugin>:
>
> <systemProperties>
>   <property>
>      <name>property</name>
>      <value>value</value>
>   </property>
> </systemProperties>
>
> I am writing a scm-provider, and I want to use the System.getProperty()
> method in the provider to get the properties.  It works when I declare the
> properties on the command line, but not when I declare them from inside
> the
> pom...
>
> Any idea?  Thanks a lot!
> --
> View this message in context:
> http://www.nabble.com/-M2--System-properties-tf1969896.html#a5407705
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

Re: [M2] System properties

by ekio :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you.  
But is it possible that I can do this from the pom?

Re: [M2] System properties

by Dan Tran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Most likely there is no way to do.

What is wrong with the suggested scheme?

-D


On 7/20/06, ekio <ekio83@...> wrote:

>
>
> Thank you.
> But is it possible that I can do this from the pom?
>
> --
> View this message in context:
> http://www.nabble.com/-M2--System-properties-tf1969896.html#a5418983
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

Re: [M2] System properties

by ekio :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oh there is noting wrong.  But if it is possible to do that in the pom, then I can bind a property to a phase, and have different values in different phases.

Re: [M2] System properties

by avalon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dan Tran wrote:
Most likely there is no way to do.
Can http://grid.in2p3.fr/build-tools/maven-properties-plugin/set-mojo.html do so? If yes, then how? I'm a maven noob.

Dan Tran wrote:
What is wrong with the suggested scheme?

-D
Well, why ask users to supply options?