Maven skips the unit test, and maven installs the project into a jar to the local warehouse
maven command
-
mvn clean delete the target package, or clear the class file.
-
mvn compile compile, compile java source file into bytecode file class.
-
mvn package package, if the pom.xml file is not configured, the default is jar
-
mvn install installs the jar package to the local warehouse ( this lecture )
-
mvn deploy deploys jar to remote warehouse
Install the local project into a jar and install it in the local warehouse
-
First of all, we have compiled the corresponding project jar in our target directory, if not packaged first.
mvn package
-
Perform installation to the local warehouse.
mvn install:install-file -Dfile=jar路径 -DgroupId=待填 -DartifactId=待填 -Dversion=待填 -Dpackaging=jar
For example: the jar package name is composed of artifactId-version, for example, my execution of mvn package generates maven_demo_delete-1.0-SNAPSHOT.jar in the target directory. The pom.xml configuration is as follows:
<groupId>org.example</groupId> <artifactId>maven_demo_delete</artifactId> <version>1.0-SNAPSHOT</version>
mvn install:install-file -Dfile=target/maven_demo_delete-1.0-SNAPSHOT.jar -DgroupId=org.example -DartifactId=maven_demo_delete -Dversion=1.0-SNAPSHOT -Dpackaging=jar
If you are in a hurry to go online, you can skip the unit test (for example, there is an error in the unit test that prevents the package)
test will compile but not execute
mvn package -DskipTests
test does not compile or execute ( used more )
mvn package -Dmaven.test.skip=true