1
votes

artifactory-oss-6.7.2 is throwing a 405 status code exception when running maven release:perform

Created a settings.xml from artifactory "generate settings.xml" on repo. All repos are virtual repos. Added distributionManagement to my project pom file to use the ids for snapshots and releases from settings.xml.

settings.xml:

<repositories>
 <repository>
   <snapshots>
     <enabled>false</enabled>
   </snapshots>
   <id>central</id>
   <name>libs-release</name>
   <url>http://localhost:8081/artifactory/libs-release</url>
 </repository>
 <repository>
   <snapshots />
   <id>snapshots</id>
   <name>libs-snapshot</name>
   <url>http://localhost:8081/artifactory/libs-snapshot</url>
  </repository>
 </repositories>

myproject/pom.xml:

     <distributionManagement>
    <repository>
        <id>central</id>
        <name>Artifactory Release Repo</name>
        <url>http://localhost:8081/artifactory/libs-release</url>
    </repository>
    <snapshotRepository>
        <id>snapshots</id>
        <name>Artifactory Snapshot Repo</name>
        <url>http://localhost:8081/artifactory/libs-snapshot</url>
    </snapshotRepository>
</distributionManagement>

run mvn release:perform output:

[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project model: Failed to deploy artifacts: Could not transfer artifact com.test:model:jar:0.1.0 from/to central (http://localhost:8081/artifactory/libs-release): Failed to transfer file http://localhost:8081/artifactory/libs-release/com/srcrea/model/0.1.0/model-0.1.0.jar with status code 405 -> [Help 1]

1

1 Answers

1
votes

So I followed something I found here -> http://forums.jfrog.org/Error-Code-405-with-mvn-deploy-td7174367.html

And updated DistributionManagement of the pom.xml

   <distributionManagement>
    <repository>
        <id>central</id>
        <name>Artifactory Release Repo</name>
        <url>http://localhost:8081/artifactory/88888</url>
    </repository>
    <snapshotRepository>
        <id>snapshots</id>
        <name>Artifactory Snapshot Repo</name>
        <url>http://localhost:8081/artifactory/88888</url>
    </snapshotRepository>
</distributionManagement>

Re-Run and now I see it:

artifactory repo

But what is not clear is in order to generate settings.xml you need to associate virtual repos to a local repo. Then generate settings off that and use the distributionManagement configuration to point back to the local repo. What is the point of the virtual repo?