Please see: http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html

You want to set ouputDirectory in the compiler configuration. Am not sure though if -DoutputDirectory will work, so just configure the plugin in your project pom.xml.

See http://maven.apache.org/plugins/maven-compiler-plugin/howto.html for a sample compiler plugin configuration.


Sri Sankaran wrote:

Can you help me understand the right way to set mojo parameters?  I am an m2 
neophyte trying to unlearn 2 years of Maven usage.

What I wanted was the compiler:compile mojo to output classes to a "build" directory 
instead of the default "target".  However I was unable to set the buildDirectory 
parameter (see http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html) in any 
obvious way.  I tried

mvn compile -DbuildDirectory=target

and other variations.  I finally came across instructions on using the build 
element of the POM for such customization and hit pay dirt by adding the 
following to my pom

<build>
 <outputDirectory>${basedir}/build</outputDirectory>
</build>

So that leaves me confused and leads me to my original question -- what is the 
right way to override settings?  If there are multiple ways setting the same 
parameter what is the precedence?

Also, is an expression such as ${project.build.directory} (which btw is the 
default value for the compile mojo's buildDirectory parameter) referring to an 
element in the POM (much like M1's pom.xyz)?

Any help is appreciated.

Thanks

Sri

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



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

Reply via email to