Maven部署仅对某些捆绑包进行静默失败

时间:2013-01-26 23:14:13

标签: maven tomcat tomcat6 nexus sonatype

所以,我有一个多层Maven项目。我正在使用托管在Tomcat 6.0.24上的maven版本3.0.3和Sonatype Nexus 2.0.3。该项目干净地构建(mvn clean install),但mvn deploy在一半的随机包中失败。手动部署该捆绑包也会失败。我可以使用mvn deploy -rf :<next-bundle>并部署我的工件的其余部分,但是一个包无法上传。如果我只对该目录/项目执行mvn deploy,它也无法上传。

如果我运行mvn -X deploy,我会得到以下堆栈跟踪:

[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://nexushost:8080/nexus/content/repositories/my-snapshots/ as nexusadmin
Downloading: http://nexushost:8080/nexus/content/repositories/my-snapshots/my-toplevel/catalog/failing-project-name/1.2.0-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata my-toplevel.catalog:failing-project-name:1.2.0-SNAPSHOT/maven-metadata.xml from/to snapshots (http://nexushost:8080/nexus/content/repositories/my-snapshots/): Access denied to: http://nexushost:8080/nexus/content/repositories/my-snapshots/my-toplevel/catalog/failing-project-name/1.2.0-SNAPSHOT/maven-metadata.xml
org.sonatype.aether.transfer.MetadataTransferException: Could not transfer metadata my-toplevel.catalog:failing-project-name:1.2.0-SNAPSHOT/maven-metadata.xml from/to snapshots (http://nexushost:8080/nexus/content/repositories/my-snapshots/): Access denied to: http://nexushost:8080/nexus/content/repositories/my-snapshots/my-toplevel/catalog/failing-project-name/1.2.0-SNAPSHOT/maven-metadata.xml
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$3.wrap(WagonRepositoryConnector.java:932)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$3.wrap(WagonRepositoryConnector.java:923)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:695)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:689)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.get(WagonRepositoryConnector.java:445)
        at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:379)
        at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260)
        at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480)
        at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137)
        at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:156)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        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:319)
        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:616)
        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.wagon.authorization.AuthorizationException: Access denied to: http://nexushost:8080/nexus/content/repositories/my-snapshots/my-toplevel/catalog/failing-project-name/1.2.0-SNAPSHOT/maven-metadata.xml
        at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:119)
        at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
        at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
        at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:608)
        at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:64)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)

发生这种情况时,即使Sonatype的日志级别设置为DEBUG,也会向tomcat日志($tomcat_home/logs/catalina.out)或Sonatype Nexus日志($tomcat_home/sonatype-work/nexus/logs/nexus.log)发出正确的零输出。文件系统上的预期树是完全空的,并且Tomcat用户对整个sonatype-work树具有完全权限。即使我重命名有问题的捆绑包,此行为也是一致的。如果我将一个不同的项目(一个通过'mvn deploy'成功上传的项目)重命名为faileding-project-name,它就可以了。 POM中没有任何明显的项目是不同的 - 它与我所有其他POMS基本相同;我指定了一些依赖项,并为cxf-codegen和maven-bundle-plugin构建了构建步骤。

有什么想法?关于如何调试这个的任何建议?

1 个答案:

答案 0 :(得分:0)

找到它。我被这个错误所困扰:

https://issues.apache.org/jira/browse/CXF-4687

某些版本的apache的cxf-codegen-plugin(包括2.6.2,我正在使用的那个)混乱了代理设置。我没有在Nexus日志中看到任何条目的原因是因为代理设置阻止了请求甚至到达那里。