web-dev-qa-db-ja.com

Mavenは依存関係の検索に失敗しました

Mavenバージョン3.1.1を使用しています。そして、私は依存関係springs-wsでコンパイルしようとしています。これは、次のサイトを介してMavenに存在するはずです。
Mavenリポジトリ
Maven検索

「mvn compile -e」のスタックトレースは次のとおりです。

>mvn compile -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Test 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.233s
[INFO] Finished at: Tue Dec 10 13:44:36 CST 2013
[INFO] Final Memory: 6M/122M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Test: Could not resolve depe
ndencies for project Test:Test:jar:1.0.0: Failure to find org.spri
ngframework.ws:spring-ws:jar:2.1.4.RELEASE in http://repo.maven.Apache.org/maven
2 was cached in the local repository, resolution will not be reattempted until t
he update interval of central has elapsed or updates are forced -> [Help 1]
org.Apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
n project Test: Could not resolve dependencies for project Test:Co
rrectAddress:jar:1.0.0: Failure to find org.springframework.ws:spring-ws:jar:2.1
.4.RELEASE in http://repo.maven.Apache.org/maven2 was cached in the local reposi
tory, resolution will not be reattempted until the update interval of central ha
s elapsed or updates are forced
        at org.Apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.Java:220)
        at org.Apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol
veProjectDependencies(LifecycleDependencyResolver.Java:127)
        at org.Apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr
eResolved(MojoExecutor.Java:257)
        at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.Java:200)
        at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.Java:153)
        at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.Java:145)
        at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.Java:84)
        at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.Java:59)
        at org.Apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.Java:183)
        at org.Apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.Java:161)
        at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:317)
        at org.Apache.maven.DefaultMaven.execute(DefaultMaven.Java:152)
        at org.Apache.maven.cli.MavenCli.execute(MavenCli.Java:555)
        at org.Apache.maven.cli.MavenCli.doMain(MavenCli.Java:214)
        at org.Apache.maven.cli.MavenCli.main(MavenCli.Java:158)
        at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at Sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at Sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at Java.lang.reflect.Method.invoke(Unknown Source)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.Java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.Java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.Java:
356)
Caused by: org.Apache.maven.project.DependencyResolutionException: Could not res
olve dependencies for project Test:Test:jar:1.0.0: Failure to find
 org.springframework.ws:spring-ws:jar:2.1.4.RELEASE in http://repo.maven.Apache.
org/maven2 was cached in the local repository, resolution will not be reattempte
d until the update interval of central has elapsed or updates are forced
        at org.Apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.Java:198)
        at org.Apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.Java:195)
        ... 22 more
Caused by: org.Eclipse.aether.resolution.DependencyResolutionException: Failure
to find org.springframework.ws:spring-ws:jar:2.1.4.RELEASE in http://repo.maven.
Apache.org/maven2 was cached in the local repository, resolution will not be rea
ttempted until the update interval of central has elapsed or updates are forced
        at org.Eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDepen
dencies(DefaultRepositorySystem.Java:384)
        at org.Apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.Java:192)
        ... 23 more
Caused by: org.Eclipse.aether.resolution.ArtifactResolutionException: Failure to
 find org.springframework.ws:spring-ws:jar:2.1.4.RELEASE in http://repo.maven.ap
ache.org/maven2 was cached in the local repository, resolution will not be reatt
empted until the update interval of central has elapsed or updates are forced
        at org.Eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(Defa
ultArtifactResolver.Java:459)
        at org.Eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtif
acts(DefaultArtifactResolver.Java:262)
        at org.Eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDepen
dencies(DefaultRepositorySystem.Java:367)
        ... 24 more
Caused by: org.Eclipse.aether.transfer.ArtifactNotFoundException: Failure to fin
d org.springframework.ws:spring-ws:jar:2.1.4.RELEASE in http://repo.maven.Apache
.org/maven2 was cached in the local repository, resolution will not be reattempt
ed until the update interval of central has elapsed or updates are forced
        at org.Eclipse.aether.internal.impl.DefaultUpdateCheckManager.newExcepti
on(DefaultUpdateCheckManager.Java:232)
        at org.Eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtif
act(DefaultUpdateCheckManager.Java:206)
        at org.Eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownlo
ads(DefaultArtifactResolver.Java:599)
        at org.Eclipse.aether.internal.impl.DefaultArtifactResolver.performDownl
oads(DefaultArtifactResolver.Java:518)
        at org.Eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(Defa
ultArtifactResolver.Java:436)
        ... 26 more
[ERROR]
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.Apache.org/confluence/display/MAVEN/DependencyReso
lutionException

他に役立つ情報を投稿する必要がある場合はお知らせください。どんな助けも大歓迎です。

UPDATE:

<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>Test</groupId>
    <artifactId>Test</artifactId>
    <version>1.0.0</version>
    <dependencies>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>3.2.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>3.2.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.ws</groupId>
            <artifactId>spring-ws</artifactId>
            <version>2.1.4.RELEASE</version>
        </dependency>
    </dependencies>
</project>



UPDATE 2:
既存のリポジトリを削除し、mvn compileを再実行した後。それでもエラーが発生します。

[ERROR] Failed to execute goal on project Test: Could not resolve depe
ndencies for project Test:Test:jar:1.0.0: Could not find artifact
org.springframework.ws:spring-ws:jar:2.1.4.RELEASE in central (http://repo.maven
.Apache.org/maven2), try downloading from http://www.springsource.com/download/c
ommunity?project=Spring%20Web%20Services -> [Help 1]
12
Joe

中央リポジトリ を見る

Spring-wsを検索すると、pom.xmlで正確に指定したものについて、ダウンロードできるのはpomファイルのみであることがわかります。

あなたは次のようにspring-ws-coreを使用したいと思うかもしれません:

<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-core</artifactId>
    <version>2.1.4.RELEASE</version>
</dependency>
13
Robert Beltran

Mavenがリポジトリーを見つけるために使用するsettings.xmlファイルを探します。それが指しているリポジトリを参照し、そのリポジトリを調べて、必要なjarがそこに存在することを確認します。

例えば

<profiles>
    <profile>
        <id>default</id>
        <repositories>
            <repository>
                <id>smss-group-m2</id>
                <url>http://repo.mycompany.net/nexus/content/groups/smss-group-m2/</url>
                <releases>
                    <updatePolicy>always</updatePolicy>
                </releases>
            <repository>
        </repository>
    </profile>
</profiles>
2
Robert Beltran

これを行うためのより「通常の」方法があるかどうかはわかりません:ローカルのMavenリポジトリに移動し、その依存関係があるはずのディレクトリに移動し、すべてのファイルを削除します(org/sprimgframework/ws)その後、mvnを再起動します。不足している依存関係をすべて再ロードしようとします。

0
Andrea