I'm trying to deploy maven artifacts into Artifactory repository using command : maven deploy .
I followed instructions from Maven documentation and JFrog :
https://maven.apache.org/plugins/maven-deploy-plugin/usage.html
For the moment, maven deploy:deploy-file works.
I assume credentials stored in settings.xml and corresponding repository id are correct.
But when running maven deploy I got the error :
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project my-app: Failed to deploy artifacts: Could not transfer artifact com.mvn.deployment:my-app:jar:1.0-20190518.184733-1 from/to snapshots
Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
Do you have any idea why would deploy-file work and deploy is not working ?
Thanks
maven deploy:deploy-file working :
mvn deploy:deploy-file -Durl=REPO_URL \
-DrepositoryId="snapshots" \
-Dfile=PATH_TO_JAR \
-DgroupId="Project" \
-DartifactId="test-project" \
-Dversion="0.0.1-SNAPSHOT"
While mvn deploy gives an error :
mvn deploy
ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-
plugin:2.8.2:deploy (default-deploy) on project my-app: Failed to deploy
artifacts: Could not transfer artifact
com.mvn.deployment:my-app:jar:1.0-20190518.184733-1 from/to snapshots
Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
UPDATE :
I did some tests using different versions of maven and found the problem appears from version 3.5.0, the mvn deploy command works on maven 3.3.9 and I think it's related to new version of maven-wagon as in version 3.5.0 they upgraded Maven Wagon from 2.10 to 2.12.
By adding this config to my pom.xml mvn deploy works :
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>2.10</version>
</extension>