tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1325700 - in /tomcat/maven-plugin/trunk: tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
Date Fri, 13 Apr 2012 10:04:14 GMT
Author: olamy
Date: Fri Apr 13 10:04:13 2012
New Revision: 1325700

URL: http://svn.apache.org/viewvc?rev=1325700&view=rev
Log:
[MTOMCAT-140] Allow specifying the classloader to use for loading webapps.
Submitted by Leigh Anderson.

Modified:
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java
    tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java?rev=1325700&r1=1325699&r2=1325700&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java
Fri Apr 13 10:04:13 2012
@@ -360,6 +360,14 @@ public abstract class AbstractRunMojo
      */
     private String staticContextDocbase;
 
+    /**
+     * Class loader class to set.
+     *
+     * @parameter
+     * @since 2.0
+     */
+    protected String classLoaderClass;
+
     // ----------------------------------------------------------------------
     // Mojo Implementation
     // ----------------------------------------------------------------------
@@ -450,7 +458,14 @@ public abstract class AbstractRunMojo
             context.setParentClassLoader( getTomcatClassLoader() );
         }
 
-        context.setLoader( createWebappLoader() );
+        final WebappLoader webappLoader = createWebappLoader();
+
+        if ( classLoaderClass != null )
+        {
+            webappLoader.setLoaderClass( classLoaderClass );
+        }
+
+        context.setLoader( webappLoader );
         File contextFile = getContextFile();
         if ( contextFile != null )
         {

Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java?rev=1325700&r1=1325699&r2=1325700&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
Fri Apr 13 10:04:13 2012
@@ -354,6 +354,14 @@ public abstract class AbstractRunMojo
      */
     private String staticContextDocbase;
 
+    /**
+     * Class loader class to set.
+     *
+     * @parameter
+     * @since 2.0
+     */
+    protected String classLoaderClass;
+
     // ----------------------------------------------------------------------
     // Fields
     // ----------------------------------------------------------------------
@@ -363,7 +371,6 @@ public abstract class AbstractRunMojo
      */
     private ClassRealm tomcatRealm;
 
-
     // ----------------------------------------------------------------------
     // Mojo Implementation
     // ----------------------------------------------------------------------
@@ -462,13 +469,21 @@ public abstract class AbstractRunMojo
             context.setParentClassLoader( getTomcatClassLoader() );
         }
 
-        context.setLoader( createWebappLoader() );
+        final WebappLoader loader = createWebappLoader();
+
+        context.setLoader( loader );
+
         File contextFile = getContextFile();
         if ( contextFile != null )
         {
             context.setConfigFile( getContextFile().toURI().toURL() );
         }
 
+        if ( classLoaderClass != null )
+        {
+            loader.setLoaderClass( classLoaderClass );
+        }
+
         return context;
 
     }



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


Mime
View raw message