Author: gboue Date: Thu Oct 13 19:03:08 2016 New Revision: 1764759 URL: http://svn.apache.org/viewvc?rev=1764759&view=rev Log: [MSITE-705] Too much information in maven logs during site:deploy in sftp...
The debug listener on the Wagon instance is only added if we're running Maven in debug mode. This closes #95. Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/invoker.properties (with props) maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/pom.xml (with props) maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/verify.groovy (with props) maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/invoker.properties (with props) maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/pom.xml (with props) maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/verify.groovy (with props) Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/invoker.properties?rev=1764759&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/invoker.properties (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/invoker.properties Thu Oct 13 19:03:08 2016 @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +invoker.goals = clean site:site site:deploy +invoker.debug = true Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/invoker.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/invoker.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/pom.xml?rev=1764759&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/pom.xml (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/pom.xml Thu Oct 13 19:03:08 2016 @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.plugins.its.site</groupId> + <artifactId>msite-705-debug</artifactId> + <version>1.0-SNAPSHOT</version> + <description> + Tests that Wagon debug logs (session/transfer) are only displayed if debug mode is activated + </description> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <version>@project.version@</version> + </plugin> + </plugins> + </build> + <distributionManagement> + <site> + <id>MSITE-705</id> + <name>Test publish</name> + <url>file://@project.build.directory@/it/MSITE-705/deploy/MSITE-705/junk/</url> + </site> + </distributionManagement> +</project> Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/verify.groovy?rev=1764759&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/verify.groovy (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/verify.groovy Thu Oct 13 19:03:08 2016 @@ -0,0 +1,22 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +content = new File( basedir, 'build.log' ).text +return content.contains( 'Session: Disconnected' ) Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-debug/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/invoker.properties?rev=1764759&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/invoker.properties (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/invoker.properties Thu Oct 13 19:03:08 2016 @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +invoker.goals = clean site:site site:deploy +invoker.debug = false Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/invoker.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/invoker.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/pom.xml?rev=1764759&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/pom.xml (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/pom.xml Thu Oct 13 19:03:08 2016 @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.plugins.its.site</groupId> + <artifactId>msite-705-no-debug</artifactId> + <version>1.0-SNAPSHOT</version> + <description> + Tests that Wagon debug logs (session/transfer) are only displayed if debug mode is activated + </description> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <version>@project.version@</version> + </plugin> + </plugins> + </build> + <distributionManagement> + <site> + <id>MSITE-705</id> + <name>Test publish</name> + <url>file://@project.build.directory@/it/MSITE-705/deploy/MSITE-705/junk/</url> + </site> + </distributionManagement> +</project> Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/verify.groovy?rev=1764759&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/verify.groovy (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/verify.groovy Thu Oct 13 19:03:08 2016 @@ -0,0 +1,22 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +content = new File( basedir, 'build.log' ).text +return !content.contains( 'Session: Disconnected' ) Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-705-no-debug/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java?rev=1764759&r1=1764758&r2=1764759&view=diff ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java (original) +++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java Thu Oct 13 19:03:08 2016 @@ -411,11 +411,14 @@ public abstract class AbstractDeployMojo try { - Debug debug = new Debug(); + if ( getLog().isDebugEnabled() ) + { + Debug debug = new Debug(); - wagon.addSessionListener( debug ); + wagon.addSessionListener( debug ); - wagon.addTransferListener( debug ); + wagon.addTransferListener( debug ); + } if ( proxyInfo != null ) {