2013/11/4 <[email protected]>:
> Author: olamy
> Date: Mon Nov 4 04:12:13 2013
> New Revision: 1538502
>
> URL: http://svn.apache.org/r1538502
> Log:
> [MTOMCAT-92] Bind tomcat to a self-chosen network interface
>
> 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=1538502&r1=1538501&r2=1538502&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
> Mon Nov 4 04:12:13 2013
> @@ -136,6 +136,16 @@ public abstract class AbstractRunMojo
> private int port;
>
> /**
> + *
> + * For servers with more than one IP address, this attribute specifies
> which address
> + * will be used for listening on the specified port.
> + * By default, this port will be used on all IP addresses associated
> with the server.
1. The other way,
"this IP address will be used on all ports" ?
2. You code sets the address on HTTP connector. What about HTTPS and AJP ones?
> + * @since 2.2
> + */
> + @Parameter( property = "maven.tomcat.address")
> + private String address;
> +
> + /**
> * The AJP port to run the Tomcat server on.
> * By default it's 0 this means won't be started.
> * The ajp connector will be started only for value > 0.
> @@ -909,6 +919,13 @@ public abstract class AbstractRunMojo
> }
> httpConnector.setURIEncoding( uriEncoding );
> httpConnector.setUseBodyEncodingForURI(
> this.useBodyEncodingForURI );
> +
> + if ( address !=null)
> + {
> + //ici
> + httpConnector.setAttribute( "address", address );
> + }
3. (Specific to Tomcat 6 part of this commit): It would be a bit
easier to pass the address to Embedded.createConnector(String, int,
String) as called few lines above. There is a variant of that method
that accepts String as the address argument
> +
> container.addConnector( httpConnector );
>
> // create https connector
>
> 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=1538502&r1=1538501&r2=1538502&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
> Mon Nov 4 04:12:13 2013
>...
The same for Tomcat 7.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]