5

After upgrading from Java 8 to Java 10, I can't no longer deploy to AWS S3. I have this in the build section of my pom.xml:

    <extensions>
        <extension>
            <groupId>com.allogy.maven.wagon</groupId>
            <artifactId>maven-s3-wagon</artifactId>
            <version>1.1.0</version>
        </extension>
    </extensions>

and then I defined the repos:

<distributionManagement>
    <repository>
        <id>projectx-aws-release</id>
        <name>ProjectX AWS Release Repository</name>
        <url>s3://projectx-support/maven2</url>
    </repository>
    <snapshotRepository>
        <id>projectx-aws-snapshots</id>
        <name>ProjectX AWS Snapshot Repository</name>
        <url>s3://projectx-support/maven2</url>
    </snapshotRepository>
</distributionManagement>

This is the error I'm getting:

Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed: A required class was missing while executing org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy: javax/xml/bind/Datatype

Converter

The full output from when things start to go wrong is:

Uploading to projectx-aws-release: s3://projectx-support/maven2/tech/projectx/projectxcommon/1.0.0-beta.9/projectxcommon-1.0.0-beta.9.jar
[INFO] File permissions: Private
[INFO] Logged in - projectx-support
[INFO] Uploading: s3://projectx-support/maven2/tech/projectx/projectxcommon/1.0.0-beta.9/projectxcommon-1.0.0-beta.9.jar
[INFO] Logged off - projectx-support
[INFO] Transfers: 1 Time: 368ms Amount: 71.5k Throughput: 194.232 KB/s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.811 s
[INFO] Finished at: 2018-06-27T11:53:20+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project projectxcommon: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed: A required class was missing while executing org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy: javax/xml/bind/Datatype
Converter
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/pupeno/.m2/repository/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.jar
[ERROR] urls[1] = file:/C:/Users/pupeno/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[2] = file:/C:/Users/pupeno/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>tech.projectx:projectxcommon:1.0.0-beta.9, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : javax.xml.bind.DatatypeConverter
[ERROR] -> [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/PluginContainerException

Any ideas what's going on? Is this a class that was present in Java 8 and not in Java 10? That sounds unlikely.

I tried adding javax.xml.bind to my project this way:

    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>

but that made no difference in the error.

Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
  • 1
    Yes it's been removed from the classpath. Related: https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception-in-j – assylias Jun 27 '18 at 11:03
  • @assylias: when you don't have a `module-info.java`, doesn't Java behave like in the old way? – Pablo Fernandez Jun 27 '18 at 11:05
  • based on my experience: no, it doesn't. In my project, I had to add `javax.xml.bind:jaxb-api:2.3.0` to the dependencies. – assylias Jun 27 '18 at 11:07
  • I tried adding it, but it made no difference. I think it's because the error isn't happening on my application, but on maven or rather, that maven plug in and modifying the dependencies on my application doesn't change what's loaded/available for that plugin. – Pablo Fernandez Jun 27 '18 at 11:08
  • Yes that makes sense. You could try version 2.8.2 of the deploy plugin to see if it makes a difference. – assylias Jun 27 '18 at 11:11
  • 2
    @assylias: I'm not using the plug in directly, but through `maven-s3-wagon`, so, I'm not sure how to upgrade the transitive dependency or even if it's possible. I'm still new to Maven. – Pablo Fernandez Jun 27 '18 at 11:13
  • @pupeno **1.** You can explicitly specify `2.8.2` of `maven-deploy-plugin` in your `pom.xml` under `plugins` tag. **2.** Sharing from [an existing answer](https://stackoverflow.com/a/46086920/1746118) , try specifying the compiler plugin as :- ` org.apache.maven.plugins maven-compiler-plugin 3.7.0 9 --add-modules javax.xml.bind ` – Naman Jun 27 '18 at 16:17

1 Answers1

1

I managed to fix the issue updating the wagon from version 1.1.0 to 1.2.0