ate 2004/06/18 04:07:29
Modified: . maven.xml
maven-plugin maven.xml
Log:
Install maven-plugin if needed
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.79 +1 -1 jakarta-jetspeed-2/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/maven.xml,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- maven.xml 12 Jun 2004 16:54:28 -0000 1.78
+++ maven.xml 18 Jun 2004 11:07:29 -0000 1.79
@@ -239,7 +239,7 @@
<maven:reactor
basedir="${basedir}/maven-plugin"
includes="project.xml"
- goals="plugin:deploy"
+ goals="deploy-plugin"
banner="Build and deploy the Jetspeed 2 Maven plugin"
postProcessing="false"
ignoreFailures="false"/>
1.5 +33 -0 jakarta-jetspeed-2/maven-plugin/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/maven-plugin/maven.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- maven.xml 11 Jun 2004 17:39:19 -0000 1.4
+++ maven.xml 18 Jun 2004 11:07:29 -0000 1.5
@@ -30,6 +30,39 @@
<copy file="../portal/project.xml"
tofile="${basedir}/target/classes/plugin-resources/portal_project.xml"
overwrite="true" failonerror="true"/>
</preGoal>
+ <goal name="deploy-plugin">
+ <!-- determine if the plugin is already installed and is of the correct
version -->
+ <j:set var="pluginManager"
value="${pom.context.getMavenSession().getPluginManager()}"/>
+ <j:set var="plugins" value="${pluginManager.pluginList}"/>
+ <j:set var="currentVersion" value="${maven.final.name}"/>
+ <j:set var="installed" value="false"/>
+ <j:set var="update" value="false"/>
+ <j:forEach var="plugin" items="${plugins}">
+ <j:if test="${plugin.equals(currentVersion)}">
+ <j:set var="installed" value="true"/>
+ <j:break/>
+ </j:if>
+ <j:if test="${plugin.startsWith(pom.artifactId)}">
+ <j:set var="update" value="true"/>
+ <j:break/>
+ </j:if>
+ </j:forEach>
+ <j:choose>
+ <j:when test="${installed}">
+ <!-- only deploy needed -->
+ <attainGoal name="plugin:deploy"/>
+ </j:when>
+ <j:when test="${update}">
+ <!-- installed but not the correct version -->
+ <attainGoal name="plugin:uninstall"/>
+ <attainGoal name="plugin:install"/>
+ </j:when>
+ <j:otherwise>
+ <!-- not installed yet -->
+ <attainGoal name="plugin:install"/>
+ </j:otherwise>
+ </j:choose>
+ </goal>
<goal name="copyDb">
<copy todir="target/classes/plugin-resources" overwrite="true"
failonerror="true">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]