You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by rw...@apache.org on 2009/05/07 08:51:51 UTC

svn commit: r772523 - in /portals/jetspeed-2/portal/trunk: applications/jetspeed-demo/ maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-pa/ maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifact...

Author: rwatler
Date: Thu May  7 06:51:45 2009
New Revision: 772523

URL: http://svn.apache.org/viewvc?rev=772523&view=rev
Log:
JS2-991: enable jetspeed-deploy-maven-plugin to support <profile/> configuration using the org.apache.jetspeed.catalina.version.major property and implementin build and archetype pom.xml files

Modified:
    portals/jetspeed-2/portal/trunk/applications/jetspeed-demo/jetspeed-mvn-demo-pom.xml
    portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-pa/jetspeed-mvn-pa-pom.xml
    portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/jetspeed-mvn-portal-pom.xml
    portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed-demo/jetspeed-mvn-demo-pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed-demo/jetspeed-mvn-demo-pom.xml?rev=772523&r1=772522&r2=772523&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed-demo/jetspeed-mvn-demo-pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed-demo/jetspeed-mvn-demo-pom.xml Thu May  7 06:51:45 2009
@@ -299,6 +299,7 @@
                 <configuration>
                   <targetBaseDir>${org.apache.jetspeed.server.home}</targetBaseDir>
                   <portalName>${org.apache.jetspeed.portal.context.name}</portalName>
+                  <profile>tomcat${org.apache.jetspeed.catalina.version.major}</profile>
                   <destinations>
                     <context>webapps/${org.apache.jetspeed.portal.context.name}/META-INF</context>
                   </destinations>
@@ -528,6 +529,7 @@
                 <configuration>
                   <targetBaseDir>${org.apache.jetspeed.server.home}</targetBaseDir>
                   <portalName>${org.apache.jetspeed.portal.context.name}</portalName>
+                  <profile>tomcat${org.apache.jetspeed.catalina.version.major}</profile>
                   <destinations>
                     <context>webapps/${org.apache.jetspeed.portal.context.name}/META-INF</context>
                   </destinations>
@@ -713,6 +715,7 @@
                 <configuration>
                   <targetBaseDir>${org.apache.jetspeed.server.home}</targetBaseDir>
                   <portalName>${org.apache.jetspeed.portal.context.name}</portalName>
+                  <profile>tomcat${org.apache.jetspeed.catalina.version.major}</profile>
                   <destinations>
                     <conf>webapps/${org.apache.jetspeed.portal.context.name}/WEB-INF/conf</conf>
                   </destinations>

Modified: portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-pa/jetspeed-mvn-pa-pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-pa/jetspeed-mvn-pa-pom.xml?rev=772523&r1=772522&r2=772523&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-pa/jetspeed-mvn-pa-pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-pa/jetspeed-mvn-pa-pom.xml Thu May  7 06:51:45 2009
@@ -62,6 +62,7 @@
                 <configuration>
                   <targetBaseDir>${dollar}{org.apache.jetspeed.server.home}</targetBaseDir>
                   <portalName>${dollar}{org.apache.jetspeed.portal.context.name}</portalName>
+                  <profile>tomcat${dollar}{org.apache.jetspeed.catalina.version.major}</profile>
                   <deployments>
                     <!-- portlet app -->
                     <deployment>

Modified: portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/jetspeed-mvn-portal-pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/jetspeed-mvn-portal-pom.xml?rev=772523&r1=772522&r2=772523&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/jetspeed-mvn-portal-pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/jetspeed-mvn-portal-pom.xml Thu May  7 06:51:45 2009
@@ -213,6 +213,7 @@
                 <configuration>
                   <targetBaseDir>${dollar}{org.apache.jetspeed.server.home}</targetBaseDir>
                   <portalName>${dollar}{org.apache.jetspeed.portal.context.name}</portalName>
+                  <profile>tomcat${dollar}{org.apache.jetspeed.catalina.version.major}</profile>
                   <destinations>
                     <conf>conf</conf>
                     <context>conf/Catalina/localhost</context>
@@ -517,6 +518,7 @@
                 <configuration>
                   <targetBaseDir>${dollar}{org.apache.jetspeed.server.home}</targetBaseDir>
                   <portalName>${dollar}{org.apache.jetspeed.portal.context.name}</portalName>
+                  <profile>tomcat${dollar}{org.apache.jetspeed.catalina.version.major}</profile>
                   <destinations>
                     <conf>webapps/${dollar}{org.apache.jetspeed.portal.context.name}/WEB-INF/conf</conf>
                   </destinations>

