web-dev-qa-db-ja.com

Maven依存関係タイムアウト設定

Mavenは依存関係のダウンロード中にタイムアウト例外を報告します。デフォルトのタイムアウトは60000ですが、私の場合は増やす必要があります。それらのダウンロードされたファイルをその中間サーバーから取得します)。ここで問題が発生します。依存関係が単純に大きすぎて60000ミリ秒以上かかる場合、Eclipseは次の例外でバーストします

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Arquillian Persistence Extension Aggregator
[INFO] Arquillian Persistence Extension API
[INFO] Arquillian Persistence Extension SPI
[INFO] Arquillian Persistence Extension Core
[INFO] Arquillian Persistence Extension DBUnit Integration
[INFO] Arquillian Persistence Extension Integration Tests
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Arquillian Persistence Extension Aggregator 1.0.0.Final-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-Java-version) @ arquillian-persistence-parent ---
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven-version) @ arquillian-persistence-parent ---
[INFO] 
[INFO] --- maven-dependency-plugin:2.3:unpack (unpack) @ arquillian-persistence-parent ---
[INFO] Configured Artifact: org.wildfly:wildfly-dist:8.0.0.Final:Zip
Downloading: http://repo.maven.Apache.org/maven2/org/wildfly/wildfly-dist/8.0.0.Final/wildfly-dist-8.0.0.Final.Zip
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Arquillian Persistence Extension Aggregator ....... FAILURE [2:11.315s]
[INFO] Arquillian Persistence Extension API .............. SKIPPED
[INFO] Arquillian Persistence Extension SPI .............. SKIPPED
[INFO] Arquillian Persistence Extension Core ............. SKIPPED
[INFO] Arquillian Persistence Extension DBUnit Integration  SKIPPED
[INFO] Arquillian Persistence Extension Integration Tests  SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:11.908s
[INFO] Finished at: Wed May 07 11:27:41 PKT 2014
[INFO] Final Memory: 22M/177M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.Apache.maven.plugins:maven-dependency-plugin:2.3:unpack (unpack) on project arquillian-persistence-parent: Unable to resolve artifa
ct. Could not transfer artifact org.wildfly:wildfly-dist:Zip:8.0.0.Final from/to central (http://repo.maven.Apache.org/maven2): No response received after 60000
[ERROR] org.wildfly:wildfly-dist:Zip:8.0.0.Final
[ERROR] 
[ERROR] from the specified remote repositories:
[ERROR] central (http://repo.maven.Apache.org/maven2, releases=true, snapshots=false)
[ERROR] -> [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

60000以降に応答がない場合、この行は問題を引き起こします。

ソリューションとして:

settings.xmlを次の設定で使用しています

<settings>
  <servers>
    <server>
      <id>central</id>
      <configuration>
            <timeout>120000</timeout>
      </configuration>
    </server>
  </servers>
</settings>

一方、settings.xmlのパスは正しいと確信しています。

残念ながら動作しません。

11
rogue lad

このMavenガイド によると、タイムアウトを設定する新しい方法があります。 ~/settings.xml今はそのように読みます...

<server>
  <id>central</id>
  <configuration>
    <httpConfiguration>
      <all>
        <connectionTimeout>120000</connectionTimeout>
        <readTimeout>120000</readTimeout>
      </all>
    </httpConfiguration>
  </configuration>
</server>

私の場合はうまくいくようです。存在しないリポジトリで試したところ、両方のタイムアウトを5000に設定すると、以前よりもはるかに速く失敗するようです。試してみることはできますか?

20
danidemi