Author: khmarbaise
Date: Sun Nov 23 15:12:35 2014
New Revision: 1641198

URL: http://svn.apache.org/r1641198
Log:
[MLINKCHECK-19] Upgrade to maven-plugins parent version 27
 - Fixed checkstyle reported issues.
 - Fixed warning about maven-antrun-plugin to use
   target instead of tasks.

Modified:
    maven/plugins/trunk/maven-linkcheck-plugin/pom.xml
    
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java
    
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReportGenerator.java
    
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/SiteInvoker.java

Modified: maven/plugins/trunk/maven-linkcheck-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-linkcheck-plugin/pom.xml?rev=1641198&r1=1641197&r2=1641198&view=diff
==============================================================================
--- maven/plugins/trunk/maven-linkcheck-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-linkcheck-plugin/pom.xml Sun Nov 23 15:12:35 2014
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-plugins</artifactId>
-    <version>25</version>
+    <version>27</version>
     <relativePath>../maven-plugins/pom.xml</relativePath>
   </parent>
 
@@ -236,11 +236,11 @@ under the License.
                 <id>integration-test</id>
                 <phase>integration-test</phase>
                 <configuration>
-                  <tasks>
+                  <target>
                     <echo /><echo /><echo /><echo /><echo />
                     <echo level="warning">NO INTEGRATION TESTS DEFINED</echo>
                     <echo /><echo /><echo /><echo /><echo />
-                  </tasks>
+                  </target>
                 </configuration>
                 <goals>
                   <goal>run</goal>

Modified: 
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java?rev=1641198&r1=1641197&r2=1641198&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java
 (original)
+++ 
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java
 Sun Nov 23 15:12:35 2014
@@ -100,8 +100,7 @@ public class LinkcheckReport
     private boolean offline;
 
     /**
-     * If online, the HTTP method should automatically follow HTTP redirects,
-     * <tt>false</tt> otherwise.
+     * If online, the HTTP method should automatically follow HTTP redirects, 
<tt>false</tt> otherwise.
      *
      * @parameter default-value="true"
      */
@@ -120,25 +119,19 @@ public class LinkcheckReport
     @Parameter( defaultValue = 
"${project.build.directory}/linkcheck/linkcheck.xml", required = true )
     protected File linkcheckOutput;
 
+    // CHECKSTYLE_OFF: LineLength
     /**
      * The HTTP method to use. Currently supported are "GET" and "HEAD".
      * <dl>
      * <dt>HTTP GET</dt>
-     * <dd>
-     * The HTTP GET method is defined in section 9.3 of
-     * <a href="http://www.ietf.org/rfc/rfc2616.txt";>RFC2616</a>:
-     * The GET method means retrieve whatever information (in the form of an
-     * entity) is identified by the Request-URI.
-     * </dd>
+     * <dd>The HTTP GET method is defined in section 9.3 of <a 
href="http://www.ietf.org/rfc/rfc2616.txt";>RFC2616</a>:
+     * The GET method means retrieve whatever information (in the form of an 
entity) is identified by the Request-URI.</dd>
      * <dt>HTTP HEAD</dt>
-     * <dd>
-     * The HTTP HEAD method is defined in section 9.4 of
-     * <a href="http://www.ietf.org/rfc/rfc2616.txt";>RFC2616</a>:
-     * The HEAD method is identical to GET except that the server MUST NOT
-     * return a message-body in the response.
-     * </dd>
+     * <dd>The HTTP HEAD method is defined in section 9.4 of <a 
href="http://www.ietf.org/rfc/rfc2616.txt";>RFC2616</a>:
+     * The HEAD method is identical to GET except that the server MUST NOT 
return a message-body in the response.</dd>
      * </dl>
      */
+    // CHECKSTYLE_ON: LineLength
     @Parameter( defaultValue = "head", required = true )
     private String httpMethod;
 
@@ -159,10 +152,8 @@ public class LinkcheckReport
     private Integer[] excludedHttpStatusWarnings;
 
     /**
-     * A list of pages to exclude.
-     * <br/>
-     * <b>Note</b>:
-     * <br/>
+     * A list of pages to exclude. <br/>
+     * <b>Note</b>: <br/>
      * <ul>
      * <li>This report, i.e. <code>linkcheck.html</code>, is always 
excluded.</li>
      * <li>May contain Ant-style wildcards and double wildcards, e.g. 
<code>apidocs/**</code>, etc.</li>
@@ -172,8 +163,7 @@ public class LinkcheckReport
     private String[] excludedPages;
 
     /**
-     * The list of links to exclude.
-     * <br/>
+     * The list of links to exclude. <br/>
      * <b>Note</b>: Patterns like <code>&#42;&#42;/dummy/&#42;</code> are 
allowed for excludedLink.
      */
     @Parameter
