Under Helios/m2eclipse, when I generated jaxb sources they would be put on the Eclipse source path when I did an "Update Project Configuration".
This doesn't happen with Indigo/m2e (initial release of 22 June 2011). What do I need to do to fix this?
I'm using the standard maven-jaxb2-plugin, version 0.75.
In Eclipse go to "Install New Software" add the software site: http://bitstrings.github.com/m2e-connectors-p2/releases/
Select the "m2e connector for jaxb2"
Once you get that plugin installed the jaxb2 plugin should integrate correctly with the new version of m2e.
This info is from: https://bugs.eclipse.org/bugs/show_bug.cgi?id=350299
Well, you need to right click on the "target/generated-sources/xjc and select something like "Build Path -> Use as source folder"
As an alternate workaround if you can't get the m2e connector working, you can add the generated sources to the build path with build-helper-maven-plugin:
<build>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/xmlbeans</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
...
</build>
While waiting for a fix for this problem, I'm using the following temporary workaround:
We have the jaxb-plugin and generated classes in a separate maven module. In eclipse I can then "disable Maven nature" on that module only. Then I can use Indigo with m2eclipse on the rest of our large maven project and it will depend on the jar for the jaxb module (must be built from the command line). This works well for me since our project was allready organized this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With