You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Gilday <ma...@imap.cc> on 2006/11/30 20:38:16 UTC

Parameter priority

I am writing a mojo that requires a parameter called "host".  If I set
this in my depdendant projects POM then it works.  If I use the
expression -Dhost=127.0.0.1 then it also works as expected.  But if I
have it set in the POM and then also set the expression then the one in
the POM takes presedent.  Is this correct?  I would generally want to
define a default host in my POM (I dont want to define the default in my
mojo as it varies by project), and then occasionally override this via
the CLI.  I'd rather use the CLI than define multiple profiles, as there
could be any number of hosts I might want to run against.

Is the standard to use what is defined in the POM over everything else,
or have I made a mistake in my plugin?

Thanks,
Martin.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Parameter priority

Posted by Martin Gilday <ma...@imap.cc>.
Anyone able to shed any light on this?  I've still not managed to find
any docs which explain this.

Thanks,
Martin.


----- Original message -----
From: "Martin Gilday" <ma...@imap.cc>
To: "Maven Users List" <us...@maven.apache.org>
Date: Sat, 02 Dec 2006 09:05:32 +0000
Subject: Re: Parameter priority

Hi Franz,

I have an abstract class which my other mojo inherit from (if that makes
a difference) which has the host parameter on it along with the
getter/setter combo.

/**
 * Host.
 * @parameter default-value="127.0.0.1"
 */
private String host;

Then in my POM which uses the plugin

<plugin>
  <groupId>org.martingilday</groupId>
  <artifactId>maven-dbmigrate-plugin</artifactId>
  <configuration>
    <host>A</host>
  </configuration>
</plugin>

>From the CLI I try to overrdide this as -Dhost=B

But when I getLog.info host in my mojo it is always A.  But if I take
host out of the POM then it is always B.

Thanks,
Martin.


----- Original message -----
From: "franz see" <fr...@gmail.com>
To: users@maven.apache.org
Date: Fri, 1 Dec 2006 19:28:50 -0800 (PST)
Subject: Re: Parameter priority


Good day to you, Martin,

How are you using specifying your "host" in the pom, and how are you
using
it in your mojo?

Thanks,
Franz


Martin Gilday wrote:
> 
> I am writing a mojo that requires a parameter called "host".  If I set
> this in my depdendant projects POM then it works.  If I use the
> expression -Dhost=127.0.0.1 then it also works as expected.  But if I
> have it set in the POM and then also set the expression then the one in
> the POM takes presedent.  Is this correct?  I would generally want to
> define a default host in my POM (I dont want to define the default in my
> mojo as it varies by project), and then occasionally override this via
> the CLI.  I'd rather use the CLI than define multiple profiles, as there
> could be any number of hosts I might want to run against.
> 
> Is the standard to use what is defined in the POM over everything else,
> or have I made a mistake in my plugin?
> 
> Thanks,
> Martin.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/Parameter-priority-tf2733806s177.html#a7650090
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Parameter priority

Posted by Martin Gilday <ma...@imap.cc>.
Hi Franz,

I have an abstract class which my other mojo inherit from (if that makes
a difference) which has the host parameter on it along with the
getter/setter combo.

/**
 * Host.
 * @parameter default-value="127.0.0.1"
 */
private String host;

Then in my POM which uses the plugin

<plugin>
  <groupId>org.martingilday</groupId>
  <artifactId>maven-dbmigrate-plugin</artifactId>
  <configuration>
    <host>A</host>
  </configuration>
</plugin>

>From the CLI I try to overrdide this as -Dhost=B

But when I getLog.info host in my mojo it is always A.  But if I take
host out of the POM then it is always B.

Thanks,
Martin.


----- Original message -----
From: "franz see" <fr...@gmail.com>
To: users@maven.apache.org
Date: Fri, 1 Dec 2006 19:28:50 -0800 (PST)
Subject: Re: Parameter priority


Good day to you, Martin,

How are you using specifying your "host" in the pom, and how are you
using
it in your mojo?

Thanks,
Franz


Martin Gilday wrote:
> 
> I am writing a mojo that requires a parameter called "host".  If I set
> this in my depdendant projects POM then it works.  If I use the
> expression -Dhost=127.0.0.1 then it also works as expected.  But if I
> have it set in the POM and then also set the expression then the one in
> the POM takes presedent.  Is this correct?  I would generally want to
> define a default host in my POM (I dont want to define the default in my
> mojo as it varies by project), and then occasionally override this via
> the CLI.  I'd rather use the CLI than define multiple profiles, as there
> could be any number of hosts I might want to run against.
> 
> Is the standard to use what is defined in the POM over everything else,
> or have I made a mistake in my plugin?
> 
> Thanks,
> Martin.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/Parameter-priority-tf2733806s177.html#a7650090
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Parameter priority

Posted by franz see <fr...@gmail.com>.
Good day to you, Martin,

How are you using specifying your "host" in the pom, and how are you using
it in your mojo?

Thanks,
Franz


Martin Gilday wrote:
> 
> I am writing a mojo that requires a parameter called "host".  If I set
> this in my depdendant projects POM then it works.  If I use the
> expression -Dhost=127.0.0.1 then it also works as expected.  But if I
> have it set in the POM and then also set the expression then the one in
> the POM takes presedent.  Is this correct?  I would generally want to
> define a default host in my POM (I dont want to define the default in my
> mojo as it varies by project), and then occasionally override this via
> the CLI.  I'd rather use the CLI than define multiple profiles, as there
> could be any number of hosts I might want to run against.
> 
> Is the standard to use what is defined in the POM over everything else,
> or have I made a mistake in my plugin?
> 
> Thanks,
> Martin.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Parameter-priority-tf2733806s177.html#a7650090
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org