[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[m2e-dev] Build Context implementation
|
Hi,
so after reading the page
https://wiki.eclipse.org/M2E_compatible_maven_plugins i have worked on a
plugin to get an integration with Eclipse...
I tried with mojo codehaus templating-maven-plugin...and a other plugin...
First templating-maven-plugin is a plugin which filters source code...so
it's a little more complicated...
https://fisheye.codehaus.org/changelog/mojo/?cs=20112
The problem i'm currently faced with is that this plugin has it sources
in src/main/java-templates plus the appropriate package name...
The generated code will be created in
target/generated-sources/java-templates...
After the generation of the java files into
target/generated-sources/java-templates i have called
buildContext.refresh ( outputDirectory)
which tell Eclipse that something has changed in target folder...
which works very well...
But the real problem is that i can't get it to show the real source
folder shown correctly in Eclipse...
The folder src/main/java-templates ...in contradiction the folder
target/generated/java-templates will be shown as sources folder which
seemed to be cause by adding this folder
getMavenProject().addCompileSourceRoot( ... );
If i manually add the src/main/java-templates as a source folder the
problem arises that JDT compiles the classes from there automaticially
which results in duplicate class messages...
The template plugin already add the folder as compileSourceRoot...which
does not implies that the folder is being adding in Eclipse as a source
folder...
So the next plugin i have tried to support via buildContext has more or
less that same problem...
I can edit the files in Eclipse and simply store and the execution on
incremental/configuration will be executed and the result of the
generated configuration files can viewed in eclipse also if you
have the generated file already open in Eclipse...
+-- src
+--- config
+-- taget
+ classes
+--- config
But i can't get to work to get shown the folder src/stage-config being
shown as source folder like src/main/resources ?
If i try to go via getMavenProject().addResource()... it will be picked
up by maven-resources-plugin... which will cause problems...
I'm not sure where my real problem is located...either a
misunderstanding simply a thing or something else...
May be someone has a good idea / hint ?
Kind regards
Karl Heinz Marbaise