How do i force the cxf-codegen-plugin (CXF wsdltojava) Maven plugin to generate for Javaee 5?
whilst using Maven and the cxf-codegen-plugin from apache it seems to generate code for Java ee 6. I can tell by the error message ../generated-sources/cxf/.../cxf/gen/prod/IProd.java: cannot find symbol symbol : class Action location: interface ....IP开发者_运维技巧rod
Action is only in jee6++
How can i force it to generate for Javaee 5? Are there any flags - cant find any.
Everything is set to Java 1.5 on computer,Java_Home and java -version gives 1.5.. i have the java EE 5 api on compilepath. The plugin in maven is set to 1.5. Still...
EDIT: Solved, see comments.
I generate my JAX-WS classes with another plugin
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<target>2.0</target>
<packageName>some.pack.age</packageName> <!-- The name of your generated source package -->
</configuration>
<!--
if you want to use a specific version of JAX-WS, you can do so like
this
-->
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.1.4</version>
</dependency>
</dependencies>
</plugin>
You should add your wsdl's files in
/src/wsdl/
You need to specify the java version in you maven compiler plugin like this: (and include the "bootclasspath" if it still generates wrong code)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<encoding>UTF-8</encoding>
<bootclasspath>${java.home}\lib\rt.jar</bootclasspath>
</configuration>
</plugin>
精彩评论