gpt4 book ai didi

java - Maven Deploy Plugin S3 Wagon with Java 11 不适用于 JAXB

转载 作者:行者123 更新时间:2023-12-01 14:03:23 26 4
gpt4 key购买 nike

我正在尝试将我的构建从 Java 8 迁移到 Java 11。我的存储库位于 S3 存储桶中。为了使 S3 wagon 与 Java-11 一起工作,我添加了 JAXB 作为插件的依赖项:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<dependencies>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>
</plugin>

不幸的是,它仍然没有帮助并且部署插件失败。

错误日志片段(可以在classpath中看到jaxb):
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy-file: javax/xml/bind/DatatypeConverter
-----------------------------------------------------
realm = plugin>org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/root/.m2/repository/org/apache/maven/plugins/maven-deploy-plugin/3.0.0-M1/maven-deploy-plugin-3.0.0-M1.jar
urls[1] = file:/root/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2.jar
urls[2] = file:/root/.m2/repository/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar
urls[3] = file:/root/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.jar
urls[4] = file:/root/.m2/repository/org/glassfish/jaxb/txw2/2.3.2/txw2-2.3.2.jar
urls[5] = file:/root/.m2/repository/com/sun/istack/istack-commons-runtime/3.0.8/istack-commons-runtime-3.0.8.jar
urls[6] = file:/root/.m2/repository/org/jvnet/staxex/stax-ex/1.8.1/stax-ex-1.8.1.jar
urls[7] = file:/root/.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.16/FastInfoset-1.2.16.jar
urls[8] = file:/root/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
urls[9] = file:/root/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
urls[10] = file:/root/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
urls[11] = file:/root/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
urls[12] = file:/root/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar
urls[13] = file:/root/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[14] = file:/root/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[15] = file:/root/.m2/repository/org/apache/maven/shared/maven-artifact-transfer/0.10.0/maven-artifact-transfer-0.10.0.jar
urls[16] = file:/root/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/3.0.1/maven-common-artifact-filters-3.0.1.jar
urls[17] = file:/root/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.1.0/maven-shared-utils-3.1.0.jar
urls[18] = file:/root/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar
urls[19] = file:/root/.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar
urls[20] = file:/root/.m2/repository/org/codehaus/plexus/plexus-utils/3.1.0/plexus-utils-3.1.0.jar

设置中还缺少什么?

-编辑-

作为解决方案,我设法通过移动货车扩展使其工作:
    <build>
<extensions>
<extension>
<groupId>org.zalando.org.springframework.build</groupId>
<artifactId>aws-maven</artifactId>
<version>5.0.0.RELEASE-zal-2</version>
</extension>
</extensions>
</build>

maven-deploy-plugin依赖项部分。但对我来说,它看起来像是一种解决方法,而不是问题的答案。
  • 编辑 2 -

  • 对我们有用的最终解决方案是使用由较新的 AWS SDK(选择 com.github.nodely:maven-s3-wagon:1.0.0)构建的 S3 wagon 扩展。按需要工作(将扩展添加为插件的依赖项很麻烦,因为它必须添加到任何使用 S3 存储库的插件中)。

    理解原始问题以及如何将依赖项应用于此类运行时情况仍然会很好。

    最佳答案

    我设法解决了完全相同的问题,但使用此扩展名使用了不同的 wagon 实现。它必须是支持 Java 11 的 1.2.0 版本。

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

    关于java - Maven Deploy Plugin S3 Wagon with Java 11 不适用于 JAXB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58945487/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com