Maven - Can't deploy to remote repository - maven

I'm trying to deploy my library to my own remote maven repository. I'm using NetBeans 8
Here's my pom.xml:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.my.company.library.name</groupId>
<artifactId>LibraryId</artifactId>
<version>3.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
(... my dependencies...)
</dependencies>
<distributionManagement>
<repository>
<id>myServer</id>
<name>myServer Repository</name>
<url>http://maven.mycompany.com</url>
</repository>
</distributionManagement>
</project>
And here is my 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>dwnz</username>
<id>central</id>
</server>
<server>
<id>myServer</id>
<username>dwnz</username>
<password>mySuperSecretPassword</password>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://maven.mycompany.com/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://maven.mycompany.com/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://maven.mycompany.com/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://maven.mycompany.com/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
When I do Clean and Build I get the following ouput on NetBeans:
cd /Users/dwnz/Development/Server/code/project/myLibrary; JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home "/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/java/maven/bin/mvn" clean install
Scanning for projects...
------------------------------------------------------------------------
Building library 3.0
------------------------------------------------------------------------
--- maven-clean-plugin:2.4.1:clean (default-clean) # library ---
Deleting /Users/dwnz/Development/Server/code/project/myLibrary/target
--- maven-resources-plugin:2.5:resources (default-resources) # myLibrary ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
Copying 0 resource
--- maven-compiler-plugin:2.3.2:compile (default-compile) # myLibrary ---
Compiling 183 source files to /Users/dwnz/Development/Server/code/project/myLibrary/target/classes
--- maven-resources-plugin:2.5:testResources (default-testResources) # myLibrary ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory /Users/dwnz/Development/Server/code/project/myLibrary/src/test/resources
--- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # myLibrary ---
No sources to compile
--- maven-surefire-plugin:2.10:test (default-test) # myLibrary ---
No tests to run.
Surefire report directory: /Users/dwnz/Development/Server/code/project/myLibrary/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
--- maven-jar-plugin:2.3.2:jar (default-jar) # myLibrary ---
Building jar: /Users/dwnz/Development/Server/code/project/myLibrary/target/library-3.0.jar
--- maven-install-plugin:2.3.1:install (default-install) # myLibrary ---
Installing /Users/dwnz/Development/Server/code/project/myLibrary/target/library-3.0.jar to /Users/dwnz/.m2/repository/com/myCompany/project/server/myLibrary/library/3.0/library-3.0.jar
Installing /Users/dwnz/Development/Server/code/project/myLibrary/pom.xml to /Users/dwnz/.m2/repository/com/myCompany/project/server/myLibrary/library/3.0/library-3.0.pom
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 3.426s
Finished at: Mon May 11 17:16:22 WEST 2015
Final Memory: 18M/220M
------------------------------------------------------------------------
On my server I'm using Artifactory.
On my remote maven repository my library is not deployed. Any one knows or can spot what am I doing wrong here and why it is not deploying on my remote maven repository?
------ EDIT-------
I just tried using the mvn deploy on the command line still to no success. Here is the ouput from the command line:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myLibrary 3.0
[INFO] ------------------------------------------------------------------------
Downloading: http://maven.myserver.com/plugins-release/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
Downloading: http://maven.myserver.com/plugins-snapshot/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.119 s
[INFO] Finished at: 2015-05-11T18:22:35+01:00
[INFO] Final Memory: 8M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (http://maven.myserver.com/plugins-release): Not authorized , ReasonPhrase:Unauthorized. -> [Help 1]
[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/PluginResolutionException
Apparently it is trying to download some plugins from my remote server. I'm not the admin of that server so I can't get access to it, I just have an account there.

As pointed out by khmarbaise it was a server misconfiguration.

Related

Unable to get *.tar.gz files from Nexus Repository

I'm tring to install Maven Wrapper and get "Error installing the Maven Wrapper.: Server returned HTTP response code: 401" from my Nexus Repository.
To reproduce the error I can just remove a local cache of Maven Wrapper and try to install it to an empty folder:
rm -R ~/.m2/repository/io/takari/maven-wrapper/0.5.6/
mvn -N io.takari:maven:wrapper -Dmaven=3.8.4
The output:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven:0.7.7:wrapper (default-cli) # standalone-pom ---
Downloading from nexus: http://localhost:8081/repository/maven-public/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.pom
Downloaded from nexus: http://localhost:8081/repository/maven-public/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.pom (2.4 kB at 15 kB/s)
Downloading from nexus: http://localhost:8081/repository/maven-public/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Downloaded from nexus: http://localhost:8081/repository/maven-public/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar (51 kB at 1.5 MB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.103 s
[INFO] Finished at: 2022-03-21T10:45:51+05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.takari:maven:0.7.7:wrapper (default-cli) on project standalone-pom: Error installing the Maven Wrapper.: Server returned HTTP response code: 401 for URL: http://localhost:8081/repository/maven-public/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.tar.gz -> [Help 1]
[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
pom and jar files are downloaded just fine. The problem is with tar.gz file only.
Here is my settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings
xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>1</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<url>http://localhost:8081/repository/maven-public</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
The URL http://localhost:8081/repository/maven-public/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.tar.gz?describe is retrived just fine in a browser:
Code 200
Content-Type application/x-gzip
Size 51848
Error 401 is unauthorize error
Did you try to put an autologin config file in your user's home directory already?
Example: /Users/my_username/.netrc
machine nexus.somewhere.com
login correct_user
password correct_password
You also need to ensure the account is available and have valid permission to target lib

mvn install package from GitHub package registry

I've followed steps given in this document to deploy a package on GitHub package registry, I'm able to successfully deploy a package. That can be seen here.
Now I'm trying to install this as a dependency in another project. As given in the above link I added this dependency in my pom file.
<dependency>
<groupId>com.github.ashishchopra/github_package_registry</groupId>
<artifactId>group-upload.artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
Which obviously throws me this error:
[ERROR] 'dependencies.dependency.groupId' for com.github.ashishchopra/github_package_registry:group-upload.artifct-upload:jar with value 'com.github.ashishchopra/github_package_registry' does not match a valid id pattern.
Now I remove the part before / in the groupId and made dependency like this:
<dependency>
<groupId>github_package_registry</groupId>
<artifactId>group-upload.artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
Now I'm getting this error:
Downloading: https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/group-upload.artifct-upload-0.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.275 s
[INFO] Finished at: 2019-10-10T19:47:42+05:30
[INFO] Final Memory: 18M/67M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project artifct-download: Could not resolve dependencies
for project group-download:artifct-download:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at github_package_registry:group-upload.artifct-upload:jar:0.0.1: Failed to read artifact descriptor for github_package_registry:group-upload.artifct-upload:jar:0.0.1: Could not transfer artifact github_package_registry:group-upload.artifct-upload:pom:0.0.1 from/to github (https://maven.pkg.github.com/ashishchopra): Failed to transfer file: https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/group-upload.artifct-upload-0.0.1.pom. Return code is: 400 , ReasonPhrase:Bad Request. -> [Help 1]
I also tried removing groupId. part from artifactId in dependency and made it like this:
<dependency>
<groupId>github_package_registry</groupId>
<artifactId>artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
This time I'm getting this error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.417 s
[INFO] Finished at: 2019-10-10T19:52:08+05:30
[INFO] Final Memory: 18M/67M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project artifct-download: Could not resolve dependencies for project group-download:artifct-download:jar:0.0.1-SNAPSHOT: Could not find artifact github_package_registry:artifct-upload:jar:0.0.1 in central (https://repo1.maven.org/maven2) ->
[Help 1]
So with no combination, it seems to be working.
Content of my ~/.m2/settings.yml file:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>github</id>
<name>GitHub ashishchopra Apache Maven Packages</name>
<url>https://maven.pkg.github.com/ashishchopra</url>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>ashishchopra</username>
<password>XXXX</password>
</server>
</servers>
These are direct steps from their documentation, nothing fancy, still, I'm not able to make it work.
In-fact pom and jar files are present at this link
https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/artifct-upload-0.0.1.pom
https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/artifct-upload-0.0.1.jar
As per the documentation you pointed to, the URL of the maven repository should include the name of your GitHub repository, i.e. github_package_registry. So that’s what you need in your settings.xml:
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/ashishchopra/github_package_registry</url>
</repository>
</repositories>
And in your pom.xml, just use the dependency described in your GitHub Packages page:
<dependency>
<groupId>group-upload</groupId>
<artifactId>artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
for some reason is not looking in the right repo, try to put this at the top of your settings.yml
<repository>
<id>github</id>
<name>GitHub ashishchopra Apache Maven Packages</name>
<url>https://maven.pkg.github.com/ashishchopra</url>
</repository>

maven dependancy lookup fails even if I have specified repo

I am trying to run a project. Its not able to find a dependency. So I have added repository inside pom.xml
But its not able to lookup for the same.
from pom.xml
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>spring</id>
<name>Spring Framework Maven Release Repository</name>
<url>http://oss.sonatype.org/content/groups/public</url>
<layout>default</layout>
</repository>
</repositories>
81749 [WARNING] Unable to create Maven project for
com.gemstone.gemfire:gemfire:pom:8.1.0 from repository.
org.apache.maven.project.ProjectBuildingException: Error resolving
project artifact: Failure to find
com.gemstone.gemfire:gemfire:pom:8.1.0 in
https://repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced for project
com.gemstone.gemfire:gemfire:pom:8.1.0
when i applied -X i see following
103850 [DEBUG] === PROJECT BUILD PLAN ================================================
103850 [DEBUG] Project: xxxxx:xxxxxx:0.0.1-SNAPSHOT
103850 [DEBUG] Dependencies (collect): [compile+runtime]
103850 [DEBUG] Dependencies (resolve): [compile, compile+runtime, runtime, test]
103850 [DEBUG] Repositories (dependencies): [central (https://repo.maven.apache.org/maven2, default, releases)]
103850 [DEBUG] Repositories (plugins) : [central (https://repo.maven.apache.org/maven2, default, releases)]
What am I missing here ? I have parent pom.xml with repository mention
parent is not included in child
Given this pom.xml:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.gemstone.gemfire</groupId>
<artifactId>gemfire</artifactId>
<version>8.1.0</version>
</dependency>
</dependencies>
</project>
When I tried to run:
$mvn clean compile
The result was:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/com/gemstone/gemfire/gemfire/8.1.0/gemfire-8.1.0.pom
[WARNING] The POM for com.gemstone.gemfire:gemfire:jar:8.1.0 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/com/gemstone/gemfire/gemfire/8.1.0/gemfire-8.1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.642 s
[INFO] Finished at: 2017-04-02T13:31:34+01:00
[INFO] Final Memory: 11M/131M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project test:test:jar:0.1-SNAPSHOT: Could not find artifact com.gemstone.gemfire:gemfire:jar:8.1.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[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/DependencyResolutionException
So I researched for the dependency and repository in mvnrepository.com and I found the repositories that contains this dependency are Spring Plugins and Spring Libs:
Then I just added the Spring Plugins repository in my pom and it worked!
The final POM is:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.gemstone.gemfire</groupId>
<artifactId>gemfire</artifactId>
<version>8.1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring</id>
<url>http://repo.spring.io/plugins-release</url>
</repository>
</repositories>
</project>

maven deploy does not work for releases

Hi I am a beginner for maven build tool. I built a simple maven JavaEE project and I tried to build it remote nexus repository. But i can deploy successfully only for snapshots. Releases deploying gives 400 bad request error.
here is my Setting.xml configuration
<servers>
<server>
<id>****</id>
<username>****</username>
<password>****</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>central</mirrorOf>
<url>http://******:8081/nexus/content/groups/net.******.timetrack/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>*****</id>
<url>http://******:8081/nexus/content/groups/net.*******.timetrack/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>******</id>
<url>http://******:8081/nexus/content/groups/net.******.timetrack/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
and here is my pom.xml's distribution management
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>*****</id>
<name>******</name>
<url>http://*******:8081/nexus/content/groups/net.******.timetrack/</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<uniqueVersion>true</uniqueVersion>
<id>*****</id>
<name>***** Snapshots</name>
<url>http://******:8081/nexus/content/repositories/snapshots/</url>
<layout>legacy</layout>
</snapshotRepository>
</distributionManagement>
If I run mvn clean deploy with (for a snapshot)
<groupId>net.*****.*****</groupId>
<artifactId>*****-**-****</artifactId>
<version>1.4-SNAPSHOT</version>
<packaging>war</packaging>
then successfully deploy in to nexus repository snapshot directory.
If it I run mvn clean deploy with (for a release)
<groupId>net.*****.****</groupId>
<artifactId>****-***-*****</artifactId>
<version>1.4.1</version>
<packaging>war</packaging>
then it gives 400-bad request error
Here is the log for the error
[INFO]
[INFO] --- maven-war-plugin:2.6:war (default-war) # ****-****-***** ---
[INFO] Packaging webapp
[INFO] Assembling webapp [*****-time-tracker] in [/home/dilanka/Projects/time_tracker/samples/GitLab/****/***-time-tracker/target/*****-time-tracker-1.4]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/dilanka/Projects/time_tracker/samples/GitLab/*****/****-time-tracker/src/main/webapp]
[INFO] Webapp assembled in [115 msecs]
[INFO] Building war: /home/dilanka/Projects/time_tracker/samples/GitLab/TimeTracker/*****-time-tracker/target/****-time-tracker-1.4.war
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # ****-time-tracker ---
[INFO] Installing /home/dilanka/Projects/time_tracker/samples/GitLab/TimeTracker/****-time-tracker/target/****-time-tracker-1.4.war to /home/dilanka/maven3-repo/net/*****/timetrack/****-time-tracker/1.4/****-time-tracker-1.4.war
[INFO] Installing /home/dilanka/Projects/time_tracker/samples/GitLab/TimeTracker/****-time-tracker/pom.xml to /home/dilanka/maven3-repo/net/****/timetrack/****-time-tracker/1.4/****-time-tracker-1.4.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) # ****-time-tracker ---
Uploading: http://*****:8081/nexus/content/groups/net.*****.timetrack/net/****s/timetrack/***-time-tracker/1.4/****-time-tracker-1.4.war
Uploading: http://*****:8081/nexus/content/groups/net.****.timetrack/net/****/timetrack/****-time-tracker/1.4/****-time-tracker-1.4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.790 s
[INFO] Finished at: 2016-01-08T15:28:08+05:30
[INFO] Final Memory: 32M/252M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project ****-time-tracker: Failed to deploy artifacts: Could not transfer artifact net.****.timetrack:*****-time-tracker:war:1.4 from/to ***** (http://*****:8081/nexus/content/groups/net.****.timetrack/): Failed to transfer file: http://*****:8081/nexus/content/groups/net.****.timetrack/net/*****/timetrack/*****-time-tracker/1.4/****-time-tracker-1.4.war. Return code is: 400, ReasonPhrase: Bad Request. -> [Help 1]
[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
If any body please help me to solve this problem.
Thanks.
You can deploy a release version of a given artifact exactly once to a given Nexus instance.
If the same version already exists in your Nexus, you'll get an error like the one you're seeing.
<url>http://*******:8081/nexus/content/groups/net.****.timetrack/</url>
You can't deploy into a group repository, change this URL to be the URL of a hosted release repository.

maven release:prepare with artifactory deploy substep fails

after researching now for days and close to suicidal tendencies here my problem and really really hope that i was too stupid to find the problem by myself ....
setup: windows7 / maven 3.2.3 / jdk 1.7.0_60 (64bit) / artifactory 3.5.0
Problem:
- mvn clean install deploy --> works
- mvn release:prepare --> works
- mvn release:perform fails in substep deploy (which works standalone as mentioned before)
- POM.XML and settings.xml (for testing i took the pregenerated one from artifactory) for me. but i attached them further down....
thnx in advance for ANY help!
cheers
j.
log:
.....
[INFO] [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) # apps.hr ---
[INFO] Uploading: http://vm-local-repo.fernbach-lu.dom:8081/artifactory/libs-release-local/com/fernbach/apps.hr/0.1.4/apps.hr-0.1.4.war
[INFO] 2/75918 KB
[INFO] 4/75918 KB
[INFO] 6/75918 KB
[INFO] 8/75918 KB
....
[INFO] 60/75918 KB
[INFO] Apr 01, 2015 4:56:30 PM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
[INFO] 62/75918 KB
[INFO] INFO: I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] 64/75918 KB
[INFO] Apr 01, 2015 4:56:30 PM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
[INFO] INFO: Retrying request
[INFO] 66/75918 KB
[INFO] Apr 01, 2015 4:56:30 PM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
[INFO] 68/75918 KB
.....
.....
[INFO] 390/75918 KB
[INFO] 392/75918 KB
[INFO]
[INFO] Uploading: http://vm-local-repo.fernbach-lu.dom:8081/artifactory/libs-release-local/com/fernbach/apps.hr/0.1.4/apps.hr-0.1.4.pom
[INFO] 2/2 KB
[INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 23.043 s
[INFO] [INFO] Finished at: 2015-04-01T16:56:30+02:00
[INFO] [INFO] Final Memory: 47M/366M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project apps.hr: Failed to
deploy artifacts: Could not transfer artifact com.fernbach:apps.hr:war:0.1.4 from/to fs-releases (http://vm-local-repo.fernbach-lu.dom:8081
/artifactory/libs-release-local): Connection reset by peer: socket write error -> [Help 1]
...
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">
<localRepository>d:/fr4/maven/repo</localRepository>
<servers>
<server>
<username>jus</username>
<password>AP6XtRyuPNMVbXfnzP9BopSDp66</password>
<id>central</id>
</server>
<server>
<username>jus</username>
<password>AP6XtRyuPNMVbXfnzP9BopSDp66</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://vm-local-repo:8081/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://vm-local-repo:8081/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://vm-local-repo:8081/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://vm-local-repo:8081/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
POM.XML
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<parent>
<groupId>com.fernbach</groupId>
<artifactId>fernbach.parent</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>apps.hr</artifactId>
<version>0.1.5-SNAPSHOT</version>
<packaging>war</packaging>
<name>HR</name>
<properties>
<foundation.version>1.0.0</foundation.version>
</properties>
<dependencies>
<dependency>
<groupId>com.fernbach</groupId>
<artifactId>foundation.core</artifactId>
<version>${foundation.version}</version>
</dependency>
<dependency>
<groupId>com.fernbach</groupId>
<artifactId>foundation.web</artifactId>
<version>${foundation.version}</version>
</dependency>
</dependencies>
<scm>
<developerConnection>scm:svn:http://vm-uranus1.fernbach-lu.dom/svn/fernbach-R4/apps/hr/branches/BRANCH_0.1.1</developerConnection>
<url>scm:svn:http://vm-uranus1.fernbach-lu.dom/svn/fernbach-R4/apps/hr/branches/BRANCH_0.1.1</url>
</scm>
</project>
I finally found a solution in a comment of a Maven Bug that had been reported for version 3.2.3.
Here's the bug: https://issues.apache.org/jira/browse/MNG-5684
The problem is the maven-source-plugin which is used to attach source jars to the project. More exactly it's the no-fork goals that cause this behavior. Using these goals the deploy plugin tries to upload the source jars twice which fails due to repository restrictions.
The solution can either be omitting the source-plugin (but then you won't have attached sources anymore) or using the forked goals (jar and test-jar) instead.
I now use the forked goals with maven 3.3.3 and I'm able to release projects again.

Resources