User Tools

Site Tools


maven:commands

Set Java version source and target

<project>
  [...]
  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>
  [...]
</project>

Run a single test class

mvn -Dtest=TestCircle test

Run a single test method

mvn -Dtest=TestCircle#mytest test

Execute a Java class

mvn exec:java -Dexec.mainClass="ro.medjava.RenameDuplicates"

Remote debug unit (surefire plugin) tests

mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent 
-Djava.compiler=NONE" test

Remote debug integration (failsafe plugin) tests

mvn -Dmaven.failsafe.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent 
-Djava.compiler=NONE" test  

Remote debug single integration (failsafe plugin) test

mvn -o verify -Dit.test=DataflowDeploymenFTPIT#testDeploySimpleFlowWithSTRelayAndFtpWithPassword 
-Dmaven.failsafe.debug

Remote debug integration (failsafe plugin) tests on default 5005 port

mvn -Dmaven.failsafe.debug verify

Use specified settings file

mvn --settings D:/Pro/MJ_MVN_Settings/settings.xml clean install -DskipTests

Specify local repository

mvn clean install -DskipTests -Dmaven.repo.local=D:/MavenRepo

Deploy to local repository

mvn --settings D:/Pro/MJ_MVN_Settings/settings.xml deploy -DskipTests -Dmaven.repo.local=D:/MavenRepo

Deploy third party jar in remote repository

mvn deploy:deploy-file -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1.0 -Dpackaging=jar 
-Dfile=ojdbc8.jar -DgeneratePom=true -DrepositoryId=internal -Durl=https://medjava.ro/archiva/repository/internal

Get dependency tree

mvn dependency:tree

Show full pom

mvn help:effective-pom -Doutput=full.txt

Remote debug single test class

mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent 
-Djava.compiler=NONE" -Dtest=TestTrkPrint test
maven/commands.txt · Last modified: 2018/08/24 11:00 by odefta