tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1537827 - in /tomcat/maven-plugin/trunk: tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/ tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/
Date Fri, 01 Nov 2013 05:36:37 GMT
Author: olamy
Date: Fri Nov  1 05:36:37 2013
New Revision: 1537827

URL: http://svn.apache.org/r1537827
Log:
[MTOMCAT-217] configure a pre define http port for standalone jar

Modified:
    tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java
    tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
    tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java

Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java?rev=1537827&r1=1537826&r2=1537827&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java
Fri Nov  1 05:36:37 2013
@@ -103,11 +103,12 @@ public abstract class AbstractExecWarMoj
                defaultValue = "${project.artifactId}-${project.version}-war-exec.jar", required
= true)
     protected String finalName;
 
-	/**
+    /**
      * Skip the execution
+     *
      * @since 2.2
      */
-    @Parameter( property = "maven.tomcat.skip", defaultValue = "false" )
+    @Parameter(property = "maven.tomcat.skip", defaultValue = "false")
     private boolean skip;
 
     /**
@@ -204,6 +205,14 @@ public abstract class AbstractExecWarMoj
     @Parameter(property = "maven.tomcat.exec.war.connectorHttpProtocol", defaultValue = "HTTP/1.1",
required = true)
     protected String connectorHttpProtocol;
 
+    /**
+     * configure a default http port for the standalone jar
+     *
+     * @since 2.2
+     */
+    @Parameter( property = "maven.tomcat.exec.war.httpPort" )
+    protected String httpPort;
+
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
@@ -270,6 +279,11 @@ public abstract class AbstractExecWarMoj
             properties.put( Tomcat7Runner.ACCESS_LOG_VALVE_FORMAT_KEY, accessLogValveFormat
);
             properties.put( Tomcat7Runner.HTTP_PROTOCOL_KEY, connectorHttpProtocol );
 
+            if ( httpPort != null )
+            {
+                properties.put( Tomcat7Runner.HTTP_PORT_KEY, httpPort );
+            }
+
             os = new ArchiveStreamFactory().createArchiveOutputStream( ArchiveStreamFactory.JAR,
                                                                        execWarJarOutputStream
);
 

Modified: tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java?rev=1537827&r1=1537826&r2=1537827&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
Fri Nov  1 05:36:37 2013
@@ -78,6 +78,11 @@ public class Tomcat7Runner
      */
     public static final String HTTP_PROTOCOL_KEY = "connectorhttpProtocol";
 
+    /**
+     * key for default http port defined in the plugin
+     */
+    public static final String HTTP_PORT_KEY = "httpPort";
+
 
     public int httpPort;
 

Modified: tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java?rev=1537827&r1=1537826&r2=1537827&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java
Fri Nov  1 05:36:37 2013
@@ -138,6 +138,14 @@ public class Tomcat7RunnerCli
         {
             tomcat7Runner.serverXmlPath = line.getOptionValue( serverXmlPath.getOpt() );
         }
+
+        String port = tomcat7Runner.runtimeProperties.getProperty( Tomcat7Runner.HTTP_PORT_KEY
);
+        if ( port != null)
+        {
+            tomcat7Runner.httpPort = Integer.parseInt( port );
+        }
+
+        // cli win for the port
         if ( line.hasOption( httpPort.getOpt() ) )
         {
             tomcat7Runner.httpPort = Integer.parseInt( line.getOptionValue( httpPort.getOpt()
) );



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


Mime
View raw message