我试图将项目部署到我们的Artifactory存储库。用户qazwart
是管理员,具有部署到服务器的权限。我在settings.xml
和<central>
ID下的<snapshots>
文件中拥有该用户的正确信息。我在<distributionManagement>
文件的pom.xml
部分中有正确的网址。看起来一切都设置正确。然而,当我尝试部署时,我收到Return code is: 405, ReasonPhrase: Method Not Allowed. -> [Help 1]
错误。
我应该寻找或尝试什么?
mvn deploy
的输出(我在[ERORR]
部分添加了换行符以使其更具可读性):
$ mvn deploy
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ....
[INFO] ------------------------------------------------------------------------
[INFO] Building Project Aggregate POM 2.5.2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ rez ---
[INFO] Installing /home/qazwart/project/workspace/pom.xml to \
/home/tomcat/.m2/repository/com/vegicorp/proj/2.5.2/proj-2.5.2.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ proj ---
Uploading: http://repo.vegicorp.net/artifactory/libs-release/net/vegicorp/proj/2.5.2/proj-2.5.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Project Aggregate POM ........................ FAILURE [1.984s]
[INFO] ....
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.885s
[INFO] Finished at: Wed Feb 18 12:58:53 EST 2015
[INFO] Final Memory: 10M/149M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal \
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy \
(default-deploy) on project proj: \
Failed to deploy artifacts: Could not transfer artifact \
net.vegicorp:proj:pom:2.5.2 from/to central \
(http://repo.vegicorp.net/artifactory/libs-release): \
Failed to transfer file: \
http://repo.vegicorp.net/artifactory/libs-release/net/vegicorp/proj/2.5.2/proj-2.5.2.pom. \
Return code is: 405, ReasonPhrase: Method Not Allowed. -> [Help 1]
[INFO] ...
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
$HOME/.m2/settings.xml
中的我的设置文件是:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<proxies>
<proxy>
<id>proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.vegicorp.net</host>
<port>3128</port>
<nonProxyHosts></nonProxyHosts>
</proxy>
</proxies>
<servers>
<server>
<username>qazwart</username>
<password>swordfish</password>
<id>central</id>
</server>
<server>
<username>qazwart</username>
<password>swordfish</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://repo.vegicorp.net/artifactory/libs-release</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://repo.vegicorp.net/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://repo.vegicorp.net/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://repo.vegicorp.net/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
我的项目POM是:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>proj</artifactId>
<groupId>net.vegicorp</groupId>
<version>2.5.2</version>
<packaging>pom</packaging>
<name>Project Aggregate POM</name>
<description>All Reservation Delivery Projects</description>
<properties>
....
</properties>
<scm>
....
</scm>
<distributionManagement>
<repository>
<id>central</id>
<name>libs-release</name>
<url>http://repo.vegicorp.net/artifactory/libs-release</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://repo.vegicorp.net/artifactory/libs-snapshot</url>
</snapshotRepository>
</distributionManagement>
<dependencyManagement>
....
</dependencyManagement>
<build>
...
</build>
<modules>
...
</modules>
</project>
答案 0 :(得分:28)
我发现了这个问题。我有错误的Artifactory存储库。我有lib-releases
和lib-snapshots
。这些是虚拟存储库。我想要的是libs-release-local
和libs-snapshot-local
。现在,mvn deploy
有效。
但是,我现在正试图获得Jenkin's Artifactory Plugin
答案 1 :(得分:11)
稍微纠正David W.回答(因为我无法发表评论)到存储库名称
libs-release-local 和 libs-snapshot-local 。