1. 程式人生 > >mvn:deploy神坑之:“maven deploy-file requires a project to execute but no pom file is found”

mvn:deploy神坑之:“maven deploy-file requires a project to execute but no pom file is found”

釋出程式碼如下:

mvn -X deploy:deploy-file 
-DgroupId=org.apache.maven.plugins
-DartifactId=maven-compiler-plugin
-Dversion=3.6.0
-Dpackaging=jar
-Dfile=C:\Users\maven-compiler-plugin-3.6.0.jar
-Durl=http://200.52.200.246:8081/repository/maven-releases
-DrepositoryId=releases

一直報錯:

maven deploy-file requires a project to execute but no pom file is found

按道理,如果用命令釋出第三方JAR包,是不需要pom.xml的,只有用intellij idea中的maven外掛釋出的時候,才會用到pom.xml,so,whats the problem?
解決辦法:

mvn -X deploy:deploy-file 
“-DgroupId=org.apache.maven.plugins”
“-DartifactId=maven-compiler-plugin”
“-Dversion=3.6.0”
“-Dpackaging=jar”
“-Dfile=C:\Users\maven-compiler-plugin-3.6.0.jar”
“-Durl=http://200.52.200.246:8081/repository/maven-releases”
“-DrepositoryId=releases”

沒錯,僅僅是加了引號!