web-dev-qa-db-fra.com

Maven n'a pas réussi à trouver la dépendance

J'utilise Maven Version 3.1.1. Et j'essaye de compiler avec dependency springs-ws. Je vois que cela devrait exister dans Maven via les sites suivants:
Maven Repository
Recherche Maven

Voici la trace de pile d'un "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

S'il vous plaît laissez-moi savoir si je devrais poster toute autre information pour aider. Toute aide est grandement appréciée.

METTRE À JOUR:

<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:
Après la suppression du référentiel existant et la réexécution de la compilation mvn. J'ai toujours l'erreur.

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

En regardant Le référentiel central

Si vous effectuez une recherche sur spring-ws, vous verrez qu’il n’ya qu’un fichier pom à télécharger pour ce que vous avez précisément spécifié dans votre pom.xml.

On dirait que vous voudrez peut-être utiliser spring-ws-core comme ceci:

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

Recherchez votre fichier settings.xml qui est ce que maven utilise pour trouver vos référentiels. Voyez sur quel repo il pointe et examinez-le pour vous assurer que les pots que vous voulez y existent.

Par exemple 

    <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>
2
Robert Beltran

Je ne sais pas s’il existe un moyen plus "habituel" de procéder: rendez-vous dans votre référentiel Maven local, allez dans le répertoire dans lequel cette dépendance est supposée être et supprimez tous les fichiers (vous pouvez même supprimer l’ensemble de l’organisation/sprimgframework/ws) puis relancez mvn. Il essaiera de recharger toutes les dépendances manquantes. 

0
Andrea