michal 2004/01/10 06:32:59
Modified: idea .cvsignore plugin.jelly project.xml
idea/xdocs goals.xml properties.xml
Added: idea/xdocs changes.xml
idea/src/plugin-resources/templates/v4 multiproject.jelly
Log:
Added "idea:multiproject" goal. (IDEA 4 only).
It creates the idea module files (.iml) via reactor and main project which aggregates
this modules. Each module has it's own classpath, src and test, traget dir setting
etc.
Revision Changes Path
1.2 +1 -0 maven-plugins/idea/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/maven-plugins/idea/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 24 Jan 2003 03:45:13 -0000 1.1
+++ .cvsignore 10 Jan 2004 14:32:59 -0000 1.2
@@ -1,3 +1,4 @@
target
velocity.log
maven.log
+*.iml
1.8 +109 -34 maven-plugins/idea/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/idea/plugin.jelly,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- plugin.jelly 19 Aug 2003 04:45:07 -0000 1.7
+++ plugin.jelly 10 Jan 2004 14:32:59 -0000 1.8
@@ -1,39 +1,114 @@
<?xml version="1.0"?>
-<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:util="jelly:util">
+<project xmlns:j="jelly:core"
+ xmlns:ant="jelly:ant"
+ xmlns:util="jelly:util"
+ xmlns:maven="jelly:maven">
+
+ <!--==================================================================-->
+ <!-- Generate IntelliJ IDEA project, workspace and model files -->
+ <!--==================================================================-->
+ <goal name="idea"
+ description="Generate IDEA project files"
+ prereqs="idea:idea"/>
+
+ <goal name="idea:init">
+ <j:set var="template.dir"
value="${plugin.resources}/templates/v${maven.idea.project.version}"/>
+ </goal>
+
+
+ <goal name="idea:project"
+ description="Generate IDEA .ipr project files"
+ prereqs="idea:init">
+ <ant:echo>Creating ${basedir}/${pom.artifactId}.ipr ...</ant:echo>
+
+ <j:file name="${basedir}/${pom.artifactId}.ipr" prettyPrint="true"
xmlns="dummy">
+ <j:import file="${template.dir}/project.jelly" inherit="true"/>
+ </j:file>
+
+ </goal>
+
+
+ <goal name="idea:workspace"
+ description="Generate IDEA .iws project files"
+ prereqs="idea:init">
+ <ant:echo>Creating ${basedir}/${pom.artifactId}.iws ...</ant:echo>
+
+ <j:file name="${basedir}/${pom.artifactId}.iws" prettyPrint="true"
xmlns="dummy">
+ <j:import file="${template.dir}/workspace.jelly" inherit="true"/>
+ </j:file>
+ </goal>
+
+ <!-- -->
+ <goal name="idea:idea"
+ description="Generate IDEA .ipr, .iml and .iws project files">
+ <attainGoal name="idea:project"/>
+ <attainGoal name="idea:workspace"/>
+ <attainGoal name="idea:module"/>
+ </goal>
+
+ <goal name="idea:module"
+ description="Generate IDEA .iml project files"
+ prereqs="idea:init">
+ <util:available file="${template.dir}/module.jelly">
+ <ant:echo>Creating ${basedir}/${pom.artifactId}.iml ...</ant:echo>
+ <j:file name="${basedir}/${pom.artifactId}.iml" prettyPrint="true"
xmlns="dummy">
+ <j:import file="${template.dir}/module.jelly" inherit="true"/>
+ </j:file>
+ </util:available>
+ </goal>
+
+
+ <!--
+
+
+ -->
+ <goal name="idea:multiproject" prereqs="idea:init">
+
+ <j:set var="ideaVersion" value="${maven.idea.project.version}"/>
+ <j:if test="${ideaVersion=='3'}">
+ <ant:echo>WARNING: This goal should be used only with IDEA
4.</ant:echo>
+ <ant:echo>Property 'maven.idea.project.version' is set to
'3'</ant:echo>
+ <!-- how to exist from goal? -->
+ </j:if>
+
+
+ <attainGoal name="idea:workspace"/>
+
+ <!-- Finding modules -->
+ <!-- we use plugin's own settings in first order. -->
+ <!-- if they are not provided we will try use use multiproject settings -->
+ <j:set var="multiprojectIncludes"
value="${maven.idea.project.multiproject.includes}"/>
+ <j:if test="${multiprojectIncludes == null or multiprojectIncludes.length()
eq 0}">
+ <maven:pluginVar var="multiprojectIncludes"
plugin="maven-multiproject-plugin" property="maven.multiproject.includes"/>
+ </j:if>
+
+ <j:set var="multiprojectExcludes"
value="${maven.idea.project.multiproject.excludes}"/>
+ <j:if test="${multiprojectExcludes == null or multiprojectExcludes.length()
eq 0}">
+ <maven:pluginVar var="multiprojectExcludes"
plugin="maven-multiproject-plugin" property="maven.multiproject.excludes"/>
+ </j:if>
+
+
+ <j:set var="multiprojectBasedir"
value="${maven.idea.project.multiproject.basedir}"/>
+ <j:if test="${multiprojectBasedir == null or multiprojectBasedir.length()
eq 0}">
+ <maven:pluginVar var="multiprojectBasedir"
plugin="maven-multiproject-plugin" property="maven.multiproject.basedir"/>
+ </j:if>
+
+
+ <maven:reactor
+ basedir="${multiprojectBasedir}"
+ banner="Generating idea module file for:"
+ includes="${multiprojectIncludes}"
+ excludes="${multiprojectExcludes}"
+ postProcessing="true"
+ goals="idea:module"
+ ignoreFailures="true"/>
+
+ <ant:echo>Creating ${basedir}/${pom.artifactId}.ipr ...</ant:echo>
+ <j:file name="${basedir}/${pom.artifactId}.ipr" prettyPrint="true"
xmlns="dummy">
+ <j:import file="${template.dir}/multiproject.jelly" inherit="true"/>
+ </j:file>
- <!--==================================================================-->
- <!-- Generate IntelliJ IDEA project, workspace and model files -->
- <!--==================================================================-->
- <goal name="idea"
- description="Generate IDEA project files"
- prereqs="idea:generate-project"/>
-
- <goal name="idea:generate-project"
- description="Generate IDEA .ipr, .iml and .iws project files">
-
- <j:set var="template.dir"
value="${plugin.resources}/templates/v${maven.idea.project.version}" />
-
- <ant:echo>Creating ${basedir}/${pom.artifactId}.ipr ...</ant:echo>
-
- <j:file name="${basedir}/${pom.artifactId}.ipr" prettyPrint="true"
xmlns="dummy">
- <j:import file="${template.dir}/project.jelly" inherit="true"/>
- </j:file>
-
- <ant:echo>Creating ${basedir}/${pom.artifactId}.iws ...</ant:echo>
-
- <j:file name="${basedir}/${pom.artifactId}.iws" prettyPrint="true"
xmlns="dummy">
- <j:import file="${template.dir}/workspace.jelly" inherit="true"/>
- </j:file>
-
- <util:available file="${template.dir}/module.jelly">
- <ant:echo>Creating ${basedir}/${pom.artifactId}.iml ...</ant:echo>
-
- <j:file name="${basedir}/${pom.artifactId}.iml" prettyPrint="true"
xmlns="dummy">
- <j:import file="${template.dir}/module.jelly" inherit="true"/>
- </j:file>
- </util:available>
-
- </goal>
+ </goal>
</project>
1.16 +10 -1 maven-plugins/idea/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-plugins/idea/project.xml,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- project.xml 22 Nov 2003 00:34:20 -0000 1.15
+++ project.xml 10 Jan 2004 14:32:59 -0000 1.16
@@ -5,7 +5,7 @@
<pomVersion>3</pomVersion>
<id>maven-idea-plugin</id>
<name>Maven IDEA Plug-in</name>
- <currentVersion>1.2</currentVersion>
+ <currentVersion>1.3-SNAPSHOT</currentVersion>
<shortDescription>IDEA Plugin for Maven</shortDescription>
<url>http://maven.apache.org/reference/plugins/idea/</url>
<siteDirectory>/www/maven.apache.org/reference/plugins/idea/</siteDirectory>
@@ -39,6 +39,15 @@
<organization>f2 network</organization>
<roles>
<role>Lead Developer</role>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Michal Maczka</name>
+ <id>michal</id>
+ <email>[EMAIL PROTECTED]</email>
+ <organization>Dimatics</organization>
+ <roles>
<role>Java Developer</role>
</roles>
</developer>
1.2 +24 -2 maven-plugins/idea/xdocs/goals.xml
Index: goals.xml
===================================================================
RCS file: /home/cvs/maven-plugins/idea/xdocs/goals.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- goals.xml 24 Jan 2003 03:45:15 -0000 1.1
+++ goals.xml 10 Jan 2004 14:32:59 -0000 1.2
@@ -15,9 +15,31 @@
</description>
</goal>
<goal>
- <name>idea:generate-project</name>
+ <name>idea:project</name>
<description>
- Generate IDEA .ipr and .iws project files from the POM
+ Generate IDEA .ipr project files
+ </description>
+ </goal>
+ <goal>
+ <name>idea:workspace</name>
+ <description>
+ Generate IDEA .ipw project files
+ </description>
+ </goal>
+ <goal>
+ <name>idea:workspace</name>
+ <description>
+ Generate IDEA .ipw project files
+ (IDEA 4 only)
+ </description>
+ </goal>
+
+
+ <goal>
+ <name>idea:multiproject</name>
+ <description>
+ Generate IDEA .ipr and .iws project files and appends module which are
created via reactor.
+ (IDEA 4 only).
</description>
</goal>
</goals>
1.3 +41 -3 maven-plugins/idea/xdocs/properties.xml
Index: properties.xml
===================================================================
RCS file: /home/cvs/maven-plugins/idea/xdocs/properties.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- properties.xml 7 Mar 2003 10:09:10 -0000 1.2
+++ properties.xml 10 Jan 2004 14:32:59 -0000 1.3
@@ -5,19 +5,57 @@
<title>IDEA Properties</title>
<author email="[EMAIL PROTECTED]">Kurt Schrader</author>
<author email="[EMAIL PROTECTED]">Emmanuel Venisse</author>
+ <author email="[EMAIL PROTECTED]">Michal Maczka</author>
</properties>
-
<body>
- <section name="IDEA Settings">
+ <section name="Maven IDEA lugin Settings">
<table>
<tr>
+ <th>Property name</th>
+ <th>Optional?</th>
+ <th>Description</th>
+ </tr>
+ <tr>
<td>maven.cvs.client.exe</td>
<td>Yes</td>
<td>
Specifies the cvs path.
</td>
</tr>
- </table>
+ <tr>
+ <td>maven.idea.project.multiproject.includes</td>
+ <td>Yet</td>
+ <td>
+ This is the list of file specifications to be
+ included when searching for projects to be processed
+ by the plugin.
+ <br/>
+ Default value is ${maven.multiproject.includes}
+ (see <a
href="http://maven.apache.org/reference/plugins/multiproject/properties.html">multiproject</a>)
+ It means that mutiproject setup is used when no value is provided.
+ </td>
+ </tr>
+
+ <tr>
+ <td>maven.idea.project.multiproject.excludes</td>
+ <td>Yet</td>
+ <td>
+ This is the list of file specifications to be excluded
+ when <b>idea:multiproject</b> goal is executed
+ <br/>
+ Default value is ${maven.multiproject.excludes}
+ </td>
+ </tr>
+ <tr>
+ <td>maven.idea.project.multiproject.basdir</td>
+ <td>No</td>
+ <td>
+ This is the base directory that the plugin will use for
<b>idea:multiproject</b> goal is executed
+ <br/>
+ Default value is ${maven.multiproject.basdir}
+ </td>
+ </tr>
+ </table>
</section>
</body>
</document>
1.1 maven-plugins/idea/xdocs/changes.xml
Index: changes.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<title>Changes</title>
<author email="[EMAIL PROTECTED]">Michal Maczka</author>
</properties>
<body>
<release version="1.3" date="in CVS">
<action dev="michal" type="add">
Added idea:multiproject goal. Other goals were decomposed.
</action>
</release>
</body>
</document>
1.1
maven-plugins/idea/src/plugin-resources/templates/v4/multiproject.jelly
Index: multiproject.jelly
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<j:whitespace xmlns:j="jelly:core" xmlns="dummy" trim="true">
<project version="4" relativePaths="false">
<component name="ProjectRootManager" version="2" assert-keyword="false"/>
<component name="CodeStyleManager">
<option name="USE_DEFAULT_CODE_STYLE_SCHEME" value="true"/>
<option name="CODE_STYLE_SCHEME" value=""/>
</component>
<component name="ProjectModuleManager">
<modules>
<module filepath="$$PROJECT_DIR$$/${pom.artifactId}.iml"/>
</modules>
</component>
<component name="libraryTable"/>
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac"/>
<option name="CLEAR_OUTPUT_DIRECTORY" value="false"/>
<!-- TODO: exclusions?
<excludeFromCompile>
<file url="file://$$PROJECT_DIR$$/src/webapp/WEB-INF/jsp/index.jspf"/>
</excludeFromCompile>
-->
<resourceExtensions>
<entry name=".+\.(properties|xml|html)"/>
<entry name=".+\.(gif|png|jpeg)"/>
</resourceExtensions>
</component>
<component name="JavacSettings">
<option name="DEBUGGING_INFO" value="true"/>
<option name="GENERATE_NO_WARNINGS" value="false"/>
<option name="DEPRECATION" value="true"/>
<option name="ADDITIONAL_OPTIONS_STRING" value=""/>
<option name="MAXIMUM_HEAP_SIZE" value="128"/>
<option name="USE_GENERICS_COMPILER" value="false"/>
</component>
<component name="JikesSettings">
<option name="DEBUGGING_INFO" value="true"/>
<option name="DEPRECATION" value="true"/>
<option name="GENERATE_NO_WARNINGS" value="false"/>
<option name="GENERATE_MAKE_FILE_DEPENDENCIES" value="false"/>
<option name="DO_FULL_DEPENDENCE_CHECK" value="false"/>
<option name="IS_INCREMENTAL_MODE" value="false"/>
<option name="IS_EMACS_ERRORS_MODE" value="true"/>
<option name="ADDITIONAL_OPTIONS_STRING" value=""/>
<option name="MAXIMUM_HEAP_SIZE" value="128"/>
</component>
<component name="AntConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false"/>
<option name="FILTER_TARGETS" value="false"/>
</component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY"/>
<option name="OPTION_SCOPE" value="protected"/>
<option name="OPTION_HIERARCHY" value="false"/>
<option name="OPTION_NAVIGATOR" value="false"/>
<option name="OPTION_INDEX" value="false"/>
<option name="OPTION_SEPARATE_INDEX" value="false"/>
<option name="OPTION_USE_1_1" value="false"/>
<option name="OPTION_DOCUMENT_TAG_USE" value="false"/>
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false"/>
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false"/>
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="false"/>
<option name="OPTION_DEPRECATED_LIST" value="false"/>
<option name="OTHER_OPTIONS"/>
<option name="HEAP_SIZE"/>
<option name="OPEN_IN_BROWSER" value="false"/>
</component>
<j:set var="webSourceDir" value="${maven.war.src}"/>
<j:choose>
<j:when test="${empty(webSourceDir)}">
<component name="WebManager">
<OPTION enabled="false"/>
</component>
<component name="WebRootContainer"/>
</j:when>
<j:otherwise>
<component name="WebManager">
<OPTION enabled="true"/>
</component>
<component name="WebRootContainer">
<root url="file://$$PROJECT_DIR$$/${webSourceDir}"
name="${pom.artifactId}" validate="false"/>
</component>
</j:otherwise>
</j:choose>
<component name="EjbManager" enabled="false"/>
<component name="JUnitProjectSettings">
<option name="TEST_RUNNER" value="UI"/>
</component>
<component name="EntryPointsManager">
<entry_points/>
</component>
<component name="DataSourceManager"/>
<component name="EjbActionsConfiguration">
<option name="NEW_MESSAGE_BEAN_LAST_PACKAGE" value=""/>
<option name="NEW_ENTITY_BEAN_LAST_PACKAGE" value=""/>
<option name="NEW_SESSION_BEAN_LAST_PACKAGE" value=""/>
</component>
<component name="ExportToHTMLSettings">
<option name="PRINT_LINE_NUMBERS" value="false"/>
<option name="OPEN_IN_BROWSER" value="false"/>
<option name="OUTPUT_DIRECTORY"/>
</component>
<component name="ImportConfiguration">
<option name="VENDOR"/>
<option name="RELEASE_TAG"/>
<option name="LOG_MESSAGE"/>
<option name="CHECKOUT_AFTER_IMPORT" value="true"/>
</component>
<component name="ProjectModuleManager">
<modules>
<j:forEach var="project" items="${reactorProjects}">
<j:set var="file"
value="file://${project.file.parentFile.canonicalFile}/${project.artifactId}.iml" />
<module fileurl="${file}" filepath="${file}"/>
</j:forEach>
</modules>
</component>
</project>
</j:whitespace>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]