首页 > 解决方案 > 从 Java 8 升级到 Java 10 后无法将 jars 部署到 S3,这是怎么回事?

问题描述

从 Java 8 升级到 Java 10 后,我无法再部署到 AWS S3。我在 pom.xml 的构建部分中有这个:

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

然后我定义了回购:

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

这是我得到的错误:

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

转换器

当事情开始出错时的完整输出是:

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

有什么想法吗?这是一个存在于 Java 8 而不是 Java 10 的类吗?这听起来不太可能。

我尝试javax.xml.bind以这种方式添加到我的项目中:

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

但这对错误没有影响。

标签: javamavenjava-10

解决方案


我设法解决了将旅行车从版本 1.1.0 更新到 1.2.0 的问题


推荐阅读