2016-08-25 12 views
0

私はnexus-3.0.1 OSS(デフォルト設定で)をmaven 3.3.9と使用して、このlinkで説明したリリースを行っています。maven-release-pluginを使用したmavenリリースが失敗しています

私の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>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:[email protected]:debraj-manna-jabong/git-demo.git</connection> 
     <url>scm:git:[email protected]:debraj-manna-jabong/git-demo.git</url> 
     <developerConnection>scm:git:[email protected]: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>[email protected]{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> 

マイsettings.xmlは、以下のようになります -

<?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> 

しかし、私はmvn release:cleanを実行していたときに、それは以下のエラーで失敗している: -

[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] 

しかし、すべてが動作します。mvn clean deployと私は、ネクサスのスナップショットレポのjarファイルを見ることができます。 mvn release:cleanを実行しながらフルMavenの出力は以下

です: -

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 

誰かが間違って起こっているものを私が知っていることはできますか?

答えて

1

私が見ることができる情報の重要な部分がある:Mavenの中心からこのライブラリをダウンロードし、いくつかの問題があったよう

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

が見える、と私はあなたがURLにhttps://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/1.7.6/groovy-all-1.7.6.jar

に達することができることを確実にすることを示唆していますまた、settings.xmlを設定して、依存関係を解決するためにNexusを利用すると便利です。https://books.sonatype.com/nexus-book/3.0/reference/maven.html#maven-sect-single-group

最後に、pomはnexus-staging-maven-plugi nは、Nexus PROでのみ使用可能なステージング機能に依存します。あなたは安全にその設定を削除しても、ネクサスに展開することができます

希望します。助けてください:

+0

それはネットワークの問題でした。私はあなたの答えの最後の部分に疑念があります。私は ' true'を追加しました。ステージングをスキップしてはいけませんか? – tuk

+0

Nexus PROを使用していない限り、OSSバージョンには通信するためのステージングAPIがないため、このプラグインを設定する必要はありません。 – TheKaptain

+0

Nexusステージングプラグインは、Nexus Proを使用していない場合でも展開のための機能を追加しました。 Nexusを使用する必要があります。しかし、それは、複数の成果物を構築し、すべてが適切に構築された場合にのみ公開するようなものを可能にします。より多くの機能があるかもしれません。 –

関連する問題