tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1310114 - /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
Date Thu, 05 Apr 2012 22:35:47 GMT
Author: olamy
Date: Thu Apr  5 22:35:47 2012
New Revision: 1310114

URL: http://svn.apache.org/viewvc?rev=1310114&view=rev
Log:
extract overriding of Tomcat to an external class rather than inline override for readibility

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

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=1310114&r1=1310113&r2=1310114&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
Thu Apr  5 22:35:47 2012
@@ -19,15 +19,12 @@ package org.apache.tomcat.maven.plugin.t
  */
 
 import org.apache.catalina.Context;
-import org.apache.catalina.Host;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.connector.Connector;
-import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.loader.WebappLoader;
 import org.apache.catalina.realm.MemoryRealm;
 import org.apache.catalina.startup.Catalina;
 import org.apache.catalina.startup.CatalinaProperties;
-import org.apache.catalina.startup.ContextConfig;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.valves.AccessLogValve;
 import org.apache.maven.artifact.Artifact;
@@ -738,33 +735,7 @@ public abstract class AbstractRunMojo
                 // Trigger loading of catalina.properties
                 CatalinaProperties.getProperty( "foo" );
 
-                Tomcat embeddedTomcat = new Tomcat()
-                {
-                    public Context addWebapp( Host host, String url, String name, String
path )
-                    {
-
-                        Context ctx = new StandardContext();
-                        ctx.setName( name );
-                        ctx.setPath( url );
-                        ctx.setDocBase( path );
-
-                        ContextConfig ctxCfg = new ContextConfig();
-                        ctx.addLifecycleListener( ctxCfg );
-
-                        ctxCfg.setDefaultWebXml( new File( configurationDir, "conf/web.xml"
).getAbsolutePath() );
-
-                        if ( host == null )
-                        {
-                            getHost().addChild( ctx );
-                        }
-                        else
-                        {
-                            host.addChild( ctx );
-                        }
-
-                        return ctx;
-                    }
-                };
+                Tomcat embeddedTomcat = new ExtendedTomcat( configurationDir );
 
                 Context ctx = createContext( embeddedTomcat );
 



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


Mime
View raw message