Set Java Compliance Level in CXF wsdl2java

牧云@^-^@ 提交于 2019-11-30 07:18:45

Actually, the code that CXF's wsdl2java command line tool is compatible with Java 5, it's just likely not compatible for Java 6. The reason is that it generates code that is JAX-WS 2.2 and JAXB 2.2 compliant. However, the versions of those API's included in Java 6 are only 2.1.

There are a few options:

1) Easiest is to add "-fe jaxws21" to the wsdl2java command to have it generate jaxws 2.1 compliant code instead of 2.2

2) Add the 2.2 api jars to the endorsed directory of your JDK

3) Configure the compiler plugin in maven to "endorse" the 2.2 jars

The wsdl2java documentation doesn't mention any options for specifying the Java version.

You could try using the Maven cxf-codegen-plugin to generate the client stubs, which should respect the Maven compiler's source and target versions.

If that doesn't work, you could configure Maven to use Java 6 by changing the source and target lines in the pom, like so:

               <source>1.6</source>
               <target>1.6</target>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!