The command
Push the jar
# MVN deploy:deploy-file -dfile =<file.jar> -dgroupid =<groupId> -dartifactid =<artifactId> -dversion =<version> -dpackaging = jar-drepositoryid =snapshots -durl =<url> -dpomfile =<file.pom> # release MVN deploy:deploy-file -Dfile=<file.jar> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -DrepositoryId=releases -Durl=<url> -DpomFile=<file.pom>Copy the code
Pay attention to
-dpomfile =
- Install, package to local
- Deploy
The POM file was uploaded
mvn deploy:deploy-file -Dfile=<file.pom> -DrepositoryId=<repositoryId> -Durl=<url> -DpomFile=<file.pom> -Dpackaging=pom
Copy the code
Intellij Configuration command
Skip skip source code # -e print deployment process # -f specify file clean deploy-dmaven.test. skip=true -dmaven.source. Skip -e -f pop. XML -dskiptests =true, -dmaven.test. skip=true, dmaven.source. Test cases are not executed and test case classes are not compiledCopy the code
The problem
Error: Cannot deploy artifact from the local repository
The uploaded JAR and POM are located in the local repository, causing an error. Move the file to any directory except repository. The file can be uploaded successfully