Author: olamy Date: Wed Jul 23 04:01:05 2014 New Revision: 1612754 URL: http://svn.apache.org/r1612754 Log: fix formatting
Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/deployer/TomcatManager.java tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractCatalinaMojo.java tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractCatalinaMojo.java Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/deployer/TomcatManager.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/deployer/TomcatManager.java?rev=1612754&r1=1612753&r2=1612754&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/deployer/TomcatManager.java (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/deployer/TomcatManager.java Wed Jul 23 04:01:05 2014 @@ -110,7 +110,7 @@ public class TomcatManager * @since 2.0 */ private BasicHttpContext localContext; - + private Proxy proxy; /** @@ -192,7 +192,7 @@ public class TomcatManager PoolingClientConnectionManager poolingClientConnectionManager = new PoolingClientConnectionManager(); poolingClientConnectionManager.setMaxTotal( 5 ); this.httpClient = new DefaultHttpClient( poolingClientConnectionManager ); - + if ( StringUtils.isNotEmpty( username ) ) { Credentials creds = new UsernamePasswordCredentials( username, password ); @@ -274,36 +274,44 @@ public class TomcatManager { this.userAgent = userAgent; } - + /** * @param proxy */ - public void setProxy(Proxy proxy) { - if( this.proxy != proxy ) { - this.proxy = proxy; - if( httpClient != null ) { - applyProxy(); - } - } - } - + public void setProxy( Proxy proxy ) + { + if ( this.proxy != proxy ) + { + this.proxy = proxy; + if ( httpClient != null ) + { + applyProxy(); + } + } + } + /** * {@link #setProxy(Proxy)} is called by {@link AbstractCatinalMojo#getManager()} after the constructor */ - private void applyProxy() { - if( this.proxy != null ) { - HttpHost proxy = new HttpHost(this.proxy.getHost(), this.proxy.getPort(), this.proxy.getProtocol()); - httpClient.getParams().setParameter( ConnRoutePNames.DEFAULT_PROXY, proxy ); - if( this.proxy.getUsername() != null ) { - httpClient.getCredentialsProvider().setCredentials( new AuthScope(this.proxy.getHost(), this.proxy.getPort()), - new UsernamePasswordCredentials(this.proxy.getUsername(), - this.proxy.getPassword()) ); - } - } else { - httpClient.getParams().removeParameter( ConnRoutePNames.DEFAULT_PROXY ); - } - } - + private void applyProxy() + { + if ( this.proxy != null ) + { + HttpHost proxy = new HttpHost( this.proxy.getHost(), this.proxy.getPort(), this.proxy.getProtocol() ); + httpClient.getParams().setParameter( ConnRoutePNames.DEFAULT_PROXY, proxy ); + if ( this.proxy.getUsername() != null ) + { + httpClient.getCredentialsProvider().setCredentials( + new AuthScope( this.proxy.getHost(), this.proxy.getPort() ), + new UsernamePasswordCredentials( this.proxy.getUsername(), this.proxy.getPassword() ) ); + } + } + else + { + httpClient.getParams().removeParameter( ConnRoutePNames.DEFAULT_PROXY ); + } + } + /** * Deploys the specified WAR as a URL to the specified context path. Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractCatalinaMojo.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractCatalinaMojo.java?rev=1612754&r1=1612753&r2=1612754&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractCatalinaMojo.java (original) +++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractCatalinaMojo.java Wed Jul 23 04:01:05 2014 @@ -71,7 +71,7 @@ public abstract class AbstractCatalinaMo */ @Component( role = WagonManager.class ) private WagonManager wagonManager; - + /** * The current build session instance. This is used for plugin manager API calls. */ @@ -224,11 +224,12 @@ public abstract class AbstractCatalinaMo manager = new TomcatManager( url, userName, password, charset, settings.isInteractiveMode() ); manager.setUserAgent( name + "/" + version ); - + Proxy proxy = session.getSettings().getActiveProxy(); - if( proxy != null && proxy.isActive() ) { - getLog().debug("proxy: " + proxy.getHost() + ":" + proxy.getPort()); - manager.setProxy(proxy); + if ( proxy != null && proxy.isActive() ) + { + getLog().debug( "proxy: " + proxy.getHost() + ":" + proxy.getPort() ); + manager.setProxy( proxy ); } } Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractCatalinaMojo.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractCatalinaMojo.java?rev=1612754&r1=1612753&r2=1612754&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractCatalinaMojo.java (original) +++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractCatalinaMojo.java Wed Jul 23 04:01:05 2014 @@ -71,7 +71,7 @@ public abstract class AbstractCatalinaMo */ @Component private WagonManager wagonManager; - + /** * The current build session instance. This is used for plugin manager API calls. */ @@ -81,20 +81,20 @@ public abstract class AbstractCatalinaMo /** * The full URL of the Tomcat manager instance to use. */ - @Parameter( property = "maven.tomcat.url", defaultValue = "http://localhost:8080/manager/text", required = true ) + @Parameter(property = "maven.tomcat.url", defaultValue = "http://localhost:8080/manager/text", required = true) private URL url; /** * The server id in settings.xml to use when authenticating with Tomcat manager, or <code>null</code> to use * defaults of username <code>admin</code> and no password. */ - @Parameter( property = "maven.tomcat.server" ) + @Parameter(property = "maven.tomcat.server") private String server; /** * The URL encoding charset to use when communicating with Tomcat manager. */ - @Parameter( property = "maven.tomcat.charset", defaultValue = "ISO-8859-1", required = true ) + @Parameter(property = "maven.tomcat.charset", defaultValue = "ISO-8859-1", required = true) private String charset; /** @@ -102,7 +102,7 @@ public abstract class AbstractCatalinaMo * * @since 1.0-alpha-2 */ - @Parameter( property = "tomcat.username" ) + @Parameter(property = "tomcat.username") private String username; /** @@ -110,10 +110,10 @@ public abstract class AbstractCatalinaMo * * @since 1.0-alpha-2 */ - @Parameter( property = "tomcat.password" ) + @Parameter(property = "tomcat.password") private String password; - @Parameter( defaultValue = "${plugin.version}", required = true, readonly = true ) + @Parameter(defaultValue = "${plugin.version}", required = true, readonly = true) private String version; // ---------------------------------------------------------------------- @@ -158,11 +158,9 @@ public abstract class AbstractCatalinaMo /** * Invokes Tomcat manager when this Mojo is executed. * - * @throws org.apache.maven.plugin.MojoExecutionException - * if there was a problem executing this goal - * @throws org.apache.tomcat.maven.common.deployer.TomcatManagerException - * if the Tomcat manager request fails - * @throws java.io.IOException if an i/o error occurs + * @throws org.apache.maven.plugin.MojoExecutionException if there was a problem executing this goal + * @throws org.apache.tomcat.maven.common.deployer.TomcatManagerException if the Tomcat manager request fails + * @throws java.io.IOException if an i/o error occurs */ protected abstract void invokeManager() throws MojoExecutionException, TomcatManagerException, IOException; @@ -171,8 +169,7 @@ public abstract class AbstractCatalinaMo * Gets the Tomcat manager wrapper object configured for this goal. * * @return the Tomcat manager wrapper object - * @throws org.apache.maven.plugin.MojoExecutionException - * if there was a problem obtaining the authentication details + * @throws org.apache.maven.plugin.MojoExecutionException if there was a problem obtaining the authentication details */ protected TomcatManager getManager() throws MojoExecutionException @@ -228,9 +225,10 @@ public abstract class AbstractCatalinaMo manager.setUserAgent( name + "/" + version ); Proxy proxy = session.getSettings().getActiveProxy(); - if( proxy != null && proxy.isActive() ) { - getLog().debug("proxy: " + proxy.getHost() + ":" + proxy.getPort()); - manager.setProxy(proxy); + if ( proxy != null && proxy.isActive() ) + { + getLog().debug( "proxy: " + proxy.getHost() + ":" + proxy.getPort() ); + manager.setProxy( proxy ); } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org