When deploying to maven, loading hangs forever
I am deploying a library to my maven remote repository.
when i run mvn -U deploy
or just mvn deploy
load the artifact everything looks fine. It just hangs there forever.
Similar:
Uploading: http://maven.mycompany.com/server-product/com/mycompany/product/server/common/Common/3.0/Common-3.0.jar
213/213 KB
I have read here , here , here and here , but they are all related to download, not download. I can download just fine, but my artifact download just hangs. These links are related to some bug of previous maven versions, I am usingApache Maven 3.3.3
The remote server is running Artifactory 3.6.0 (rev. 30178)
Does anyone know where the problem is? What am I doing wrong?
Here is my settings.xml file:
<?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>superSecretPassword</password>
<id>central</id>
</server>
<server>
<id>myCompany Maven</id>
<username>admin</username>
<password>superSecretPassword</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>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
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.myCompany.product.server.common</groupId>
<artifactId>Common</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>
(dependencies...)
</dependencies>
<distributionManagement>
<repository>
<id>myCompany Maven</id>
<name>myCompany Maven-releases</name>
<url>http://maven.myCompany.com/server-product</url>
</repository>
</distributionManagement>
</project>
And here is the way out mvn deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Common 3.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Common ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/dwnz/Development/Server/code/product/Common/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Common ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ Common ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ Common ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ Common ---
[INFO] Installing /Users/dwnz/Development/Server/code/product/Common/target/Common-3.0.jar to /Users/dwnz/.m2/repository/com/mycompany/product/server/common/Common/3.0/Common-3.0.jar
[INFO] Installing /Users/dwnz/Development/Server/code/product/Common/pom.xml to /Users/dwnz/.m2/repository/com/mycompany/product/server/common/Common/3.0/Common-3.0.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ Common ---
Uploading: http://maven.mycompany.com/server-product/com/mycompany/product/server/common/Common/3.0/Common-3.0.jar
213/213 KB ---->> Here it hangs *forever*!
source to share
I had a similar problem, exactly on execution release:perform
. It got stuck while loading. My solution was to add a plugin, change some versions and one group in the build section from:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<dependencies>
<dependency>
<groupId>com.google.code.maven-svn-wagon</groupId>
<artifactId>maven-svn-wagon</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
</plugin>
to
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<dependencies>
<dependency>
<groupId>org.jvnet.wagon-svn</groupId>
<artifactId>wagon-svn</artifactId>
<version>1.12</version>
</dependency>
</dependencies>
</plugin>
source to share
I had a similar problem and the solution was to add "artifactory" to the server path. After tracking the actual HTTP traffic, I could see that the server was correctly redirecting Maven from http://maven.myCompany.com/libs-release to http://maven.myCompany.com/artifactory/libs-release for download but for download this redirect doesn't work
So the answer for me was to change my pom to include the correct path and avoid the redirection:
<distributionManagement>
<repository>
<id>myCompany Maven</id>
<name>myCompany Maven-releases</name>
<url>http://maven.myCompany.com/artifactory/lib-snapshot-local</url>
</repository>
</distributionManagement>
source to share
In my case, I noticed that the deployment process hung when the system was downloading a small existing file from a remote repository and seemed to have the wrong byte count (for example, it was reported to have downloaded "1009/1008 bytes",). This sometimes happens when people are deploying from different OSes. My undoubtedly less optimal solution to this problem was to log into the remote repository and delete the offending file; this seemed to solve the problem when i tried to deploy the same project.
source to share
For me, adding this to the POM in the build / plugins was a crucial step:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<dependencies>
<dependency>
<!-- on its own, this very old plugin seems to include very old versions
of wagon-ssh, jsch and svnkit -->
<groupId>com.google.code.maven-svn-wagon</groupId>
<artifactId>maven-svn-wagon</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.53</version>
</dependency>
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.8.12</version>
</dependency>
</dependencies>
</plugin>
source to share