Maven

  • memory
set MAVEN_OPTS=-Xms1024m -Xmx2048m -Xss512m
  • disable pmd,cpd,coverage,findbugs,javancss
mvn clean install -Dpmd.check.phase='' -Dcpd.check.phase='' -Dcoverage.check.phase='' \
-Dfindbugs.check.phase='' -Djavancss.check.phasse=''
  • install thirdpart libaray
mvn install:install-file -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -Dfile=<thirdpart libaray file path>

mvn install:install-file -Dpom-file=<pom file path> -Dfile=<file path>
  • deploy to special remote url
mvn deploy:deploy-file -Durl=<repository url> -DrepositoryId=<id> -Dpom-file=<pom file path> -Dfile=<file Path>

mvn clean deploy -DaltDeploymentRepository=<repositoryId>::default::<repositoryUrl> -DrepositoryId=<repositoryId>
  • skip submodule
mvn clean install -pl "!submodule,!submodule2"
  • get version from pom file
## linux
mvn -f <pomFile> -q -Dexec.executable="echo" -Dexec.args='${project-version}'  --non-recursive exec:exec

## Windows, tested on Windows server 2012 R2
mvn -f <pomFile> -q -Dexec.executable="cmd.exe" -Dexec.args="/c echo ${project-version}" --non-recursive exec:exec