Initial revision
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112724 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
3
eclipse/.cvsignore
Normal file
3
eclipse/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
target
|
||||
velocity.log
|
||||
maven.log
|
||||
142
eclipse/plugin.jelly
Normal file
142
eclipse/plugin.jelly
Normal file
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project xmlns:j="jelly:core">
|
||||
|
||||
<!--==================================================================-->
|
||||
<!-- Generate Eclipse .project and .classpath files -->
|
||||
<!--==================================================================-->
|
||||
<goal name="eclipse"
|
||||
description="Generate Eclipse project files"
|
||||
prereqs="eclipse:generate-project"/>
|
||||
|
||||
<goal name="eclipse:generate-project"
|
||||
description="Generate Eclipse .project and .classpath project files">
|
||||
|
||||
<echo>Creating ${basedir}/.project ...</echo>
|
||||
|
||||
<j:file name="${basedir}/.project" prettyPrint="true" xmlns="dummy">
|
||||
<projectDescription>
|
||||
<name>${pom.artifactId}</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
</j:file>
|
||||
|
||||
<echo>Creating ${basedir}/.classpath ...</echo>
|
||||
|
||||
<j:file name="${basedir}/.classpath" prettyPrint="true" xmlns="dummy">
|
||||
<classpath>
|
||||
|
||||
<j:if test="${sourcesPresent}">
|
||||
<classpathentry kind="src" path="${pom.build.sourceDirectory}"/>
|
||||
</j:if>
|
||||
|
||||
<j:if test="${unitTestSourcesPresent}">
|
||||
<classpathentry kind="src" path="${pom.build.unitTestSourceDirectory}"/>
|
||||
</j:if>
|
||||
|
||||
<classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
|
||||
<j:forEach var="lib" items="${pom.artifacts}">
|
||||
<classpathentry kind="var" path="MAVEN_REPO${lib.urlPath}"/>
|
||||
</j:forEach>
|
||||
<classpathentry kind="output" path="target\classes"/>
|
||||
</classpath>
|
||||
</j:file>
|
||||
|
||||
</goal>
|
||||
|
||||
<!--==================================================================-->
|
||||
<!-- Generate Eclipse mappings for Maven goals -->
|
||||
<!--==================================================================-->
|
||||
<goal name="eclipse:external-tools"
|
||||
description="Generate an Eclipse external tool for each goal">
|
||||
<mkdir dir="${maven.build.dir}/eclipse/"/>
|
||||
<j:set var="toolFile" value="${maven.build.dir}/eclipse/externaltools.xml" />
|
||||
|
||||
<echo>Creating ${toolFile}</echo>
|
||||
|
||||
<j:set var="os" value="${os.name}" />
|
||||
<j:set var="windows" value="${os.toLowerCase().indexOf('windows') != '-1'}"/>
|
||||
<echo>Adapting the generated file for a ${os} box.</echo>
|
||||
|
||||
<!-- Strangely, j:file inserts a space between ${maven.home} and /bin/maven ... -->
|
||||
<j:set var="tool.loc" value="${maven.home}${file.separator}bin${file.separator}maven"/>
|
||||
<j:if test="${windows}">
|
||||
<j:set var="tool.loc" value="${tool.loc}.bat"/>
|
||||
</j:if>
|
||||
|
||||
<j:file name="${toolFile}" prettyPrint="true" xmlns="dummy">
|
||||
<externaltools>
|
||||
<j:set var="project" value="${org.apache.commons.jelly.werkz.Project}"/>
|
||||
|
||||
<j:forEach var="goal" items="${project.goals}">
|
||||
|
||||
<j:set var="maven.eclipse.generate" value="false"/>
|
||||
<j:set var="allGoals" value="${maven.eclipse.goals}" />
|
||||
<j:choose>
|
||||
<j:when test="${allGoals == 'all'}">
|
||||
<j:set var="maven.eclipse.generate" value="true"/>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<j:if test="${goal.name.indexOf(':') == '-1'}">
|
||||
<j:set var="maven.eclipse.generate" value="true"/>
|
||||
</j:if>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
|
||||
<j:if test="${maven.eclipse.generate}">
|
||||
<tool>
|
||||
<entry key="!{tool_refresh}">$${project}</entry>
|
||||
<entry key="!{tool_show_log}">true</entry>
|
||||
<entry key="!{tool_loc}">${tool.loc}</entry>
|
||||
<entry key="!{tool_args}">-e -p $${resource_loc} ${goal.name}</entry>
|
||||
<entry key="!{tool_block}">false</entry>
|
||||
<entry key="!{tool_type}">org.eclipse.ui.externaltools.type.program</entry>
|
||||
<entry key="!{tool_dir}">$${container_loc}</entry>
|
||||
<entry key="!{tool_build_types}"></entry>
|
||||
<entry key="!{tool_name}">Maven ${goal.name}</entry>
|
||||
</tool>
|
||||
</j:if>
|
||||
</j:forEach>
|
||||
</externaltools>
|
||||
</j:file>
|
||||
|
||||
<j:set var="ws" value="${maven.eclipse.workspace}X" />
|
||||
<j:if test='${ws != "X"}'>
|
||||
<j:set var="toDir" value="${maven.eclipse.workspace}/.metadata/.plugins/org.eclipse.ui.externaltools/" />
|
||||
<copy file="${toolFile}" todir="${toDir}"/>
|
||||
</j:if>
|
||||
|
||||
</goal>
|
||||
|
||||
<!--==================================================================-->
|
||||
<!-- Add MAVEN_REPO to classpath variables -->
|
||||
<!--==================================================================-->
|
||||
<goal name="eclipse:add-maven-repo"
|
||||
description="Ensure that the classpath variable MAVEN_REPO is available">
|
||||
|
||||
<j:set var="ws" value="${maven.eclipse.workspace}X" />
|
||||
<j:choose>
|
||||
<j:when test='${ws != "X"}'>
|
||||
<j:set var="variableFile" value="${maven.eclipse.workspace}/.metadata/.plugins/org.eclipse.jdt.core/pref_store.ini" />
|
||||
<propertyfile file="${variableFile}">
|
||||
<entry key="org.eclipse.jdt.core.classpathVariable.MAVEN_REPO"
|
||||
default="${maven.repo.local}" />
|
||||
</propertyfile>
|
||||
</j:when>
|
||||
<j:otherwise>The property $${maven.eclipse.workspace} was not set. MAVEN_REPO may not be set.</j:otherwise>
|
||||
</j:choose>
|
||||
</goal>
|
||||
|
||||
</project>
|
||||
10
eclipse/plugin.properties
Normal file
10
eclipse/plugin.properties
Normal file
@@ -0,0 +1,10 @@
|
||||
# -------------------------------------------------------------------
|
||||
# P L U G I N P R O P E R I E S
|
||||
# -------------------------------------------------------------------
|
||||
# Eclipse plugin.
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
# Generate Eclipse external tools mappings for the specified goals.
|
||||
# This accepts two values: 'all' for all the goals,
|
||||
# and 'plugins' to generate only the plugins' default goals.
|
||||
maven.eclipse.goals = plugins
|
||||
5
eclipse/project.properties
Normal file
5
eclipse/project.properties
Normal file
@@ -0,0 +1,5 @@
|
||||
# -------------------------------------------------------------------
|
||||
# P R O J E C T P R O P E R T I E S
|
||||
# -------------------------------------------------------------------
|
||||
maven.xdoc.date=left
|
||||
maven.xdoc.version=${pom.currentVersion}
|
||||
42
eclipse/project.xml
Normal file
42
eclipse/project.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project>
|
||||
|
||||
<extend>${basedir}/../project.xml</extend>
|
||||
<pomVersion>3</pomVersion>
|
||||
<id>maven-eclipse-plugin</id>
|
||||
<name>Maven Eclipse Plug-in</name>
|
||||
<currentVersion>1.2-SNAPSHOT</currentVersion>
|
||||
|
||||
<description>
|
||||
A plugin to generate various files for the Eclipse IDE and ease the use of
|
||||
Maven within that environment
|
||||
</description>
|
||||
|
||||
<shortDescription>Eclipse Plugin for Maven</shortDescription>
|
||||
|
||||
<url>http://jakarta.apache.org/turbine/maven/reference/plugins/eclipse/</url>
|
||||
<issueTrackingUrl>http://jira.werken.com/BrowseProject.jspa?id=10030</issueTrackingUrl>
|
||||
<siteAddress>jakarta.apache.org</siteAddress>
|
||||
<siteDirectory>/www/jakarta.apache.org/turbine/maven/reference/plugins/eclipse/</siteDirectory>
|
||||
<distributionDirectory>/www/jakarta.apache.org/builds/jakarta-turbine-maven/</distributionDirectory>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Vincent Massol</name>
|
||||
<id>vmassol</id>
|
||||
<email>vmassol@octo.com</email>
|
||||
<organization>Octo Technology</organization>
|
||||
<roles>
|
||||
<role>Java Developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>dIon Gillard</name>
|
||||
<id>dion</id>
|
||||
<email>dion@multitask.com.au</email>
|
||||
<organization>Multitask Consulting</organization>
|
||||
<roles><role>Java Developer</role></roles>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
</project>
|
||||
1
eclipse/xdocs/.cvsignore
Normal file
1
eclipse/xdocs/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
stylesheets
|
||||
26
eclipse/xdocs/changes.xml
Normal file
26
eclipse/xdocs/changes.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
<properties>
|
||||
<title>Changes</title>
|
||||
<author email="dion@multitask.com.au">dIon Gillard</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<release version="1.2" date="in CVS">
|
||||
<action dev="dion" type="add">
|
||||
Added more documentation
|
||||
</action>
|
||||
</release>
|
||||
<release version="1.1" date="2002-10-01">
|
||||
<action dev="dion" type="update">
|
||||
Made the default to process Maven actions in the background
|
||||
</action>
|
||||
</release>
|
||||
<release version="1.0" date="2002-08-17">
|
||||
<action dev="jvanzyl" type="add">
|
||||
Initial release for Maven 1.0-beta6
|
||||
</action>
|
||||
</release>
|
||||
</body>
|
||||
</document>
|
||||
|
||||
76
eclipse/xdocs/goals.xml
Normal file
76
eclipse/xdocs/goals.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Eclipse Plugin Goals</title>
|
||||
<author email="dion@apache.org">dIon Gillard</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<goals>
|
||||
<goal>
|
||||
<name>eclipse</name>
|
||||
<description>
|
||||
The default goal. This goal simply executes the
|
||||
<a href="#eclipse:generate-project">eclipse:generate-project</a> goal
|
||||
</description>
|
||||
</goal>
|
||||
|
||||
<goal>
|
||||
<name>eclipse:generate-project</name>
|
||||
<description>
|
||||
Generates a <code>.project</code> file for eclipse describing
|
||||
the project and 'marking' it as a java project
|
||||
<br />
|
||||
Generates a <code>.classpath</code> file for the eclipse project
|
||||
with classpath entries for
|
||||
<ol>
|
||||
<li>the build source directory</li>
|
||||
<li>the build unit test source directory</li>
|
||||
<li>the JRE being used</li>
|
||||
<li>each Maven project <code>dependency</code></li>
|
||||
<li>an output directory for compiled code:
|
||||
<code>target\eclipse\classes</code>
|
||||
</li>
|
||||
</ol>
|
||||
</description>
|
||||
</goal>
|
||||
|
||||
<goal>
|
||||
<name>eclipse:external-tools</name>
|
||||
<description>
|
||||
<p>
|
||||
Generates an external tool entry for each default goal available to
|
||||
a Maven project into a file named <code>externaltools.xml</code>
|
||||
</p>
|
||||
<p>
|
||||
If the <a href="properties.html">${maven.eclipse.workspace}</a>
|
||||
property is set, the file is copied to the correct location within
|
||||
that workspace
|
||||
</p>
|
||||
<p>
|
||||
If the <a href="properties.html">${maven.eclipse.workspace}</a>
|
||||
is <strong>not</strong> set, the file is created in the current
|
||||
directory, and should be manually copied to
|
||||
<source>
|
||||
${eclipse workspace}/.metadata/.plugins/org.eclipse.ui.externaltools/externaltools.xml
|
||||
</source>
|
||||
</p>
|
||||
</description>
|
||||
</goal>
|
||||
|
||||
<a name="eclipse:add-maven-repo" />
|
||||
<goal>
|
||||
<name>eclipse:add-maven-repo</name>
|
||||
<description>
|
||||
Ensures that the classpath variable <code>MAVEN_REPO</code>
|
||||
exists in the Eclipse environment.
|
||||
<br />
|
||||
The <a href="properties.html">${maven.eclipse.workspace}</a>
|
||||
property <strong>must</strong> be set for this to succeed, and
|
||||
Eclipse must not be running.
|
||||
</description>
|
||||
</goal>
|
||||
</goals>
|
||||
</body>
|
||||
</document>
|
||||
28
eclipse/xdocs/index.xml
Normal file
28
eclipse/xdocs/index.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Maven Eclipse Plugin</title>
|
||||
<author email="vmassol@octo.com">Vincent Massol</author>
|
||||
<author email="dion@apache.org">dIon Gillard</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Maven Eclipse Plugin">
|
||||
<p>
|
||||
This plug-in provides the ability to generate Eclipse project files
|
||||
(<code>.classpath</code> and <code>.project</code> files), as well as
|
||||
configure Eclipse to use Maven as an <i>External Tool</i>.
|
||||
</p>
|
||||
<p>
|
||||
For more information on the functionality provided by this plugin,
|
||||
please see the <a href="goals.html">Goals</a> document.
|
||||
</p>
|
||||
<p>
|
||||
For more information on how to customise the functionality provided
|
||||
by this plugin, please see the <a href="properties.html">properties</a>
|
||||
document.
|
||||
</p>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
16
eclipse/xdocs/navigation.xml
Normal file
16
eclipse/xdocs/navigation.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project name="Maven Eclipse Plugin">
|
||||
|
||||
<title>Maven Eclipse Plugin</title>
|
||||
|
||||
<body>
|
||||
<links>
|
||||
<item name="Maven" href="http://jakarta.apache.org/turbine/maven/"/>
|
||||
<item name="Eclipse" href="http://www.eclipse.org/"/>
|
||||
</links>
|
||||
<menu name="Overview">
|
||||
<item name="Goals" href="/goals.html" />
|
||||
<item name="Properties" href="/properties.html" />
|
||||
</menu>
|
||||
</body>
|
||||
</project>
|
||||
42
eclipse/xdocs/properties.xml
Normal file
42
eclipse/xdocs/properties.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Eclipse Properties</title>
|
||||
<author email="vmassol@octo.com">Vincent Massol</author>
|
||||
<author email="dion@apache.org">dIon Gillard</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Eclipse Settings">
|
||||
<table>
|
||||
<tr><th>Property</th><th>Optional?</th><th>Description</th></tr>
|
||||
<tr>
|
||||
<td>maven.eclipse.workspace</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Location of the <a href="http://www.eclipse.org">Eclipse</a>
|
||||
workspace that holds your configuration and source.
|
||||
<p>
|
||||
On Windows, this will be the <code>workspace</code> directory
|
||||
under your eclipse installation. For example, if you installed
|
||||
eclipse into <code>c:\eclipse</code>, the workspace is
|
||||
<code>c:\eclipse\workspace</code>.
|
||||
</p>
|
||||
<p>
|
||||
If this parameter is specified, the <a href="goals.html#eclipse:external-tools">
|
||||
external-tools</a> goal will use it as the destination to copy the generated file.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
Note that you will need to defined a <code>MAVEN_REPO</code> Java
|
||||
Classpath variable in Eclipse. This is done by selecting the Window
|
||||
menu, then Preferences. In the dialog box, select the Java node and
|
||||
then Classpath Variables. Create a new variable named
|
||||
<code>MAVEN_REPO</code> that points to your local Maven repository.
|
||||
</p>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
Reference in New Issue
Block a user