MPECLIPSE-49 and 49 for working w/ source directories
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116137 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -108,6 +108,13 @@
|
||||
the generated code to be clearly in the build directory.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.eclipse.src.extension</td>
|
||||
<td>Yes (default=<code>zip</code>)</td>
|
||||
<td>
|
||||
The extension used for source attachments.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
Note that you will need to defined a <code>MAVEN_REPO</code> Java
|
||||
@@ -117,61 +124,6 @@
|
||||
<code>MAVEN_REPO</code> that points to your local Maven repository.
|
||||
</p>
|
||||
</section>
|
||||
<section name="Defining dependencies as eclipse projects">
|
||||
<p>
|
||||
The dependencies defined in the POM need not to be jars strictly. They can
|
||||
be projects in the eclipse workspace. If a dependency is an eclipse project
|
||||
a property needs to be added to that dependency to indicate so.
|
||||
</p>
|
||||
<source><![CDATA[
|
||||
<dependency>
|
||||
<groupId>group</groupId>
|
||||
<artifactId>artifact</artifactId>
|
||||
<version>version</version>
|
||||
<properties>
|
||||
<eclipse.dependency>true</eclipse.dependency>
|
||||
</properties>
|
||||
</dependency>
|
||||
]]></source>
|
||||
<p>
|
||||
This indicates that the dependency is another project in the workspace.
|
||||
Note that the name of the referenced project is the artifactId.
|
||||
</p>
|
||||
<p>
|
||||
The inverse also works. If you have included extra jars that shouldn't be
|
||||
in the eclipse classpath then you can set <code>eclipse.dependency=false</code>
|
||||
</p>
|
||||
</section>
|
||||
<section name="Generated Source Code integration w/ Eclipse">
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
<p>
|
||||
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/.
|
||||
<br/>
|
||||
Settings in project.properties:
|
||||
<source>
|
||||
maven.xdoclet.hibernatedoclet.destDir=${maven.build.dir}/generated-sources/xdoclet
|
||||
maven.hibernate.output.dir=${maven.build.dir}/generated-sources/schema
|
||||
</source>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</document>
|
||||
|
||||
Reference in New Issue
Block a user