I have a maven project in eclipse and have maven goals that run annotation processors to generate code. The output folder for this code is target/generated-sources/apt.
In order for eclipse to see this generated code I need to add target/generated-sources/apt as a source folder to the eclipse project.
However, this causes there to be an error of type "Maven Configuration Problem" saying
Project configuration is not up-to-date with pom.xml. Run project configuration update
I think I understand why this is the case as eclipse has a different set of source folders to maven's set. But I need this different set, as I need eclipse to be able to see the generated source folders...
When doing a pure maven built, these source folders will be included in the build, by maven.
btw, I have upgraded to the official eclipse release of the maven eclipse plugin, m2e 1.0 - what used to be m2eclipse. I'd like to see if I can find a work around/solution to this with the m2e plugin before I have to go back to the old m2eclipse version.
In m2e 1.0 the handling of Maven plugins has changed. You might be lacking a specific m2e extension for your code generating plugin. Here is all the documentation I managed to find.
This bug report may also be relevant.
This was what I found that worked good using spring 3.1.1 which does have the 3.0.6 version as well in it. Once I got the plugins setup and put into the correct area of the pom and included the argline and endorseddirs to have the java sources put out into the target/generated-sources/cxf folder then maven generated the sources ok.
....
If your wsdl folder is in ${basedir}/src/main/resources it'll find it automatically
Hope this helps! ~wildbill
After switching to new versions of m2e/maven/apt,... i had builderrors because of the duplicated files, caused by the added buildpath by the buildhelper, so i needed to remove the "apt-generated"-Folders from the buildhelper.
To fix the Problem in Eclipse, not adding the "apt-generated"-folder via Update Maven Configuration in M2E, i've written a M2E Plugin to fix this problem. It adds the outputDirectories configured in the maven-apt-plugin to the buildpath of the Project.
https://apt-m2e.googlecode.com
You need to attach the source directory with the build-helper-plugin.
Like so:
You will also need to:
Eclipse Java EE IDE for Web Developers. Version: Juno Service Release 1
work perfectly.
But in eclipse I have the same error on Asinc class.
Just press F5 on project. Fix this problem.
the configuration to the build helper plugin did work for us.
but be aware, that the destination folder always has to be equal to the configuration of the plugin u're using for the annotation processing itself.
for example the maven-processor-plugin uses the target folder ${project.build.directory}/generated-sources/apt as default. if you wish another destination for your generated source files you can set it by the tag as shown below.