I am running the following:
Apache Maven 3.0.5, Artifactory(Open-Source) 3.1.0
No Jenkins/Hudson, just the default Artifactory setup.
Excerpt from pom.xml:
<distributionManagement>
<repository>
<id>ServerA2</id>
<name>ServerA2-releases</name>
<url>http://192.168.1.16:8081/artifactory/libs-release-local</url>
</repository>
<snapshotRepository>
<id>ServerA2</id>
<name>ServerA2-snapshots</name>
<url>http://192.168.1.16:8081/artifactory/libs-snapshot-local</url>
</snapshotRepository>
</distributionManagement>
Excerpt from 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">
<servers>
<server>
<username>admin</username>
<password>XXX</password>
<id>central</id>
</server>
<server>
<username>admin</username>
<password>XXX</password>
<id>snapshots</id>
</server>
<server>
<username>admin</username>
<password>XXX</password>
<id>ServerA2</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://192.168.1.16:8081/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://192.168.1.16:8081/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://192.168.1.16:8081/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://192.168.1.16:8081/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
Now to the problem:
I have no problems doing mvn deploy
when I set the version in pom.xml to <version>1.0</version>
. The Artifact was uploaded successfully
But I encounter the following error when I set the version in pom.xml to <version>1.0-SNAPSHOT</version>
Output from mvn clean deploy -X -e
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ pinder ---
[DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.7:
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-project:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-settings:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-profile:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG] junit:junit:jar:3.8.1:compile
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG] org.apache.maven:maven-model:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-artifact:jar:2.0.6:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.6:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[DEBUG] Imported: < project>sg.com.pinder:pinder:0.0.1-SNAPSHOT
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[DEBUG] Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
[DEBUG] Included: junit:junit:jar:3.8.1
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.5.6
[DEBUG] Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-project:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-settings:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-profile:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.6
[DEBUG] Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG] Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG] Excluded: org.apache.maven:maven-model:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-artifact:jar:2.0.6
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7, parent: sun.misc.Launcher$AppClassLoader@645ad7b2]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy' with basic configurator -->
[DEBUG] (f) artifact = sg.com.pinder:pinder:jar:0.0.1-SNAPSHOT
[DEBUG] (f) attachedArtifacts = []
[DEBUG] (s) localRepository = id: local
url: file:///home/Eric_Vader/.m2/repository/
layout: none
[DEBUG] (f) offline = false
[DEBUG] (f) packaging = jar
[DEBUG] (f) pomFile = /home/Eric_Vader/workspace/pinder/pom.xml
[DEBUG] (f) project = MavenProject: sg.com.pinder:pinder:0.0.1-SNAPSHOT @ /home/Eric_Vader/workspace/pinder/pom.xml
[DEBUG] (f) retryFailedDeploymentCount = 1
[DEBUG] (f) skip = false
[DEBUG] (f) updateReleaseInfo = false
[DEBUG] -- end configuration --
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://192.168.1.16:8081/artifactory/libs-snapshot-local as admin
Downloading: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/maven-metadata.xml
[DEBUG] Could not find metadata sg.com.pinder:pinder:0.0.1-SNAPSHOT/maven-metadata.xml in ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local)
[DEBUG] Writing resolution tracking file /home/Eric_Vader/.m2/repository/sg/com/pinder/pinder/0.0.1-SNAPSHOT/resolver-status.properties
Uploading: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar
Uploading: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.000s
[INFO] Finished at: Fri Dec 27 16:48:15 SGT 2013
[INFO] Final Memory: 18M/216M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project pinder: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project pinder: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:157)
... 21 more
Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:280)
at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:211)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:443)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137)
... 23 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact sg.com.pinder:pinder:jar:0.0.1-20131227.084815-1 from/to ServerA2 (http://192.168.1.16:8081/artifactory/libs-snapshot-local): Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:939)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:837)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:467)
at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:274)
... 26 more
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://192.168.1.16:8081/artifactory/libs-snapshot-local/sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar. Return code is: 401
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:257)
at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:423)
at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:402)
at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:376)
at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:163)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:811)
... 28 more
[ERROR]
[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
Excerpt from access.log:
2013-12-27 16:48:15,328 [DENIED DEPLOY] libs-snapshot-local:sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.jar for anonymous/192.168.1.164.
2013-12-27 16:48:15,335 [DENIED DEPLOY] libs-snapshot-local:sg/com/pinder/pinder/0.0.1-SNAPSHOT/pinder-0.0.1-20131227.084815-1.pom for anonymous/192.168.1.164.
I tried most of the things suggested by other similar questions like:
trying setting the Maven Snapshot Version Behavior
setting, snapshot
tag in settings.xml.
One thing to note is that the log on the Artifactory server does not log anything when the error occur.