CXF Codegen Maven插件无法使用OpenJDK 11 [英] CXF codegen maven plugin doesn't work OpenJDK 11

查看:176
本文介绍了CXF Codegen Maven插件无法使用OpenJDK 11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在与JDK 9& 10和CXF codegen插件3.2.5和3.2.6没问题,但是,今天,我试图将我的代码库从Oracle JDK 10更新到OpenJDK 11 build 28,但是我总是遇到相同的错误:

I have been working with JDK 9 & 10 and CXF codegen plugin 3.2.5 and 3.2.6 with no problems but, today I'm trying to update my codebase from Oracle JDK 10 to OpenJDK 11 build 28, but I'm always getting the same error:

[INFO] Error occurred during initialization of boot layer
[INFO] java.lang.module.FindException: Module java.xml.ws not found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.747 s
[INFO] Finished at: 2018-10-17T16:38:38+02:00
[INFO] Final Memory: 17M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.2.6:wsdl2java (cerberus-wsdl) on project cerberus: 
[ERROR] Exit code: 1
[ERROR] Command line was: /opt/prod_jdk/bin/java --add-modules java.activation,java.xml.bind,java.xml.ws --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.runtime=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.marshaller=ALL-UNNAMED --add-opens java.xml.ws/javax.xml.ws.wsaddressing=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED -jar /tmp/cxf-tmp-2828938832312113909/cxf-codegen12095310072621993552.jar /tmp/cxf-tmp-2828938832312113909/cxf-w2j12256414556760820901args

这是我的使用CXF codegen插件的pom.xml:

this is my pom.xml that use CXF codegen plugin:

<plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>3.2.6</version>
                <configuration>
                    <fork>once</fork>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>javax.annotation</groupId>
                        <artifactId>javax.annotation-api</artifactId>
                        <version>1.3.2</version>
                    </dependency>

                    <dependency>
                        <groupId>javax.activation</groupId>
                        <artifactId>javax.activation-api</artifactId>
                        <version>1.2.0</version>
                    </dependency>

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

                    <dependency>
                        <groupId>org.glassfish.jaxb</groupId>
                        <artifactId>jaxb-runtime</artifactId>
                        <version>2.3.1</version>
                    </dependency>

                    <dependency>
                        <groupId>javax.xml.ws</groupId>
                        <artifactId>jaxws-api</artifactId>
                        <version>2.3.1</version>
                    </dependency>

                    <dependency>
                        <groupId>com.sun.xml.ws</groupId>
                        <artifactId>jaxws-rt</artifactId>
                        <version>2.3.1</version>
                    </dependency>
                </dependencies>
<executions>...</executions>
<plugin>

我错过了什么吗?据我所知,这应该与JDK 9和10中的工作方式相同.存在问题 https://issues.apache.org/jira/browse/CXF-7741 讨论了JDK 11的兼容性,但这也是针对CXF框架而不是针对插件的(我认为).

Am I missing something? As far as I know this should work the same way that in JDK 9 and 10. There is an issue https://issues.apache.org/jira/browse/CXF-7741 that talk about JDK 11 compatibility, but again this is for CXF framework not for the plugin (I think).

推荐答案

此问题将在cxf 3.3.0中解决(

This issue will be resolved in cxf 3.3.0 (https://issues.apache.org/jira/browse/CXF-7852)

现在,您可以在 https:的mvn-plugins目录中运行 mvn install : //github.com/apache/cxf 来构建插件,并将pom中的版本设置为3.3.0-SNAPSHOT

For now, you can run mvn install in the mvn-plugins directory of https://github.com/apache/cxf to build the plugins, and set version in pom to 3.3.0-SNAPSHOT

修改: 插件位于apache快照存储库中,因此最好从那里获取它:

Edit: Plugin is in the apache snapshots repo, so probably better to get it from there:

<pluginRepositories>         
   <pluginRepository>
      <id>apache.snapshots</id>
      <name>Maven Plugin Snapshots</name>
      <url>http://repository.apache.org/snapshots/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
</pluginRepositories>
<build>
  <plugins>
    <plugin>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-codegen-plugin</artifactId>
      <version>3.3.0-SNAPSHOT</version>
...

注意(2019-01-28):该插件现在为

Note (2019-01-28): The plugin is now released, we can add the dependency as usual:

<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-codegen-plugin</artifactId>
  <version>3.3.0</version>
  <type>maven-plugin</type>
</dependency>

这篇关于CXF Codegen Maven插件无法使用OpenJDK 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