@@ -188,6 +178,7 @@ public class LinkcheckReport
 
     /**
      * The extra HttpClient parameters to be used when fetching links. For 
instance:
+     * 
      * <pre>
      * &lt;httpClientParameters&gt;
      * &nbsp;&lt;property&gt;
@@ -196,6 +187,7 @@ public class LinkcheckReport
      * &nbsp;&lt;/property&gt;
      * &lt;/httpClientParameters&gt;
      * </pre>
+     * 
      * See <a 
href="http://hc.apache.org/httpclient-3.x/preference-api.html";>HttpClient 
preference page</a>
      */
     @Parameter( property = "httpClientParameters" )
@@ -235,11 +227,16 @@ public class LinkcheckReport
     private LinkcheckModel result;
 
     protected static final String ICON_SUCCESS = "images/icon_success_sml.gif";
+
     protected static final String ICON_WARNING = "images/icon_warning_sml.gif";
+
     protected static final String ICON_INFO = "images/icon_info_sml.gif";
+
     protected static final String ICON_ERROR = "images/icon_error_sml.gif";
-    private static final String pluginResourcesBase = 
"org/apache/maven/plugin/linkcheck";
-    private static final String resourceNames[] = { ICON_SUCCESS, 
ICON_WARNING, ICON_INFO, ICON_ERROR };
+
+    private static final String PLUGIN_RESOURCES_BASE = 
"org/apache/maven/plugin/linkcheck";
+
+    private static final String RESOURCE_NAMES[] = { ICON_SUCCESS, 
ICON_WARNING, ICON_INFO, ICON_ERROR };
 
     // ----------------------------------------------------------------------
     // Public methods
@@ -330,8 +327,8 @@ public class LinkcheckReport
         {
             if ( getLog().isWarnEnabled() )
             {
-                getLog().warn( "File encoding has not been set, using platform 
encoding "
-                    + ReaderFactory.FILE_ENCODING + ", i.e. build is platform 
dependent!" );
+                getLog().warn( "File encoding has not been set, using platform 
encoding " + ReaderFactory.FILE_ENCODING
+                                   + ", i.e. build is platform dependent!" );
             }
 
             encoding = ReaderFactory.FILE_ENCODING;
@@ -378,7 +375,7 @@ public class LinkcheckReport
         else
         {
             getLog().warn( "The number of documents analyzed by Linkcheck 
could differ from the actual "
-                                   + "number of documents!" );
+                               + "number of documents!" );
 
             basedir = outputDirectory;
             basedir.mkdirs();
@@ -441,7 +438,7 @@ public class LinkcheckReport
         // Exclude this report
         pagesToExclude.add( getOutputName() + ".html" );
 
-        return (String[]) pagesToExclude.toArray(new 
String[pagesToExclude.size()]);
+        return (String[]) pagesToExclude.toArray( new 
String[pagesToExclude.size()] );
     }
 
     // ----------------------------------------------------------------------
@@ -472,9 +469,10 @@ public class LinkcheckReport
         try
         {
             getLog().debug( "Copying static linkcheck resources." );
-            for (String resourceName : resourceNames) {
-                URL url = 
this.getClass().getClassLoader().getResource(pluginResourcesBase + "/" + 
resourceName);
-                FileUtils.copyURLToFile(url, new 
File(getReportOutputDirectory(), resourceName));
+            for ( String resourceName : RESOURCE_NAMES )
+            {
+                URL url = this.getClass().getClassLoader().getResource( 
PLUGIN_RESOURCES_BASE + "/" + resourceName );
+                FileUtils.copyURLToFile( url, new File( 
getReportOutputDirectory(), resourceName ) );
             }
         }
         catch ( IOException e )

Modified: 
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReportGenerator.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReportGenerator.java?rev=1641198&r1=1641197&r2=1641198&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReportGenerator.java
 (original)
+++ 
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReportGenerator.java
 Sun Nov 23 15:12:35 2014
@@ -1,19 +1,24 @@
+package org.apache.maven.plugins.linkcheck;
+
 /*
- *  Licensed 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.
+ * 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.
  */
 
-package org.apache.maven.plugins.linkcheck;
-
 import java.util.List;
 import java.util.Locale;
 
@@ -28,7 +33,6 @@ import org.codehaus.plexus.i18n.I18N;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
- *
  * @author ltheussl
  * @since 1.1
  */
@@ -37,15 +41,20 @@ public class LinkcheckReportGenerator
     private final I18N i18n;
 
     private String httpMethod;
+
     private boolean offline;
+
     private String[] excludedLinks;
+
     private Integer[] excludedHttpStatusErrors;
+
     private Integer[] excludedHttpStatusWarnings;
+
     private String[] excludedPages;
+
     private boolean httpFollowRedirect;
 
     /**
-     *
      * @param i18n not null.
      */
     public LinkcheckReportGenerator( I18N i18n )
@@ -54,7 +63,6 @@ public class LinkcheckReportGenerator
     }
 
     /**
-     *
      * @param excludedHttpStatusErrors may be null.
      */
     public void setExcludedHttpStatusErrors( Integer[] 
excludedHttpStatusErrors )
@@ -63,7 +71,6 @@ public class LinkcheckReportGenerator
     }
 
     /**
-     *
      * @param excludedHttpStatusWarnings may be null.
      */
     public void setExcludedHttpStatusWarnings( Integer[] 
excludedHttpStatusWarnings )
@@ -72,7 +79,6 @@ public class LinkcheckReportGenerator
     }
 
     /**
-     *
      * @param excludedLinks may be null.
      */
     public void setExcludedLinks( String[] excludedLinks )
