You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2007/09/27 01:14:57 UTC

svn commit: r579850 - /maven/sandbox/trunk/plugins/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java

Author: vsiveton
Date: Wed Sep 26 16:14:55 2007
New Revision: 579850

URL: http://svn.apache.org/viewvc?rev=579850&view=rev
Log:
o fixed report due to r579845 

Modified:
    maven/sandbox/trunk/plugins/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java

Modified: maven/sandbox/trunk/plugins/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java?rev=579850&r1=579849&r2=579850&view=diff
==============================================================================
--- maven/sandbox/trunk/plugins/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java (original)
+++ maven/sandbox/trunk/plugins/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java Wed Sep 26 16:14:55 2007
@@ -24,6 +24,7 @@
 import java.util.List;
 import java.util.Locale;
 
+import org.apache.maven.doxia.linkcheck.HttpBean;
 import org.apache.maven.doxia.linkcheck.LinkCheck;
 import org.apache.maven.doxia.linkcheck.model.LinkcheckFile;
 import org.apache.maven.doxia.linkcheck.model.LinkcheckFileResult;
@@ -34,6 +35,8 @@
 import org.apache.maven.reporting.AbstractMavenReport;
 import org.apache.maven.reporting.AbstractMavenReportRenderer;
 import org.apache.maven.reporting.MavenReportException;
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Settings;
 import org.codehaus.plexus.i18n.I18N;
 
 /**
@@ -56,6 +59,15 @@
     protected MavenProject project;
 
     /**
+     * The Maven Settings.
+     *
+     * @parameter default-value="${settings}"
+     * @required
+     * @readonly
+     */
+    private Settings settings;
+
+    /**
      * The settings offline paramater.
      *
      * @parameter expression="${settings.offline}"
@@ -65,6 +77,14 @@
     private boolean offline;
 
     /**
+     * If online, the HTTP method should automatically follow HTTP redirects,
+     * <tt>false</tt> otherwise.
+     *
+     * @parameter default-value="false"
+     */
+    protected boolean httpFollowRedirect;
+
+    /**
      * Report output directory.
      *
      * @parameter expression="${project.reporting.outputDirectory}"
@@ -217,8 +237,21 @@
         lc.setReportOutput( new File( linkcheckOutput ) );
         lc.setLinkCheckCache( new File( linkcheckCache ) );
         lc.setExcludedLinks( exludedLinks );
-        lc.setHttpMethod( httpMethod );
         lc.setReportLevel( reportLevel );
+
+        HttpBean bean = new HttpBean();
+        bean.setMethod( httpMethod );
+        bean.setFollowRedirects( httpFollowRedirect );
+
+        Proxy proxy = settings.getActiveProxy();
+        if ( proxy != null )
+        {
+            bean.setProxyHost( proxy.getHost() );
+            bean.setProxyPort( proxy.getPort() );
+            bean.setProxyUser( proxy.getUsername() );
+            bean.setProxyPassword( proxy.getPassword() );
+        }
+        lc.setHttp( bean );
 
         lc.doExecute();