Question

So, I have a multi-tiered Maven project. I'm using maven version 3.0.3 and Sonatype Nexus 2.0.3 hosted on Tomcat 6.0.24. The project builds (mvn clean install) cleanly, but mvn deploy fails on a random bundle halfway through. Deploying that bundle by hand also fails. I can use mvn deploy -rf :<next-bundle> and deploy the remainder of my artifacts, but that one bundle fails to upload. It also fails to upload if I do a mvn deploy on just that directory/project.

If I run mvn -X deploy, I get the following stack trace:

[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)

When this happens, exactly zero output is emitted to either the tomcat log ($tomcat_home/logs/catalina.out) or the Sonatype Nexus logs ($tomcat_home/sonatype-work/nexus/logs/nexus.log), even with Sonatype's log level set to DEBUG. The expected tree on the filesystem is totally empty, and the Tomcat user has full permissions on the entire sonatype-work tree. This behavior is consistent, even if I rename the bundle in question. If I rename a different project (one that uploads successfully via 'mvn deploy') to failing-project-name, it works. There aren't any obvious items in the POM that are different - it's basically identical to all my other POMS; I specify a few dependencies, and have build steps for cxf-codegen and maven-bundle-plugin.

Any thoughts? Any suggestions on how to even debug this?

Was it helpful?

Solution

Found it. I was being bitten by this bug:

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

Certain versions of apache's cxf-codegen-plugin (including 2.6.2, the one I was using) mess with proxy settings. The reason I wasn't seeing any entry in the Nexus logs is because the proxy settings were keeping the request from even getting there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top