Author: ate
Date: Sun Feb 25 19:28:53 2007
New Revision: 511712

URL: http://svn.apache.org/viewvc?view=rev&rev=511712
Log:
Maven-1 plugin solution to auto-infuse portlet applications on deployment.
This can allow us to remove the pre-infusion from the bridges wars which 
currently are can only run in Jetspeed-2.
The current situation isn't changed by this commit yet though, because the 
maven-2 build still depends on those wars to be pre-infused.

Modified:
    portals/jetspeed-2/trunk/maven-plugin/plugin.jelly
    portals/jetspeed-2/trunk/maven-plugin/project.xml

Modified: portals/jetspeed-2/trunk/maven-plugin/plugin.jelly
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/maven-plugin/plugin.jelly?view=diff&rev=511712&r1=511711&r2=511712
==============================================================================
--- portals/jetspeed-2/trunk/maven-plugin/plugin.jelly (original)
+++ portals/jetspeed-2/trunk/maven-plugin/plugin.jelly Sun Feb 25 19:28:53 2007
@@ -383,6 +383,15 @@
       <j:set var="j2.war.groupId" value="${plugin.groupId}"/>
       <j:set var="j2.war.version" value="${jetspeed.version}"/>
       <j:set var="isLocalWarDeploy" value="false"/>            
+      <j:set var="isInfusedWarDeploy" value="false"/>
+      <attainGoal name="j2:warDeploy"/>
+  </goal>
+
+  <goal name="j2:infusedDeploy">
+      <j:set var="j2.war.groupId" value="${plugin.groupId}"/>
+      <j:set var="j2.war.version" value="${jetspeed.version}"/>
+      <j:set var="isLocalWarDeploy" value="false"/>
+      <j:set var="isInfusedWarDeploy" value="true"/>
       <attainGoal name="j2:warDeploy"/>
   </goal>
 
@@ -396,6 +405,8 @@
   <goal name="j2:deploybridgewar">
       <j:set var="j2.war.groupId" value="${bridges.groupId}"/>
       <j:set var="j2.war.version" value="${portals.bridges.version}"/>
+      <j:set var="isLocalWarDeploy" value="false"/>
+      <j:set var="isInfusedWarDeploy" value="true"/>
       <attainGoal name="j2:warDeploy"/>
   </goal>
   
@@ -418,14 +429,38 @@
     <j:if test="${online}">
       <attainGoal name="j2:_check.dep"/>
     </j:if>
-    <j:set var="warDeployDest" 
value="${org.apache.jetspeed.deploy.war.dir}/${maven.war.final.name}.war"/>
+    <j:set var="warDeployDest" 
value="${org.apache.jetspeed.portal.dir}/WEB-INF/deploy/${maven.war.final.name}.war"/>
     <j:if test='${isLocalWarDeploy == "true"}'>
-      <j:set var="warDeployDest" 
value="${org.apache.jetspeed.portal.dir}/WEB-INF/deploy/${maven.war.final.name}.war"/>
-    </j:if>    
-    <copy file="${maven.repo.local}/${depGroup}/${depType}/${depName}"
-          tofile="${warDeployDest}" 
-          overwrite="true"
-          failonerror="true"/>
+      <j:set var="warDeployDest" 
value="${org.apache.jetspeed.portal.dir}/WEB-INF/deploy/local/${maven.war.final.name}.war"/>
+      <j:set var="isInfusedWarDeploy" value="false"/>
+    </j:if>
+    <j:choose>
+      <j:when test='${isInfusedWarDeploy == "true"}'>
+        <j:set var="warDeployDest" 
value="${org.apache.jetspeed.deploy.war.dir}/${maven.war.final.name}.war"/>
+        <j:set 
var="tmpFileInfused">${systemScope['java.io.tmpdir']}/${maven.war.final.name}-infused.war</j:set>
+        
+        <java classname="org.apache.jetspeed.tools.deploy.JetspeedDeploy" 
fork="true">
+          <arg value='${maven.repo.local}/${depGroup}/${depType}/${depName}'/>
+          <arg value='${tmpFileInfused}'/>                         
+          <classpath>
+            <pathelement 
location="${plugin.getDependencyPath('org.apache.portals.jetspeed-2:jetspeed-api')}"/>
+            <pathelement 
location="${plugin.getDependencyPath('org.apache.portals.jetspeed-2:jetspeed-deploy-tools')}"/>
+            <pathelement location="${plugin.getDependencyPath('jdom')}"/>
+            <pathelement location="${plugin.getDependencyPath('jaxen')}"/>
+            <pathelement location="${plugin.getDependencyPath('saxpath')}"/>
+            <pathelement 
location="${plugin.getDependencyPath('commons-lang')}"/>
+          </classpath>
+        </java>
+        <copy file="${tmpFileInfused}" tofile="${warDeployDest}" 
overwrite="true" failonerror="true"/>        
+        <delete file="${tmpFileInfused}"/>        
+      </j:when>
+      <j:otherwise>
+        <copy file="${maven.repo.local}/${depGroup}/${depType}/${depName}"
+              tofile="${warDeployDest}" 
+              overwrite="true"
+              failonerror="true"/>
+      </j:otherwise>
+    </j:choose>
   </goal>
 
 
@@ -436,7 +471,7 @@
 
   <goal name="j2:pam.demodeploy">
     <j:set var="maven.war.final.name" value="demo"/>
-    <attainGoal name="j2:deploy"/>
+    <attainGoal name="j2:infusedDeploy"/>
   </goal>
 
   <goal name="j2:pam.tsdeploy">
@@ -456,12 +491,12 @@
 
   <goal name="j2:pam.admindeploy">
     <j:set var="maven.war.final.name" value="j2-admin"/>
-    <attainGoal name="j2:deploy"/>
+    <attainGoal name="j2:infusedDeploy"/>
   </goal>
 
   <goal name="j2:pam.rssdeploy">
     <j:set var="maven.war.final.name" value="rss"/>
-    <attainGoal name="j2:deploy"/>
+    <attainGoal name="j2:infusedDeploy"/>
   </goal>
 
   <!-- ================================================= -->

Modified: portals/jetspeed-2/trunk/maven-plugin/project.xml
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/maven-plugin/project.xml?view=diff&rev=511712&r1=511711&r2=511712
==============================================================================
--- portals/jetspeed-2/trunk/maven-plugin/project.xml (original)
+++ portals/jetspeed-2/trunk/maven-plugin/project.xml Sun Feb 25 19:28:53 2007
@@ -65,7 +65,45 @@
                 <war.bundle>false</war.bundle>
             </properties>
         </dependency>
-
+        
+        <!-- dependencies for using the Jetspeed-2 offline portlet application 
infusion DeployTools -->
+        <dependency>
+            <groupId>org.apache.portals.jetspeed-2</groupId>
+            <artifactId>jetspeed-api</artifactId>
+            <version>2.1-dev</version>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.portals.jetspeed-2</groupId>
+            <artifactId>jetspeed-deploy-tools</artifactId>
+            <version>2.1-dev</version>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <id>jdom</id>
+            <version>1.0</version>
+        </dependency>
+        <dependency>
+            <id>jaxen</id>
+            <version>1.0-FCS-full</version>
+            <properties>
+                <war.bundle>false</war.bundle>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>saxpath</groupId>         
+            <artifactId>saxpath</artifactId>
+            <version>1.0-FCS</version>
+            <properties>
+                <war.bundle>false</war.bundle>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.0</version>
+        </dependency>
+        
     </dependencies>
     <build>
         <sourceDirectory>src/java</sourceDirectory>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to