为什么mvn安装失败?

时间:2015-02-03 14:15:47

标签: java maven jar

我在一个多模块项目中工作。我进入唯一没有依赖的模块(功能)。我运行命令: mvn clean它的作品 mvn install它失败了 我不明白为什么,这里有堆栈跟踪:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.624s
[INFO] Finished at: Tue Feb 03 14:51:00 CET 2015
[INFO] Final Memory: 7M/16M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project com.: Could not resolve dependencies for project com.myapp:com.myapp.feature.api:bundle:1.1.1-SNAPSHOT: Could not find artifact com.myapp:feature.api:jar:1.1.1-SNAPSHOT -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project com.myapp.feature.api: Could not resolve dependencies for project com.myapp:com.myapp.feature.api:bundle:1.1.1-SNAPSHOT: Could not find artifact com.myapp:feature.api:jar:1.1.1-SNAPSHOT
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
    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.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.myapp:com.myapp.feature.api:bundle:1.1.1-SNAPSHOT: Could not find artifact com.myapp:feature.api:jar:1.1.1-SNAPSHOT
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:189)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
    ... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact com.myapp:feature.api:jar:1.1.1-SNAPSHOT
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:183)
    ... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact com.myapp:feature.api:jar:1.1.1-SNAPSHOT
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
    ... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact com.myapp:feature.api:jar:1.1.1-SNAPSHOT
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:528)
    ... 26 more

如果有人能解释我,你会给我一些想法,这会很棒。 提前谢谢。

1 个答案:

答案 0 :(得分:2)

认为信息很清楚:

Could not find artifact com.myapp:feature.api:jar:1.1.1-SNAPSHOT

在您的maven存储库中找不到工件com.myapp:feature.api:jar:1.1.1-SNAPSHOT