tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1367441 - /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
Date Tue, 31 Jul 2012 07:43:16 GMT
Author: olamy
Date: Tue Jul 31 07:43:15 2012
New Revision: 1367441

URL: http://svn.apache.org/viewvc?rev=1367441&view=rev
Log:
[MTOMCAT-172] configuring aliases with tomcat7:run

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=1367441&r1=1367440&r2=1367441&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
Tue Jul 31 07:43:15 2012
@@ -433,6 +433,22 @@ public abstract class AbstractRunMojo
      */
     protected String propertiesPortFilePath;
 
+    /**
+     * configure host name
+     *
+     * @parameter expression="${maven.tomcat.hostName}" default-value="localhost"
+     * @since 2.0
+     */
+    protected String hostName;
+
+    /**
+     * configure aliases
+     *
+     * @parameter
+     * @since 2.0
+     */
+    protected String[] aliases;
+
     // ----------------------------------------------------------------------
     // Fields
     // ----------------------------------------------------------------------
@@ -933,6 +949,18 @@ public abstract class AbstractRunMojo
 
                 embeddedTomcat.getHost().setAppBase( new File( configurationDir, "webapps"
).getAbsolutePath() );
 
+                if ( hostName != null )
+                {
+                    embeddedTomcat.getHost().setName( hostName );
+                }
+                if ( aliases != null )
+                {
+                    for ( String alias : aliases )
+                    {
+                        embeddedTomcat.getHost().addAlias( alias );
+                    }
+
+                }
                 createStaticContext( embeddedTomcat, ctx, embeddedTomcat.getHost() );
 
                 Connector connector = new Connector( protocol );



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


Mime
View raw message