@@ -81,7 +87,6 @@ public class LinkcheckReportGenerator
     }
 
     /**
-     *
      * @param excludedPages may be null.
      */
     public void setExcludedPages( String[] excludedPages )
@@ -90,7 +95,6 @@ public class LinkcheckReportGenerator
     }
 
     /**
-     *
      * @param httpFollowRedirect default is false.
      */
     public void setHttpFollowRedirect( boolean httpFollowRedirect )
@@ -99,7 +103,6 @@ public class LinkcheckReportGenerator
     }
 
     /**
-     *
      * @param httpMethod may be null.
      */
     public void setHttpMethod( String httpMethod )
@@ -108,7 +111,6 @@ public class LinkcheckReportGenerator
     }
 
     /**
-     *
      * @param offline default is false.
      */
     public void setOffline( boolean offline )
@@ -184,6 +186,7 @@ public class LinkcheckReportGenerator
 
     private void generateSummarySection( Locale locale, LinkcheckModel 
linkcheckModel, Sink sink )
     {
+        // CHECKSTYLE_OFF: LineLength
         // Calculus
         List linkcheckFiles = linkcheckModel.getFiles();
 
@@ -193,13 +196,14 @@ public class LinkcheckReportGenerator
         int totalValidLinks = 0;
         int totalErrorLinks = 0;
         int totalWarningLinks = 0;
-        for (Object linkcheckFile1 : linkcheckFiles) {
+        for ( Object linkcheckFile1 : linkcheckFiles )
+        {
             LinkcheckFile linkcheckFile = (LinkcheckFile) linkcheckFile1;
 
             totalLinks += linkcheckFile.getNumberOfLinks();
-            totalValidLinks += 
linkcheckFile.getNumberOfLinks(LinkcheckFileResult.VALID_LEVEL);
-            totalErrorLinks += 
linkcheckFile.getNumberOfLinks(LinkcheckFileResult.ERROR_LEVEL);
-            totalWarningLinks += 
linkcheckFile.getNumberOfLinks(LinkcheckFileResult.WARNING_LEVEL);
+            totalValidLinks += linkcheckFile.getNumberOfLinks( 
LinkcheckFileResult.VALID_LEVEL );
+            totalErrorLinks += linkcheckFile.getNumberOfLinks( 
LinkcheckFileResult.ERROR_LEVEL );
+            totalWarningLinks += linkcheckFile.getNumberOfLinks( 
LinkcheckFileResult.WARNING_LEVEL );
         }
 
         sink.section1();
@@ -225,9 +229,7 @@ public class LinkcheckReportGenerator
 
         sink.tableRow();
         sink.tableCell();
-        sink.rawText(
-                           i18n.getString( "linkcheck-report", locale,
-                                           
"report.linkcheck.summary.table.httpFollowRedirect" ) );
+        sink.rawText( i18n.getString( "linkcheck-report", locale, 
"report.linkcheck.summary.table.httpFollowRedirect" ) );
         sink.tableCell_();
         sink.tableCell();
         sink.text( String.valueOf( httpFollowRedirect ) );
@@ -236,10 +238,7 @@ public class LinkcheckReportGenerator
 
         sink.tableRow();
         sink.tableCell();
-        sink
-                 .rawText(
-                           i18n
-                               .getString( "linkcheck-report", locale, 
"report.linkcheck.summary.table.httpMethod" ) );
+        sink.rawText( i18n.getString( "linkcheck-report", locale, 
"report.linkcheck.summary.table.httpMethod" ) );
         sink.tableCell_();
         sink.tableCell();
         if ( StringUtils.isEmpty( httpMethod ) )
@@ -255,8 +254,7 @@ public class LinkcheckReportGenerator
 
         sink.tableRow();
         sink.tableCell();
-        sink.rawText(
-                           i18n.getString( "linkcheck-report", locale, 
"report.linkcheck.summary.table.offline" ) );
+        sink.rawText( i18n.getString( "linkcheck-report", locale, 
"report.linkcheck.summary.table.offline" ) );
         sink.tableCell_();
         sink.tableCell();
         sink.text( String.valueOf( offline ) );
@@ -265,9 +263,7 @@ public class LinkcheckReportGenerator
 
         sink.tableRow();
         sink.tableCell();
-        sink.rawText(
-                           i18n.getString( "linkcheck-report", locale,
-                                           
"report.linkcheck.summary.table.excludedPages" ) );
+        sink.rawText( i18n.getString( "linkcheck-report", locale, 
"report.linkcheck.summary.table.excludedPages" ) );
         sink.tableCell_();
         sink.tableCell();
         if ( excludedPages == null || excludedPages.length == 0 )
@@ -283,9 +279,7 @@ public class LinkcheckReportGenerator
 
         sink.tableRow();
         sink.tableCell();
-        sink.rawText(
-                           i18n.getString( "linkcheck-report", locale,
-                                           
"report.linkcheck.summary.table.excludedLinks" ) );
+        sink.rawText( i18n.getString( "linkcheck-report", locale, 
"report.linkcheck.summary.table.excludedLinks" ) );
         sink.tableCell_();
         sink.tableCell();
         if ( excludedLinks == null || excludedLinks.length == 0 )
@@ -301,9 +295,8 @@ public class LinkcheckReportGenerator
 
         sink.tableRow();
         sink.tableCell();
-        sink.rawText(
-                           i18n.getString( "linkcheck-report", locale,
-                                           
"report.linkcheck.summary.table.excludedHttpStatusErrors" ) );
+        sink.rawText( i18n.getString( "linkcheck-report", locale,
+                                      
"report.linkcheck.summary.table.excludedHttpStatusErrors" ) );
         sink.tableCell_();
         sink.tableCell();
         if ( excludedHttpStatusErrors == null || 
excludedHttpStatusErrors.length == 0 )
@@ -319,9 +312,8 @@ public class LinkcheckReportGenerator
 
         sink.tableRow();
         sink.tableCell();
-        sink.rawText(
-                           i18n.getString( "linkcheck-report", locale,
-                                           
"report.linkcheck.summary.table.excludedHttpStatusWarnings" ) );
+        sink.rawText( i18n.getString( "linkcheck-report", locale,
+                                      
"report.linkcheck.summary.table.excludedHttpStatusWarnings" ) );
         sink.tableCell_();
         sink.tableCell();
         if ( excludedHttpStatusWarnings == null || 
excludedHttpStatusWarnings.length == 0 )
@@ -381,6 +373,8 @@ public class LinkcheckReportGenerator
         sink.table_();
 
         sink.section1_();
+        // CHECKSTYLE_ON: LineLength
+
     }
 
     private void generateDetailsSection( Locale locale, LinkcheckModel 
linkcheckModel, Sink sink )
@@ -401,93 +395,110 @@ public class LinkcheckReportGenerator
 
         // Content
         List linkcheckFiles = linkcheckModel.getFiles();
-        for (Object linkcheckFile1 : linkcheckFiles) {
+        for ( Object linkcheckFile1 : linkcheckFiles )
+        {
             LinkcheckFile linkcheckFile = (LinkcheckFile) linkcheckFile1;
 
             sink.tableRow();
 
             sink.tableCell();
-            if (linkcheckFile.getUnsuccessful() == 0) {
-                iconValid(locale, sink);
-            } else {
-                iconError(locale, sink);
+            if ( linkcheckFile.getUnsuccessful() == 0 )
+            {
+                iconValid( locale, sink );
+            }
+            else
+            {
+                iconError( locale, sink );
             }
             sink.tableCell_();
 
             // tableCell( createLinkPatternedText( 
linkcheckFile.getRelativePath(), "./"
             // + linkcheckFile.getRelativePath() ) );
             sink.tableCell();
-            sink.link(linkcheckFile.getRelativePath());
-            sink.text(linkcheckFile.getRelativePath());
+            sink.link( linkcheckFile.getRelativePath() );
+            sink.text( linkcheckFile.getRelativePath() );
             sink.link_();
             sink.tableCell_();
             sink.tableCell();
-            sink.text(String.valueOf(linkcheckFile.getNumberOfLinks()));
+            sink.text( String.valueOf( linkcheckFile.getNumberOfLinks() ) );
             sink.tableCell_();
             sink.tableCell();
-            
sink.text(String.valueOf(linkcheckFile.getNumberOfLinks(LinkcheckFileResult.VALID_LEVEL)));
+            sink.text( String.valueOf( linkcheckFile.getNumberOfLinks( 
LinkcheckFileResult.VALID_LEVEL ) ) );
             sink.tableCell_();
             sink.tableCell();
-            
sink.text(String.valueOf(linkcheckFile.getNumberOfLinks(LinkcheckFileResult.WARNING_LEVEL)));
+            sink.text( String.valueOf( linkcheckFile.getNumberOfLinks( 
LinkcheckFileResult.WARNING_LEVEL ) ) );
             sink.tableCell_();
             sink.tableCell();
-            
sink.text(String.valueOf(linkcheckFile.getNumberOfLinks(LinkcheckFileResult.ERROR_LEVEL)));
+            sink.text( String.valueOf( linkcheckFile.getNumberOfLinks( 
LinkcheckFileResult.ERROR_LEVEL ) ) );
             sink.tableCell_();
 
             sink.tableRow_();
 
             // Detail error
-            if (linkcheckFile.getUnsuccessful() != 0) {
+            if ( linkcheckFile.getUnsuccessful() != 0 )
+            {
                 sink.tableRow();
 
                 sink.tableCell();
-                sink.text("");
+                sink.text( "" );
                 sink.tableCell_();
 
                 // TODO it is due to DOXIA-78
-                sink.rawText("<td colspan=\"5\">");
+                sink.rawText( "<td colspan=\"5\">" );
 
                 sink.table();
 
-                for (Object o : linkcheckFile.getResults()) {
+                for ( Object o : linkcheckFile.getResults() )
+                {
                     LinkcheckFileResult linkcheckFileResult = 
(LinkcheckFileResult) o;
 
-                    if (linkcheckFileResult.getStatusLevel() == 
LinkcheckFileResult.VALID_LEVEL) {
+                    if ( linkcheckFileResult.getStatusLevel() == 
LinkcheckFileResult.VALID_LEVEL )
+                    {
                         continue;
                     }
 
                     sink.tableRow();
 
                     sink.tableCell();
-                    if (linkcheckFileResult.getStatusLevel() == 
LinkcheckFileResult.WARNING_LEVEL) {
-                        iconWarning(locale, sink);
-                    } else if (linkcheckFileResult.getStatusLevel() == 
LinkcheckFileResult.ERROR_LEVEL) {
-                        iconError(locale, sink);
+                    if ( linkcheckFileResult.getStatusLevel() == 
LinkcheckFileResult.WARNING_LEVEL )
+                    {
+                        iconWarning( locale, sink );
+                    }
+                    else if ( linkcheckFileResult.getStatusLevel() == 
LinkcheckFileResult.ERROR_LEVEL )
+                    {
+                        iconError( locale, sink );
                     }
                     sink.tableCell_();
 
                     sink.tableCell();
                     sink.italic();
-                    if (linkcheckFileResult.getTarget().startsWith("#")) {
-                        sink.link(linkcheckFile.getRelativePath() + 
linkcheckFileResult.getTarget());
-                    } else if 
(linkcheckFileResult.getTarget().startsWith(".")) {
+                    if ( linkcheckFileResult.getTarget().startsWith( "#" ) )
+                    {
+                        sink.link( linkcheckFile.getRelativePath() + 
linkcheckFileResult.getTarget() );
+                    }
+                    else if ( linkcheckFileResult.getTarget().startsWith( "." 
) )
+                    {
                         // We need to calculate a correct absolute path here, 
because target is a relative path
-                        String absolutePath = 
FilenameUtils.getFullPath(linkcheckFile.getRelativePath())
+                        String absolutePath =
+                            FilenameUtils.getFullPath( 
linkcheckFile.getRelativePath() )
                                 + linkcheckFileResult.getTarget();
-                        String normalizedPath = 
FilenameUtils.normalize(absolutePath);
-                        if (normalizedPath == null) {
+                        String normalizedPath = FilenameUtils.normalize( 
absolutePath );
+                        if ( normalizedPath == null )
+                        {
                             normalizedPath = absolutePath;
                         }
-                        sink.link(normalizedPath);
-                    } else {
-                        sink.link(linkcheckFileResult.getTarget());
+                        sink.link( normalizedPath );
+                    }
+                    else
+                    {
+                        sink.link( linkcheckFileResult.getTarget() );
                     }
                     // Show the link as it was written to make it easy for
                     // the author to find it in the source document
-                    sink.text(linkcheckFileResult.getTarget());
+                    sink.text( linkcheckFileResult.getTarget() );
                     sink.link_();
-                    sink.text(": ");
-                    sink.text(linkcheckFileResult.getErrorMessage());
+                    sink.text( ": " );
+                    sink.text( linkcheckFileResult.getErrorMessage() );
                     sink.italic_();
                     sink.tableCell_();
 
@@ -517,11 +528,8 @@ public class LinkcheckReportGenerator
             sink.tableHeaderCell_();
         }
         sink.rawText( "<th rowspan=\"2\">" );
-        sink.text(
-                        detail ? i18n.getString( "linkcheck-report", locale,
-                                                 
"report.linkcheck.detail.table.documents" )
-                                        : i18n.getString( "linkcheck-report", 
locale,
-                                                          
"report.linkcheck.summary.table.documents" ) );
+        sink.text( detail ? i18n.getString( "linkcheck-report", locale, 
"report.linkcheck.detail.table.documents" )
+                        : i18n.getString( "linkcheck-report", locale, 
"report.linkcheck.summary.table.documents" ) );
         sink.tableHeaderCell_();
         // TODO it is due to DOXIA-78
         sink.rawText( "<th colspan=\"4\" align=\"center\">" );

Modified: 
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/SiteInvoker.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/SiteInvoker.java?rev=1641198&r1=1641197&r2=1641198&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/SiteInvoker.java
 (original)
+++ 
maven/plugins/trunk/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/SiteInvoker.java
 Sun Nov 23 15:12:35 2014
@@ -1,19 +1,24 @@
+package org.apache.maven.plugins.linkcheck;
+
 /*
- *  Licensed 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.
+ * 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.
  */
 
-package org.apache.maven.plugins.linkcheck;
-
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
@@ -53,15 +58,14 @@ import org.codehaus.plexus.util.StringUt
 import org.codehaus.plexus.util.WriterFactory;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 
-
 /**
- *
  * @author ltheussl
  * @since 1.1
  */
 public class SiteInvoker
 {
     private final ArtifactRepository localRepository;
+
     private final Log log;
 
     public SiteInvoker( ArtifactRepository localRepository, Log log )
@@ -73,8 +77,7 @@ public class SiteInvoker
     /**
      * Invoke Maven for the <code>site</code> phase for a temporary Maven 
project using
      * <code>tmpReportingOutputDirectory</code> as 
<code>${project.reporting.outputDirectory}</code>.
-     * This is a workaround to be sure that all site files have been correctly 
generated.
-     * <br/>
+     * This is a workaround to be sure that all site files have been correctly 
generated. <br/>
      * <b>Note 1</b>: the Maven Home should be defined in the 
<code>maven.home</code> Java system property
      * or defined in <code>M2_HOME</code> system env variables.
      * <b>Note 2</be>: we can't use <code>siteOutputDirectory</code> param 
from site plugin because some plugins
@@ -90,8 +93,10 @@ public class SiteInvoker
         String mavenHome = getMavenHome();
         if ( StringUtils.isEmpty( mavenHome ) )
         {
+            // CHECKSTYLE_OFF: LineLength
             getLog().error( "Could NOT invoke Maven because no Maven Home is 
defined. "
-                + "You need to set the M2_HOME system env variable or a 
'maven.home' Java system property." );
+                                + "You need to set the M2_HOME system env 
variable or a 'maven.home' Java system property." );
+            // CHECKSTYLE_ON: LineLength
             return;
         }
 
@@ -156,8 +161,9 @@ public class SiteInvoker
     {
         List profileIds = new ArrayList();
 
-        for (Object o : clone.getActiveProfiles()) {
-            profileIds.add(((Profile) o).getId());
+        for ( Object o : clone.getActiveProfiles() )
+        {
+            profileIds.add( ( (Profile) o ).getId() );
         }
 
         return profileIds;
@@ -170,8 +176,8 @@ public class SiteInvoker
      * @param goals the list of goals
      * @param properties the properties for the invoker
      */
-    private void invoke( File projectFile, File invokerLog, String mavenHome,
-        List goals, List activeProfiles, Properties properties )
+    private void invoke( File projectFile, File invokerLog, String mavenHome, 
List goals, List activeProfiles,
+                         Properties properties )
     {
         Invoker invoker = new DefaultInvoker();
         invoker.setMavenHome( new File( mavenHome ) );
@@ -180,11 +186,11 @@ public class SiteInvoker
 
         InvocationRequest request = new DefaultInvocationRequest();
         request.setLocalRepositoryDirectory( localRepoDir );
-        //request.setUserSettingsFile( settingsFile );
+        // request.setUserSettingsFile( settingsFile );
         request.setInteractive( false );
         request.setShowErrors( getLog().isErrorEnabled() );
         request.setDebug( getLog().isDebugEnabled() );
-        //request.setShowVersion( false );
+        // request.setShowVersion( false );
         request.setBaseDirectory( projectFile.getParentFile() );
         request.setPomFile( projectFile );
         request.setGoals( goals );
@@ -230,8 +236,7 @@ public class SiteInvoker
             IOUtil.close( reader );
         }
 
-        if ( invokerLogContent != null
-            && invokerLogContent.contains("Error occurred during 
initialization of VM"))
+        if ( invokerLogContent != null && invokerLogContent.contains( "Error 
occurred during initialization of VM" ) )
         {
             getLog().info( "Error occurred during initialization of VM, try to 
use an empty MAVEN_OPTS." );
 
@@ -350,7 +355,7 @@ public class SiteInvoker
 
     /**
      * @return the Maven home defined in the <code>maven.home</code> system 
property or defined
-     * in <code>M2_HOME</code> system env variables or null if never setted.
+     *         in <code>M2_HOME</code> system env variables or null if never 
setted.
      * @see #invoke(Invoker, InvocationRequest, File, List, Properties, String)
      */
     private String getMavenHome()
@@ -373,7 +378,7 @@ public class SiteInvoker
         if ( !m2Home.exists() )
         {
             getLog().error( "Cannot find Maven application directory. Either 
specify \'maven.home\' "
-                + "system property, or M2_HOME environment variable." );
+                                + "system property, or M2_HOME environment 
variable." );
         }
 
         return mavenHome;
@@ -401,8 +406,8 @@ public class SiteInvoker
 
     /**
      * @return the <code>JAVA_HOME</code> from System.getProperty( "java.home" 
)
-     * By default, <code>System.getProperty( "java.home" ) = JRE_HOME</code> 
and <code>JRE_HOME</code>
-     * should be in the <code>JDK_HOME</code> or null if not setted.
+     *         By default, <code>System.getProperty( "java.home" ) = 
JRE_HOME</code> and <code>JRE_HOME</code> should be
+     *         in the <code>JDK_HOME</code> or null if not setted.
      * @see #invoke(Invoker, InvocationRequest, File, List, Properties, String)
      */
     private File getJavaHome()
@@ -433,7 +438,7 @@ public class SiteInvoker
         if ( javaHome == null || !javaHome.exists() )
         {
             getLog().error( "Cannot find Java application directory. Either 
specify \'java.home\' "
-                + "system property, or JAVA_HOME environment variable." );
+                                + "system property, or JAVA_HOME environment 
variable." );
         }
 
         return javaHome;


Reply via email to