maven release to nexus 3.0.1 using maven-release-plugin is failing

287 views
Skip to first unread message

Debraj Manna

unread,
Aug 26, 2016, 1:08:31 AM8/26/16
to Nexus Users

Just cross-posting this from stackoverflow:-

I am using nexus-3.0.1 OSS (with default set-up) with maven 3.3.9 to do a release as mentioned in this link.

My pom.xml looks like below:-

<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.sonatype.blog</groupId>
    <artifactId>git-demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>git-demo</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <distributionManagement>
        <repository>
            <id>nexusReleases</id>
            <name>Releases</name>
            <url>http://localhost:8081/repository/maven-releases/</url>
        </repository>

        <snapshotRepository>
            <id>nexusSnapshots</id>
            <name>Snapshots</name>
            <url>http://localhost:8081/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    <scm>
        <connection>scm:git:g...@github.com:debraj-manna-jabong/git-demo.git</connection>
        <url>scm:git:g...@github.com:debraj-manna-jabong/git-demo.git</url>
        <developerConnection>scm:git:g...@github.com:debraj-manna-jabong/git-demo.git</developerConnection>
    </scm>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <releaseProfiles>releases</releaseProfiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <serverId>nexusSnapshots</serverId>
                    <nexusUrl>http://localhost:8081/</nexusUrl>
                    <skipStaging>true</skipStaging>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>releases</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <executions>
                            <execution>
                                <id>default-deploy</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <serverId>nexusReleases</serverId>
                            <nexusUrl>http://localhost:8081/</nexusUrl>
                            <skipStaging>true</skipStaging>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

My settings.xml looks like below:-

<?xml version="1.0" encoding="UTF-8" ?>
<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">

<servers>
   <server>
      <id>nexusReleases</id>
      <username>admin</username>
      <password>admin123</password>
   </server>
   <server>
      <id>nexusSnapshots</id>
      <username>admin</username>
      <password>admin123</password>
   </server>
</servers>
</settings>

But whenever I am executing mvn release:clean it is failing with the below error:-

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:clean (default-cli) on project git-demo: Execution default-cli of goal org.apache.maven.plugins:maven-release-plugin:2.4.1:clean failed: Plugin org.apache.maven.plugins:maven-release-plugin:2.4.1 or one of its dependencies could not be resolved: Could not transfer artifact org.codehaus.groovy:groovy-all:jar:1.7.6 from/to central (https://repo.maven.apache.org/maven2): GET request of: org/codehaus/groovy/groovy-all/1.7.6/groovy-all-1.7.6.jar from central failed: Connection reset -> [Help 1]

However everything works find mvn clean deploy and I am able to see the jar in the snapshot repo in nexus.

Below is full maven output while executing mvn release:clean :-

Can someone let me know what is going wrong?

jabongs-MacBook-Pro-4:git-demo debraj$ mvn release:clean
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Not installing Nexus Staging features:
[INFO]  * Preexisting staging related goal bindings found in 1 modules.
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.4.1/maven-release-plugin-2.4.1.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.4.1/maven-release-plugin-2.4.1.jar (50 KB at 17.9 KB/sec)
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building git-demo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-release-plugin:2.4.1:clean (default-cli) @ git-demo ---
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.pom (2 KB at 2.8 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.2/maven-plugin-tools-3.2.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.2/maven-plugin-tools-3.2.pom (17 KB at 26.4 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/release/maven-release-manager/2.4.1/maven-release-manager-2.4.1.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/release/maven-release-manager/2.4.1/maven-release-manager-2.4.1.pom (10 KB at 19.0 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.1/maven-invoker-2.1.pom
Aug 25, 2016 9:16:47 PM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo.maven.apache.org:443: Connection reset
Aug 25, 2016 9:16:47 PM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo.maven.apache.org:443
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.1/maven-invoker-2.1.pom (6 KB at 2.6 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/release/maven-release-manager/2.4.1/maven-release-manager-2.4.1.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.1/maven-invoker-2.1.jar
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/1.7.6/groovy-all-1.7.6.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/release/maven-release-manager/2.4.1/maven-release-manager-2.4.1.jar (184 KB at 141.3 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.jar (15 KB at 9.6 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.1/maven-invoker-2.1.jar (29 KB at 18.1 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.089 s
[INFO] Finished at: 2016-08-25T21:16:55+05:30
[INFO] Final Memory: 12M/165M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:clean (default-cli) on project git-demo: Execution default-cli of goal org.apache.maven.plugins:maven-release-plugin:2.4.1:clean failed: Plugin org.apache.maven.plugins:maven-release-plugin:2.4.1 or one of its dependencies could not be resolved: Could not transfer artifact org.codehaus.groovy:groovy-all:jar:1.7.6 from/to central (https://repo.maven.apache.org/maven2): GET request of: org/codehaus/groovy/groovy-all/1.7.6/groovy-all-1.7.6.jar from central failed: Connection reset -> [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

Kelly Robinson

unread,
Aug 26, 2016, 1:39:58 AM8/26/16
to Debraj Manna, Nexus Users
Responded on Stackoverflow


        <connection>scm:git:git@github.com:debraj-manna-jabong/git-demo.git</connection>

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/CAF6DVKPgyUuyOGpcH2yVPn%3DAcZG7n3Wy3jafff_WQQ1c9uNR%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

Reply all
Reply to author
Forward
0 new messages