Modified: portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java?rev=772523&r1=772522&r2=772523&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java (original)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java Thu May  7 06:51:45 2009
@@ -54,9 +54,30 @@
 {
     private static final String DEPLOY_FACTORY_CLASS_NAME = "org.apache.jetspeed.tools.deploy.JetspeedDeployFactory";
 
-    private static final String PROFILE_TOMCAT5 = "tomcat5"; 
-    private static final String PROFILE_TOMCAT6 = "tomcat6"; 
-    private static final String DEFAULT_PROFILE = PROFILE_TOMCAT5; 
+    /**
+     * Support only Tomcat 5.5.27+ or Tomcat 6.0.18+. The profile attribute is
+     * typically set in the plugin configurations using the following tags:
+     *
+     * <profile>tomcat${org.apache.jetspeed.catalina.version.major}</profile>
+     * or
+     * <profile>tomcat${tomcat.version.major}</profile>
+     *
+     * The supported values for the org.apache.jetspeed.catalina.version.major
+     * property are '5', '5.5', and '6'. If unset, the profile value will be
+     * 'tomcat' or 'tomcatnull', which will imply the default tomcat support.
+     *
+     * The supported values for the tomcat.version.major are '5' and '6'.
+     *
+     * Tomcat 6, ('tomcat6'), support is the default; Tomcat 5, ('tomcat5'), and
+     * Tomcat 5.5, ('tomcat5.5'), both map to Tomcat 5.5 which is the minimum
+     * supported Tomcat 5.X version currently supported.
+     */
+    private static final String PROFILE_TOMCAT = "tomcat";
+    private static final String PROFILE_TOMCAT_NULL = "tomcatnull";
+    private static final String PROFILE_TOMCAT5 = "tomcat5";
+    private static final String PROFILE_TOMCAT55 = "tomcat5.5";
+    private static final String PROFILE_TOMCAT6 = "tomcat6";
+    private static final String DEFAULT_PROFILE = PROFILE_TOMCAT6; 
 
     public static class Deployment
     {
@@ -145,7 +166,7 @@
             destMap.putAll(destinations);
         }
 
-       	initDefaultDestinations(destMap, (profile != null) ? profile : DEFAULT_PROFILE);
+       	initDefaultDestinations(destMap, profile);
         
         File targetBaseDir = new File(this.targetBaseDir);
         if (targetBaseDir.exists() && targetBaseDir.isFile())
@@ -647,15 +668,25 @@
     /**
      * Initialize default destinations for a certain profile.
      */
-    private void initDefaultDestinations(Map destMap, String profile) throws MojoFailureException {
-
-    	if (!(profile.equals(PROFILE_TOMCAT5) || profile.equals(PROFILE_TOMCAT6))) {
-    		throw new MojoFailureException("Cannot handle profile '" + profile + "', use '" 
-    				+ PROFILE_TOMCAT5 + "' or '" + PROFILE_TOMCAT6 + "'");
+    private void initDefaultDestinations(Map destMap, String profile) throws MojoFailureException
+    {
+        // validate profile settings
+        if ((profile == null) || profile.equals(PROFILE_TOMCAT_NULL) || profile.equals(PROFILE_TOMCAT))
+        {
+            profile = DEFAULT_PROFILE;
+        }
+        else if (profile.equals(PROFILE_TOMCAT55))
+        {
+            profile = PROFILE_TOMCAT5;
+        }
+    	else if (!(profile.equals(PROFILE_TOMCAT5) || profile.equals(PROFILE_TOMCAT6)))
+        {
+    		throw new MojoFailureException("Cannot handle profile '" + profile + "', use '" + PROFILE_TOMCAT5 + "' or '" + PROFILE_TOMCAT6 + "'");
     	}
-    	
-    	if (profile.equals(PROFILE_TOMCAT5)) {
-    		
+
+    	// configure destinations
+    	if (profile.equals(PROFILE_TOMCAT5))
+        {
 	        if (!destMap.containsKey("system"))
 	        {
 	            destMap.put("system","common/endorsed");
@@ -677,8 +708,8 @@
 	            destMap.put("local", ((String)destMap.get("deploy"))+"/local");
 	        }
     	}
-    	else if (profile.equals(PROFILE_TOMCAT6)) {
-
+    	else if (profile.equals(PROFILE_TOMCAT6))
+        {
     		if (!destMap.containsKey("system"))
             {
                 destMap.put("system","lib");



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org