2013-12-10 22 views
10

私はMavenバージョン3.1.1を使用しています。そして私は依存関係のスプリングと一緒にコンパイルしようとしています。私は、これは以下のサイトを経由してMavenの中に存在する必要があることを参照してください。ここでは
Maven Repository
Maven Search
Maven依存関係を見つけることができません

は、スタックトレースですから "MVN -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:既存のリポジトリを削除し、MVNコンパイルを再実行した後

<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。私はまだエラーが発生します。これを行うために、より「定期的」な方法があるかどう

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

あなたはあなたのPOMを含むことができますか? –

+0

ローカルリポジトリを一掃し、問題が修正されているかどうかを確認することができます。 –

+0

@tieTYT私はMavenを初めて使っています。コマンドを私に提供してください。私たちは同じページにいます...そして私はそれを正しく行います;) – Joe

答えて

13

については

あなたは春-WSの検索を行う場合、あなたは正確にあなたに指定された何のためにダウンロード可能な唯一のPOMファイルがあることがわかりますpom.xml。

あなたがそうのように、スプリング-WS-コアを使用することがありますように見えます:settings.xmlファイルで

 <dependency> 
     <groupId>org.springframework.ws</groupId> 
     <artifactId>spring-ws-core</artifactId> 
     <version>2.1.4.RELEASE</version> 
    </dependency> 
+0

それはうまくいった!次回は、このようなことをどうやって考えていくのですか? – Joe

+3

私は経験から知っていました。私は私達の前後であなたのエラーをより慎重に読んで、それがデフォルトしていたレポの名前を見ました。それからあなたが指定したライブラリを探して、それがポンだけと言ったのを見ました。一般的には、javadocとソースjarでなくても、少なくともpomとjarがリストされていなければなりません。幸運な人。 –

+0

ありがとう、私はそれが "ダウンロード"列の下に "jar"のリストを参照してください。私はゆっくりとMavenのハングを取得しています:) – Joe

0

わからない。:あなたのローカルのMavenリポジトリに行き、その依存性があることと、すべてのファイルを削除することになっているディレクトリにcdは、(あなたも可能性org/sprimgframework/ws全体を削除してください)、次にmvnを再起動してください。すべての欠落している依存関係を再ロードしようとします。

+0

org/springframework/wsを削除しましたが、同じエラーが表示されます。 – Joe

+0

その依存関係のポームを見ると、ext3rnalリポジトリからダウンロードされているのがわかります...しかし私は私の電話を使用しているので、再確認することはできません。私はプロジェクトに同じ依存関係を使用していますので、どのように構成されているかをお知らせします。 – Andrea

+0

ありがとう、ありがとう。 spring-wsはかなり一般的に使用されるはずです。私はMaven初心者の間違いを作っていると確信しています。 – Joe

2

あなたのリポジトリを見つけるためにmavenが使用するsettings.xmlファイルを探します。それが何を指しているかを確認し、そこに存在するジャーが存在することを確認するためにそのレポを調べます。例The Central Repository

を見てみると

<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> 
+0

Mavenをダウンロードしたばかりなので、デフォルトです。 settings.xmlを見ると、 "profiles"タグには何もありません。 – Joe

+0

そこにレポのリストがありますか? –

+0

私は何も表示されません。コンパイル出力に基づいて、Mavenは "http://repo.maven.apache.org/maven2"を探しています。しかし、私はそれがどこで指定されているかわかりません。 – Joe

関連する問題