Maven JAXB Generated Classes not in Eclipse Classpath [message #646994] |
Mon, 03 January 2011 17:12  |
Eclipse User |
|
|
|
Hi,
I'm using the maven-jaxb2-plugin from org.jvnet.jaxb2.maven2 to generate model objects. The plugin successfully parses my XSD, generates the Java Source (in target/generated-sources/xjc), compiles, and packages the class files in a JAR file.
Using just Maven, the project builds fine. Maven knows about the generated classes.
However in Eclipse (using the Sonatype Maven integration plugin), the generated classes aren't in the Eclipse classpath. Eclipse reds the generated class imports.
I had to edit the Eclipse classpath to include target/generated-sources/xjc so Eclipse resolves generated classes, but I do not think its a good idea to put target directories in the classpath.
How do I get Eclipse to recognize the generated classes?
Here is my POM:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<executions>
<execution>
<id>sitemap</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaDirectory>${basedir}/source/main/resources</schemaDirectory>
<localRepository></localRepository>
<schemaIncludes>
<include>app.configuration.xsd</include>
</schemaIncludes>
<args>
<param>-npa</param>
</args>
<npa>true</npa>
<removeOldOutput>true</removeOldOutput>
<verbose>false</verbose>
</configuration>
</execution>
</executions>
</plugin>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06911 seconds