java - What is priority of parameters passed to maven plugin? -


i see parameter can configured in pom.xml or passed in cli such -dxxxxx=...

my question if same parameter both configured in file pom.xml , passed in cli, used maven plugin? there document priority?

mostly believe cli override, real case shows opposite.

<plugin>     <groupid>de.saumya.mojo</groupid>     <artifactid>rspec-maven-plugin</artifactid>     <version>1.0.0-beta</version>     <configuration>         <launchdirectory>${project.build.directory}/test-classes</launchdirectory>         <summaryreport>${project.build.directory}/test-ruby.xml</summaryreport>         <specsourcedirectory>./new_test</specsourcedirectory>     </configuration>     <executions>         <execution>             <goals>                 <goal>test</goal>             </goals>         </execution>     </executions> </plugin> 

when ran

mvn test -dspecsourcedirectory=./spec 

the plugin still picked specsourcedirectory in pom.xml ./new_test

i'm using maven 3.0.5, java 7, jruby 1.7.5


got resolved: should property instead of hardcode

<specsourcedirectory>${specsourcedirectory}</specsourcedirectory> 

one thing plugin's configuration parameter , other thing maven's invocation property (user property). example, @ surefire's skip configuration parameter. there skip parameter can set maven.test.skip property. in general these 2 names independent, can either different or same.

in case, <specsourcedirectory>${specsourcedirectory}</specsourcedirectory> such latter scenario , work expect.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -