I think you're confusing Maven properties and system properties. myProp as
defined within the properties section is a Maven property. You cannot
override that through a Java system property (-DmyProp).
However, in your POM you could reference your myProp property through
${myProp}. If you execute Maven through "mvn install -DmyProp=blabla", the
${myProp} reference should pick up the Java system property you define
('blabla') instead of the Maven property defined in the POM./Anders On Tue, Jan 18, 2011 at 00:28, Victor Calvello <[email protected]> wrote: > Hi guys! > > I have a problem with something I took for granted until now :P > What I need is to override a property value by passing a new value from the > command line. > For example, I have something like this in my pom.xml: > ... > <properties> > <myProp>myDefault</myProp> > </properties> > ... > and then I run a goal with some arguments...let's say... mvn > help:effective-pom -DmyProp=myValue > So, what I was expecting was to override myDefault with myValue but that's > not happening. > > Is that the correct behavior? If that's the way it works, how can I do what > I want? (maybe profiles?) > > Thanks in advance, > Vic >
