使用maven将第三方软件包上载到我自己的maven存储库服务器
我正在尝试将第三方软件包(如junit)上载到我自己的存储库服务器 我做了以下几件事: 1在~/.m2/settings.xml中添加了以下内容 我收到以下错误:使用maven将第三方软件包上载到我自己的maven存储库服务器,maven,gradle,build,maven-3,maven-central,Maven,Gradle,Build,Maven 3,Maven Central,我正在尝试将第三方软件包(如junit)上载到我自己的存储库服务器 我做了以下几件事: 1在~/.m2/settings.xml中添加了以下内容 我收到以下错误: ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/Users/myuser/.m2/repository/junit/junit/3.8.1). Please verify you i
ERROR] The goal you specified requires a project to execute but there is no POM in this directory
(/Users/myuser/.m2/repository/junit/junit/3.8.1). Please verify you invoked Maven from the correct directory. -> [Help 1]
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (/Users/myuser/.m2/repository/junit/junit/3.8.1). Please verify you invoked Maven from the correct directory.
at
此目录中没有pom.xml,但有一个名为junit-3.8.1.pom的文件
如果我将junit-3.8.1.pom重命名为pom.xml,然后发出上面的deploy命令,那么一切正常,maven能够将包部署到我的存储库中
为什么我的命令不起作用?如何在不重命名文件的情况下将包部署到远程存储库?我是否发出了错误的命令来部署包?默认情况下,maven希望pom文件名为pom.xml。要使用其他名称,请使用-f选项,如下所示:
mvn deploy -DaltDeploymentRepository=thirdparty::default::http://localhost:8000/mavenrepository/thirdparty -f junit-3.8.1-pom.xml
您使用什么作为存储库管理器?
ERROR] The goal you specified requires a project to execute but there is no POM in this directory
(/Users/myuser/.m2/repository/junit/junit/3.8.1). Please verify you invoked Maven from the correct directory. -> [Help 1]
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (/Users/myuser/.m2/repository/junit/junit/3.8.1). Please verify you invoked Maven from the correct directory.
at
mvn deploy -DaltDeploymentRepository=thirdparty::default::http://localhost:8000/mavenrepository/thirdparty -f junit-3.8.1-pom.xml