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.
Well, you need to right click on the "target/generated-sources/xjc and select something like "Build Path -> Use as source folder"
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
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:
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.
For those who are suffering with maven-jaxb2-plugin and Eclipse not having source attached. The author has switched from the Sun to the Glassfish JAXB artifacts and the dependency tree has changed. Previously many JARs where shaded into
jaxb-xjc
without transitive ones. Now, this has been removed and the previous transitive dependency totools.jar
breaks Eclipse execution. Start your Eclipse with a JDK VM and it will work. (Tested most recent Maven 3.3.9, Maven JAXB2 Plugin 0.13.1, recent m2e JAXB2 connector and Eclipse Mars.2)