sarmahdi
sarmahdi

Reputation: 1136

maven: simple questions about mvn options

I tried searching on Google about these and cant really find any thing.

mvn --define : what does it do, how can i use it and for what?

in the maven-compiler-plugin entry (in my POMs) I added

 <*verbose>true<*/verbose>

I added it to see if it prints out the JAVA_HOME but when i ran the mvn install (in my project directory) but nothing extra ordinary came out as a verbose for compile (just warnings that were coming before as well) even mvn clean compile doesn't give me anything. is there an option to echo the JAVA_HOME when doing compile?

(Disclaimer: I am having some javascript error on this site since yesterday on my work pc :Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load. So... i cant really add comments some how from my work pc. Will reply from home though. sorry for delay inadvance...)

Upvotes: 0

Views: 2205

Answers (2)

Padmini Mandal
Padmini Mandal

Reputation: 46

Yes using mvn -X clean will display the Java Home details. Please find the output here

Apache Maven 3.0.4 (r1232337; 2012-01-17 02:44:56-0600)
Maven home: C:\FlyingSaucer\MAVEN\apache-maven-3.0.4
**Java version: 1.6.0_25, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_25\jre**

Upvotes: 2

Raghuram
Raghuram

Reputation: 52655

mvn --help should answer all the above questions.

Cut/pasting relevant output of mvn --help,

-D,--define <arg>                      Define a system property

For instance, mvn -DskipTests package (compile and create a package skipping tests)

As for information of JAVA_HOME

mvn -v should give this information

Also, you can run mvn -X, which will give a lot of debug information.

Upvotes: 0

Related Questions