I am not sure if this is something we want to promote as this couples many
existing plugins in rather nasty way
and uses properties of mutiproject plugin for plugin which have nothing to
do with multiproject.
also there are some hardcoded values in this code like:
> + <root url="file://$MODULE_DIR$/src/webapp" ( I always use
$MODULE_DIR$/src/main/webapp_
or
>value="jar://${maven.repo.local}/j2ee/jars/j2ee-1.3.jar!/" />
> value="jar://${maven.repo.local}/servletapi/jars/servletapi-2.3.jar!/"/>
(those two can be most likley taken from pom)
But honestly I don't have any better idea how to do this with maven1
(excluding the removal of hardcoded values)
This is quite nice use case for m2 :)
Michal
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 07, 2004 2:10 PM
> To: [EMAIL PROTECTED]
> Subject: cvs commit: maven-plugins/idea project.xml plugin.jelly
>
>
> brett 2004/06/07 05:09:40
>
> Modified: idea/src/plugin-resources/templates/v4 module.jelly
> idea/xdocs changes.xml
> idea project.xml plugin.jelly
> Log:
> PR: MPIDEA-5
> Submitted By: Severin Voisin (with modifications)
> match module type to artifact type
>
> Revision Changes Path
> 1.6 +151 -64
> maven-plugins/idea/src/plugin-resources/templates/v4/module.jelly
>
> Index: module.jelly
> ===================================================================
> RCS file:
> /home/cvs/maven-plugins/idea/src/plugin-resources/templates/v4
> /module.jelly,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -r1.5 -r1.6
> --- module.jelly 4 Mar 2004 18:15:14 -0000 1.5
> +++ module.jelly 7 Jun 2004 12:09:40 -0000 1.6
> @@ -1,64 +1,151 @@
> -<?xml version="1.0" encoding="ISO-8859-1"?>
> -<!--
> -/*
> - * Copyright 2001-2004 The Apache Software Foundation.
> - *
> - * Licensed under the Apache License, Version 2.0 (the "License");
> - * you may not use this file except in compliance with the License.
> - * You may obtain a copy of the License at
> - *
> - * http://www.apache.org/licenses/LICENSE-2.0
> - *
> - * Unless required by applicable law or agreed to in
> writing, software
> - * distributed under the License is distributed on an "AS
> IS" BASIS,
> - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
> express or implied.
> - * See the License for the specific language governing
> permissions and
> - * limitations under the License.
> - */
> - -->
> -
> -<j:whitespace xmlns:j="jelly:core"
> xmlns:maven="jelly:maven" xmlns="dummy" trim="true">
> -
> - <module version="4" relativePaths="false">
> - <component name="LvcsConfiguration">
> - <option name="LOCAL_VCS_ENABLED" value="true"/>
> - <option name="LOCAL_VCS_PURGING_PERIOD"
> value="259200000"/>
> - <option
> name="MARK_EXTERNAL_CHANGES_AS_UP_TO_DATE" value="true"/>
> - </component>
> - <component name="NewModuleRootManager">
> - <maven:makeRelativePath var="value"
> basedir="${basedir}" path="${maven.build.dest}" separator="/" />
> - <output url="file://$$MODULE_DIR$$/${value}"/>
> - <!-- @todo - use maven.test.dest instead -->
> - <maven:makeRelativePath var="value"
> basedir="${basedir}" path="${maven.build.dir}" separator="/" />
> - <output-test
> url="file://$$MODULE_DIR$$/${value}/test-classes"/>
> - <content url="file://$MODULE_DIR$">
> - <j:if test="${sourcesPresent}">
> - <maven:makeRelativePath var="value"
> basedir="${basedir}" path="${pom.build.sourceDirectory}"
> separator="/" />
> - <sourceFolder
> url="file://$$MODULE_DIR$$/${value}" isTestSource="false"/>
> - </j:if>
> - <j:if test="${unitTestSourcesPresent}">
> - <maven:makeRelativePath var="value"
> basedir="${basedir}"
> path="${pom.build.unitTestSourceDirectory}" separator="/" />
> - <sourceFolder
> url="file://$$MODULE_DIR$$/${value}" isTestSource="true"/>
> - </j:if>
> - </content>
> - <orderEntry type="jdk" jdkName="java version
> "${java.version}""/>
> - <orderEntry type="sourceFolder" forTests="false"/>
> - <j:forEach var="lib" items="${pom.artifacts}">
> - <j:set var="dep" value="${lib.dependency}"/>
> - <j:if test="${dep.type=='jar'}">
> - <orderEntry type="module-library">
> - <library name="${dep.artifactId}">
> - <CLASSES>
> - <root url="jar://${lib.path}!/"/>
> - </CLASSES>
> - <JAVADOC/>
> - <SOURCES/>
> - </library>
> - </orderEntry>
> - </j:if>
> - </j:forEach>
> - </component>
> - <component name="ModuleRootManager"/>
> - </module>
> -
> -</j:whitespace>
> +<?xml version="1.0" encoding="ISO-8859-1"?>
> +<!--
> +/*
> + * Copyright 2001-2004 The Apache Software Foundation.
> + *
> + * Licensed under the Apache License, Version 2.0 (the "License");
> + * you may not use this file except in compliance with the License.
> + * You may obtain a copy of the License at
> + *
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in
> writing, software
> + * distributed under the License is distributed on an "AS
> IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
> express or implied.
> + * See the License for the specific language governing
> permissions and
> + * limitations under the License.
> + */
> + -->
> +
> +<j:whitespace xmlns:j="jelly:core"
> xmlns:maven="jelly:maven" xmlns="dummy" trim="true">
> +
> + <maven:get var="type" plugin="maven-multiproject-plugin"
> property="maven.multiproject.type" />
> +
> + <j:set var="IDEA_TYPE" value=""/>
> + <j:if test="${type == 'ejb'}">
> + <j:set var="IDEA_TYPE" value="J2EE_EJB_MODULE"/>
> + </j:if>
> + <j:if test="${type == 'war'}">
> + <j:set var="IDEA_TYPE" value="J2EE_WEB_MODULE"/>
> + </j:if>
> +
> + <module version="4" relativePaths="false"
> type="${IDEA_TYPE}">
> + <j:if test="${type == 'ejb'}">
> + <component name="EjbModuleBuildComponent">
> + <setting name="EXPLODED_URL" value="file://" />
> + <setting name="EXPLODED_ENABLED" value="false" />
> + <setting name="JAR_URL"
> value="file://$$MODULE_DIR$$/target/${maven.final.name}.jar" />
> + <setting name="JAR_ENABLED" value="true" />
> + </component>
> + <component name="EjbModuleProperties">
> + <deploymentDescriptor name="ejb-jar.xml"
> url="file://$MODULE_DIR$/src/ejb/META-INF/ejb-jar.xml"
> version="2.x" />
> + <orderEntriesWatcher>
> + <pairs>
> + <key>
> + <option name="value" value="0" />
> + </key>
> + <value predicate="moduleLibrary">
> + <j:set var="url"
> value="jar://${maven.repo.local}/j2ee/jars/j2ee-1.3.jar!/" />
> + <url>${url}</url>
> + </value>
> + </pairs>
> + </orderEntriesWatcher>
> + <order-entry-info>
> + <info>
> + <key>
> + <option name="value" value="0" />
> + </key>
> + <value>
> + <setting name="copy" value="false" />
> + <setting name="URI" value="" />
> + </value>
> + </info>
> + </order-entry-info>
> + </component>
> + </j:if>
> + <j:if test="${type == 'war'}">
> + <maven:get var="webXml" plugin="maven-war-plugin"
> property="maven.war.webxml" />
> + <maven:get var="warDir" plugin="maven-war-plugin"
> property="maven.war.webapp.dir" />
> + <component name="WebModuleBuildComponent">
> + <maven:makeRelativePath var="value"
> basedir="${basedir}" path="${warDir}" separator="/" />
> + <setting name="EXPLODED_URL"
> value="file://$$MODULE_DIR$$/${value}" />
> + <setting name="EXPLODED_ENABLED" value="true" />
> + <setting name="JAR_URL" value="file://" />
> + <setting name="JAR_ENABLED" value="false" />
> + <setting name="RUN_JASPER_VALIDATION" value="false" />
> + </component>
> + <component name="WebModuleProperties">
> + <maven:makeRelativePath var="value"
> basedir="${basedir}" path="${webXml}" separator="/" />
> + <deploymentDescriptor name="web.xml"
> url="file://$$MODULE_DIR$$/${value}" version="2.3" />
> + <webroots>
> + <root url="file://$MODULE_DIR$/src/webapp"
> relative="/" />
> + </webroots>
> + <orderEntriesWatcher>
> + <pairs>
> + <key>
> + <option name="value" value="0" />
> + </key>
> + <value predicate="moduleLibrary">
> + <j:set var="url"
> value="jar://${maven.repo.local}/servletapi/jars/servletapi-2.
> 3.jar!/" />
> + <url>${url}</url>
> + </value>
> + </pairs>
> + </orderEntriesWatcher>
> + <order-entry-info>
> + <info>
> + <key>
> + <option name="value" value="0" />
> + </key>
> + <value>
> + <setting name="copy" value="false" />
> + <setting name="URI" value="" />
> + </value>
> + </info>
> + </order-entry-info>
> + </component>
> + </j:if>
> + <component name="NewModuleRootManager">
> + <maven:makeRelativePath var="value"
> basedir="${basedir}" path="${maven.build.dest}" separator="/" />
> + <output url="file://$$MODULE_DIR$$/${value}"/>
> + <!-- @todo - use maven.test.dest instead -->
> + <maven:makeRelativePath var="value"
> basedir="${basedir}" path="${maven.build.dir}" separator="/" />
> + <output-test
> url="file://$$MODULE_DIR$$/${value}/test-classes"/>
> + <content url="file://$MODULE_DIR$">
> + <j:if test="${sourcesPresent}">
> + <maven:makeRelativePath var="value"
> basedir="${basedir}" path="${pom.build.sourceDirectory}"
> separator="/" />
> + <sourceFolder
> url="file://$$MODULE_DIR$$/${value}" isTestSource="false"/>
> + </j:if>
> + <j:if test="${unitTestSourcesPresent}">
> + <maven:makeRelativePath var="value"
> basedir="${basedir}"
> path="${pom.build.unitTestSourceDirectory}" separator="/" />
> + <sourceFolder
> url="file://$$MODULE_DIR$$/${value}" isTestSource="true"/>
> + </j:if>
> + </content>
> + <orderEntry type="jdk" jdkName="java version
> "${java.version}""/>
> + <orderEntry type="sourceFolder" forTests="false"/>
> + <j:forEach var="lib" items="${pom.artifacts}">
> + <j:set var="dep" value="${lib.dependency}"/>
> + <j:if test="${dep.type=='jar'}">
> + <j:choose>
> + <j:when test="${dep.groupId == pom.groupId}" >
> + <orderEntry type="module"
> module-name="${dep.artifactId}" />
> + </j:when>
> + <j:otherwise>
> + <orderEntry type="module-library">
> + <library name="${dep.artifactId}">
> + <CLASSES>
> + <root url="jar://${lib.path}!/"/>
> + </CLASSES>
> + <JAVADOC/>
> + <SOURCES/>
> + </library>
> + </orderEntry>
> + </j:otherwise>
> + </j:choose>
> + </j:if>
> + </j:forEach>
> + </component>
> + <component name="ModuleRootManager"/>
> + </module>
> +
> +</j:whitespace>
> +
>
>
>
> 1.6 +3 -0 maven-plugins/idea/xdocs/changes.xml
>
> Index: changes.xml
> ===================================================================
> RCS file: /home/cvs/maven-plugins/idea/xdocs/changes.xml,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -r1.5 -r1.6
> --- changes.xml 16 May 2004 02:33:26 -0000 1.5
> +++ changes.xml 7 Jun 2004 12:09:40 -0000 1.6
> @@ -24,6 +24,9 @@
> <author email="[EMAIL PROTECTED]">Michal
> Maczka</author>
> </properties>
> <body>
> + <release version="1.5-SNAPSHOT" date="in CVS">
> + <action dev="brett" type="add"
> issue="MPIDEA-5">match module type to artifact type</action>
> + </release>
> <release version="1.4" date="2004-05-15">
> <action dev="brett" type="update">Default to project
> version 4.</action>
> <action dev="brett" type="fix" issue="MPIDEA-4">Use
> a multiproject dependency handle so that you can use
> multiproject properties in idea:multiproject.</action>
>
>
>
> 1.27 +2 -2 maven-plugins/idea/project.xml
>
> Index: project.xml
> ===================================================================
> RCS file: /home/cvs/maven-plugins/idea/project.xml,v
> retrieving revision 1.26
> retrieving revision 1.27
> diff -u -r1.26 -r1.27
> --- project.xml 16 May 2004 02:33:26 -0000 1.26
> +++ project.xml 7 Jun 2004 12:09:40 -0000 1.27
> @@ -23,9 +23,9 @@
> <pomVersion>3</pomVersion>
> <id>maven-idea-plugin</id>
> <name>Maven IDEA Plug-in</name>
> - <currentVersion>1.4</currentVersion>
> + <currentVersion>1.5-SNAPSHOT</currentVersion>
> <shortDescription>IDEA Plugin for Maven</shortDescription>
> - <description>IDEA Plugin for Maven. Requires Maven 1.0
> RC2.</description>
> + <description>IDEA Plugin for Maven. Requires Maven 1.0
> RC3.</description>
> <url>http://maven.apache.org/reference/plugins/idea/</url>
>
> <issueTrackingUrl>http://jira.codehaus.org/BrowseProject.jspa?
> id=10350</issueTrackingUrl>
>
> <siteDirectory>/www/maven.apache.org/reference/plugins/idea/</
> siteDirectory>
>
>
>
> 1.11 +3 -2 maven-plugins/idea/plugin.jelly
>
> Index: plugin.jelly
> ===================================================================
> RCS file: /home/cvs/maven-plugins/idea/plugin.jelly,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- plugin.jelly 1 May 2004 01:11:37 -0000 1.10
> +++ plugin.jelly 7 Jun 2004 12:09:40 -0000 1.11
> @@ -60,7 +60,6 @@
> </j:file>
> </goal>
>
> - <!-- -->
> <goal name="idea:idea"
> description="Generate IDEA .ipr, .iml and .iws
> project files">
> <attainGoal name="idea:project"/>
> @@ -68,9 +67,11 @@
> <attainGoal name="idea:module"/>
> </goal>
>
> + <!-- Depends on war:load to make sure war plugin is
> loaded (needed by module.jelly) - should use
> + a dependency handle -->
> <goal name="idea:module"
> description="Generate IDEA .iml project files"
> - prereqs="idea:init">
> + prereqs="idea:init,war:load">
> <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">
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]