量産メモ帳

忘れっぽいのでメモを残しています。浅く適当に書きます。

Maven-3.0.4 で install を実行すると、リポジトリに surefire-junit3-2.7.1.jar が見つからないエラーが出る。

スポンサーリンク

一応、問題は解決したけど、メモを残しておきます。


最初、settings.xml を以下のように記述して install を実行したら、、、

<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">
 <localRepository/>
 <interactiveMode/>
 <usePluginRegistry/>
 <offline/>
 <pluginGroups/>
 <servers/>
 <mirrors/>
 <proxies/>
 <profiles/>
 <activeProfiles/>
</settings>

以下のようなエラーが出ました。


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.1:test (default-test) on project pdf2excel:
Error to resolving surefire provider dependency:
Could not transfer artifact org.apache.maven.surefire:surefire-junit3:jar:2.7.1 from/to central (http://repo1.maven.org/maven2):
Failed to create a selector. to http://repo1.maven.org/maven2/org/apache/maven/surefire/surefire-junit3/2.7.1/surefire-junit3-2.7.1.jar



そこで、mirrors の部分を以下のように書き換えて、再度実行したら、、、

<mirrors>
 <mirror>
  <id>UK</id>
  <name>UK Central</name>
  <url>http://uk.maven.org/maven2
  <mirrorOf>central</mirrorOf>
 </mirror>
</mirrors>

今度は以下のようなエラーが出ました。


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project pdf2excel:
Execution default-clean of goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean failed:
Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved:
Could not transfer artifact org.codehaus.plexus:plexus-utils:jar:2.0.5 from/to UK (http://uk.maven.org/maven2): java.net.ConnectException:
Failed to create a selector. to http://uk.maven.org/maven2/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar:
Unable to establish loopback connection: Connection refused: connect -> [Help 1]



ただし、surefire-junit3-2.7.1.jar の方はダウンロードできたので、mirrors 部分をコメントアウトして、再度実行したら、install が成功しました。


ダウンロードする度に、settings.xml を書き換えるなんて格好悪いけど、とりあえず目的は達成できたので、settings.xml の書きっぷりは放置です。


参考記事: