diff --git a/eclipse/plugin.properties b/eclipse/plugin.properties index 969c4e02..2e1f1bb0 100644 --- a/eclipse/plugin.properties +++ b/eclipse/plugin.properties @@ -24,3 +24,4 @@ # This accepts two values: 'all' for all the goals, # and 'plugins' to generate only the plugins' default goals. maven.eclipse.goals = plugins +maven.gen.src=${maven.build.dir}/generated-sources diff --git a/eclipse/src/plugin-resources/templates/classpath.jelly b/eclipse/src/plugin-resources/templates/classpath.jelly index cc00c2a1..4c6ddb36 100644 --- a/eclipse/src/plugin-resources/templates/classpath.jelly +++ b/eclipse/src/plugin-resources/templates/classpath.jelly @@ -27,6 +27,15 @@ trim="true"> + + + + + + + + + diff --git a/eclipse/src/plugin-test/maven.xml b/eclipse/src/plugin-test/maven.xml index eb710449..91177d28 100644 --- a/eclipse/src/plugin-test/maven.xml +++ b/eclipse/src/plugin-test/maven.xml @@ -20,7 +20,7 @@ xmlns:u="jelly:util" xmlns:x="jelly:xml"> - + @@ -38,57 +38,86 @@ - - - - + + + + - + - - - - - - + + + + + + - - - - + + + + + + + + + - - - - - - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dude ${dude} + Dude Parent ${dude.parent} + Dude Parent ${dude.files} + + file ${file} + + - - - - - \ No newline at end of file diff --git a/eclipse/xdocs/properties.xml b/eclipse/xdocs/properties.xml index b78e70ae..2da42f58 100644 --- a/eclipse/xdocs/properties.xml +++ b/eclipse/xdocs/properties.xml @@ -81,7 +81,7 @@ the classpath, like src/conf. - + maven.eclipse.buildcommands Yes @@ -89,7 +89,7 @@ to include in the project description file. - + maven.eclipse.projectnatures Yes @@ -98,6 +98,16 @@ will be added after the java nature. + + maven.gen.src + Yes (default=${maven.build.dir}/generated-sources) + + The directory that generated source code is placed. Maven will select + any directories under this as source code. This prevents the generated + source from being removed whenever Eclipse does a clean build, and allows + the generated code to be clearly in the build directory. + +

Note that you will need to defined a MAVEN_REPO Java @@ -132,5 +142,36 @@ in the eclipse classpath then you can set eclipse.dependency=false

+
+

+ When Eclipse is not generating source code for you there is a conflict between + Maven generating the source code and then Eclipse treating it as compiled code. + Typically when generating code using Maven the code ends up in the target/classes + directory. This is fine as long as Maven is doing the build. However, if Eclipse + is then setup to do the build, when Eclipse performs a clean build all the generated + code in target/classes will be removed. +

+

+ The alternatives typically are to place the generated code in the /src/java directory + and allow Maven and Eclipse to treat it the same. However, this leads to a tendency + to check generated code into source control, which typically is not appropriate for + generated code. Alternatively, it can be placed in some sort of /src/generated or + target/generated directory. In Maven2, generated code lives in target/generated-sources, + in a manner similiar to generated xdoc's live in target/generated-xdocs. Within the + target/generated-sources would be each type of generated code. +

+

+ For example, if you used the XDoclet Plugin for Maven to generate Hibernate mapping files, + they would be placed in /target/generated-sources/xdoclet/. While, if you used the + Hibernate Plugin for Maven to generate the SQL scripts for generating a database then that + would be placed in /target/generated-sources/schema/. +
+ Settings in project.properties: + +maven.xdoclet.hibernatedoclet.destDir=${maven.build.dir}/generated-sources/xdoclet +maven.hibernate.output.dir=${maven.build.dir}/generated-sources/schema + +

+