27 March 2017

今天发现jenkins构建失败,错误内容如下:


[ERROR] Failed to execute goal on project snow-payment-provider: Could not resolve dependencies for project .................., mysql:mysql-connector-java:jar:5.1.24 (compile), org.bouncycastle:bcmail-jdk15:jar:1.46 (compile)]: Failed to read artifact descriptor for org.jetbrains:annotations-java5:jar:RELEASE: Failed to resolve version for org.jetbrains:annotations-java5:jar:RELEASE: Could not find metadata org.jetbrains:annotations-java5/maven-metadata.xml in local (/data/maven/maven3.0.5/repo) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :snow-payment-provider

使用如下命令打包测试一下:

maven package -e -Dmaven.test.skip=true 输出下面错误:

[ERROR] Failed to execute goal on project snow-payment-provider: Could not resolve dependencies for project..........., com.alibaba:dubbo:jar:2.8.4 (compile), com.github.sgroschupf:zkclient:jar:0.1 (compile), org.nutz:nutz:jar:1.r.59 (compile), org.springframework:spring-context:jar:4.3.5.RELEASE (compile), org.jetbrains:annotations-java5:jar:RELEASE (compile), com.alibaba:druid:jar:1.0.9 (compile), mysql:mysql-connector-java:jar:5.1.24 (compile), org.bouncycastle:bcmail-jdk15:jar:1.46 (compile)]: Failed to read artifact descriptor for org.jetbrains:annotations-java5:jar:RELEASE: Failed to resolve version for org.jetbrains:annotations-java5:jar:RELEASE: Could not find metadata org.jetbrains:annotations-java5/maven-metadata.xml in local (/data/maven/maven3.0.5/repo) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project snow-payment-provider: Could not resolve dependencies for project cn.xuezhongdai:snow-payment-provider:jar:1.0: Failed to collect dependencies for [cn.xuezhongdai:snow-payment-api:jar:1.0 (compile), cn.xuezhongdai:snow-cache-api:jar:1.0 (compile), cn.xuezhongdai:snow-utility:jar:1.0 (compile), com.alibaba:dubbo:jar:2.8.4 (compile), com.github.sgroschupf:zkclient:jar:0.1 (compile), org.nutz:nutz:jar:1.r.59 (compile), org.springframework:spring-context:jar:4.3.5.RELEASE (compile), org.jetbrains:annotations-java5:jar:RELEASE (compile), com.alibaba:druid:jar:1.0.9 (compile), mysql:mysql-connector-java:jar:5.1.24 (compile), org.bouncycastle:bcmail-jdk15:jar:1.46 (compile)]
	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:606)
	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 cn.xuezhongdai:snow-payment-provider:jar:1.0: Failed to collect dependencies for [cn.xuezhongdai:snow-payment-api:jar:1.0 (compile), cn.xuezhongdai:snow-cache-api:jar:1.0 (compile), cn.xuezhongdai:snow-utility:jar:1.0 (compile), com.alibaba:dubbo:jar:2.8.4 (compile), com.github.sgroschupf:zkclient:jar:0.1 (compile), org.nutz:nutz:jar:1.r.59 (compile), org.springframework:spring-context:jar:4.3.5.RELEASE (compile), org.jetbrains:annotations-java5:jar:RELEASE (compile), com.alibaba:druid:jar:1.0.9 (compile), mysql:mysql-connector-java:jar:5.1.24 (compile), org.bouncycastle:bcmail-jdk15:jar:1.46 (compile)]
	at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:158)
	at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
	... 22 more
Caused by: org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for [cn.xuezhongdai:snow-payment-api:jar:1.0 (compile), cn.xuezhongdai:snow-cache-api:jar:1.0 (compile), cn.xuezhongdai:snow-utility:jar:1.0 (compile), com.alibaba:dubbo:jar:2.8.4 (compile), com.github.sgroschupf:zkclient:jar:0.1 (compile), org.nutz:nutz:jar:1.r.59 (compile), org.springframework:spring-context:jar:4.3.5.RELEASE (compile), org.jetbrains:annotations-java5:jar:RELEASE (compile), com.alibaba:druid:jar:1.0.9 (compile), mysql:mysql-connector-java:jar:5.1.24 (compile), org.bouncycastle:bcmail-jdk15:jar:1.46 (compile)]
	at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:258)
	at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:308)
	at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:150)
	... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.jetbrains:annotations-java5:jar:RELEASE
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:257)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
	at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:412)
	at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:240)
	... 25 more
Caused by: org.sonatype.aether.resolution.VersionResolutionException: Failed to resolve version for org.jetbrains:annotations-java5:jar:RELEASE: Could not find metadata org.jetbrains:annotations-java5/maven-metadata.xml in local (/data/maven/maven3.0.5/repo)
	at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:287)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:250)
	... 28 more
Caused by: org.sonatype.aether.transfer.MetadataNotFoundException: Could not find metadata org.jetbrains:annotations-java5/maven-metadata.xml in local (/data/maven/maven3.0.5/repo)
	at org.sonatype.aether.impl.internal.DefaultMetadataResolver.resolve(DefaultMetadataResolver.java:215)
	at org.sonatype.aether.impl.internal.DefaultMetadataResolver.resolveMetadata(DefaultMetadataResolver.java:173)
	at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:225)
	... 29 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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

最终发现org.jetbrains:annotations-java5:jar 这个maven以来中缺少maven-metadata.xml文件。 解决办法: 渠道本地仓库将这个包删除掉,重新下载即可。





blog comments powered by Disqus
Fork me on GitHub