Skip running tests for a particular project.
mvn clean install -Dmaven.test.skip=trueContinue build if it has been failed at certain point. Maybe you have many sub-projects and build your entire project from top to down. "-rf" parameters allow to continue maven running where you want after any build errors. Assume my current top directory where I let Maven run is D:\SVN and the build was broken at D:\SVN\eIP\CoreServer\DatastoreConnector. Following command let go on with the build and skip this not compilable or not testable sub-project.
mvn clean install -rf eIP\CoreServer\DatastoreConnectorGet source jar files (e.g. for Eclipse projects). Having source files in local repository allow to jump into this directly from your preferred IDE.
mvn eclipse:eclipse -DdownloadSources=trueor run
mvn dependency:sourcesto download all source jars for a given project into local repository. The same for JavaDoc (if it's available).
mvn eclipse:eclipse -DdownloadJavadocs=trueOutput project's dependency tree. I like that! You can see versions of all used artefacts.
mvn dependency:treeOutput is like this one
[INFO] ip.client:ip-jsftoolkit:jar:3.4.1-SNAPSHOT [INFO] +- ip.client:ip-filter-security:jar:3.4.0:compile [INFO] | +- com.scalaris.commons:scalaris-commons-enterprise:jar:2.3.1-SNAPSHOT:compile [INFO] | | +- com.scalaris.commons:scalaris-commons-lang:jar:2.3.0:compile [INFO] | | +- org.apache.commons:commons-lang3:jar:3.0:compile [INFO] | | \- commons-lang:commons-lang:jar:2.6:compile [INFO] | +- ip.client:ip-client-commons:jar:3.4.0:compile [INFO] | | +- ip.services:ip-core-services:jar:3.4.0:compile [INFO] | | | \- ip.datatransfer:ip-datatransfer-commons:jar:3.4.0:compile .................................................. [INFO] | +- commons-httpclient:commons-httpclient:jar:3.0.1:compile [INFO] | +- org.apache.commons:commons-jexl:jar:2.0:compile [INFO] | \- joda-time:joda-time:jar:1.6.2:compile [INFO] +- javax.ejb:ejb:jar:3.0:provided [INFO] +- javax.servlet:servlet-api:jar:2.5:provided [INFO] \- com.scalaris.commons:scalaris-commons-test:jar:2.2.8-SNAPSHOT:test [INFO] +- jmock:jmock:jar:1.2.0:test [INFO] +- junit:junit:jar:3.8.2:testFilter project's dependency tree in order to see only a specified dependency. The syntax for filter patterns is as follows: [groupId]:[artifactId]:[type]:[version]
mvn dependency:tree -Dincludes=com.sun.faces:jsf-implDisplay the effective pom of a project. The effective pom represents the current pom state for a project (incl. maven super pom and active profiles).
mvn help:effective-pomGenerate files needed for an IntelliJ IDEA project setup.
mvn idea:ideaThis plugin has no way to determine the name of the JDK you are using. It uses by default the same JDK as output java -version. Using with defined JDK:
mvn idea:idea -DjdkName=1.5Create a web project from scratch.
mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0 -DgroupId=com.maventest -DartifactId=mywebtest -Dversion=1.0-SNAPSHOTDeploy artefact in global repository (located e.g. in file://///xyz.abc.com/maven/repo-m2).
mvn deploy:deploy-file -DgroupId=com.maventest -DartifactId=mywebtest -Dversion=1.0-SNAPSHOT -Dpackaging=war -Dfile=mywebapp.jar -DrepositoryId=xyz-release -Durl=file://///xyz.abc.com/maven/repo-m2Check all the dependencies used in your project and display a list of those dependencies with newer versions available.
mvn versions:display-dependency-updates ... [INFO] The following dependency updates are available: [INFO] org.apache.maven:maven-artifact ........................ 2.0 -> 2.0.9 [INFO] org.apache.maven:maven-plugin-api ...................... 2.0 -> 2.0.9 [INFO] org.apache.maven:maven-project ....................... 2.0.2 -> 2.0.9 [INFO] org.codehaus.plexus:plexus-utils ....................... 1.1 -> 1.5.6Check all the plugins and reports used in your project and display a list of those plugins with newer versions available.
mvn versions:display-plugin-updates ... [INFO] The following plugin updates are available: [INFO] maven-deploy-plugin ...................................... 2.5 -> 2.7 [INFO] maven-jar-plugin ..................................... 2.3.1 -> 2.3.2 [INFO] maven-plugin-plugin ...................................... 2.7 -> 2.9 [INFO] maven-resources-plugin ................................. 2.4.3 -> 2.5Decompile Java classes in the maven central repository :-). Useful if source code isn't available. The trick is here.
Thanks for sharing, I will bookmark and be back again
ReplyDeleteSoftware Development