PR: MPLINKCHECK-5
linkcheck plugin uses global proxy settings. There is no way to perform check using a proxy while still having a non-proxied project git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@369157 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -20,3 +20,9 @@
|
||||
maven.linkcheck.cache=${maven.build.dir}/linkcheck/linkcheck.cache
|
||||
maven.linkcheck.failonerror=false
|
||||
maven.linkcheck.exclude=${pom.repository.url}
|
||||
maven.linkcheck.proxy.host=${maven.proxy.host}
|
||||
maven.linkcheck.proxy.port=${maven.proxy.port}
|
||||
maven.linkcheck.proxy.username=${maven.proxy.username}
|
||||
maven.linkcheck.proxy.password=${maven.proxy.password}
|
||||
maven.linkcheck.proxy.ntlm.host=${maven.proxy.ntlm.host}
|
||||
maven.linkcheck.proxy.ntlm.domain=${maven.proxy.ntlm.domain}
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
maven.junit.fork=yes
|
||||
# Properties required for the unit tests
|
||||
maven.junit.sysproperties = \
|
||||
maven.proxy.host \
|
||||
maven.proxy.port \
|
||||
maven.proxy.username \
|
||||
maven.proxy.password \
|
||||
maven.proxy.ntlm.host \
|
||||
maven.proxy.ntlm.domain \
|
||||
maven.linkcheck.proxy.host \
|
||||
maven.linkcheck.proxy.port \
|
||||
maven.linkcheck.proxy.username \
|
||||
maven.linkcheck.proxy.password \
|
||||
maven.linkcheck.proxy.ntlm.host \
|
||||
maven.linkcheck.proxy.ntlm.domain \
|
||||
maven.mode.online
|
||||
|
||||
maven.jar.override = on
|
||||
|
||||
@@ -58,9 +58,17 @@ public final class LinkCheck
|
||||
|
||||
private static final long MEG = 1024 * 1024;
|
||||
|
||||
private static final String MAVEN_PROXY_NTLM_HOST = "maven.proxy.ntlm.host";
|
||||
private static final String MAVEN_PROXY_HOST = "maven.linkcheck.proxy.host";
|
||||
|
||||
private static final String MAVEN_PROXY_NTLM_DOMAIN = "maven.proxy.ntlm.domain";
|
||||
private static final String MAVEN_PROXY_PORT = "maven.linkcheck.proxy.port";
|
||||
|
||||
private static final String MAVEN_PROXY_USERNAME = "maven.linkcheck.proxy.username";
|
||||
|
||||
private static final String MAVEN_PROXY_PASSWORD = "maven.linkcheck.proxy.password";
|
||||
|
||||
private static final String MAVEN_PROXY_NTLM_HOST = "maven.linkcheck.proxy.ntlm.host";
|
||||
|
||||
private static final String MAVEN_PROXY_NTLM_DOMAIN = "maven.linkcheck.proxy.ntlm.domain";
|
||||
|
||||
private File basedir;
|
||||
|
||||
@@ -172,10 +180,16 @@ public final class LinkCheck
|
||||
MavenJellyContext ctx = ( (Project) getProject() ).getContext();
|
||||
if ( ctx.getOnline().booleanValue() )
|
||||
{
|
||||
lvm.addLinkValidator( new OnlineHTTPLinkValidator( ctx.getProxyHost(), ctx.getProxyPort(), ctx
|
||||
.getProxyUserName(), ctx.getProxyPassword(), (String) ctx.getVariable( MAVEN_PROXY_NTLM_HOST ),
|
||||
(String) ctx
|
||||
.getVariable( MAVEN_PROXY_NTLM_DOMAIN ) ) );
|
||||
lvm
|
||||
.addLinkValidator( new OnlineHTTPLinkValidator(
|
||||
(String) ctx.getVariable( MAVEN_PROXY_HOST ),
|
||||
(String) ctx.getVariable( MAVEN_PROXY_PORT ),
|
||||
(String) ctx.getVariable( MAVEN_PROXY_USERNAME ),
|
||||
(String) ctx.getVariable( MAVEN_PROXY_PASSWORD ),
|
||||
(String) ctx
|
||||
.getVariable( MAVEN_PROXY_NTLM_HOST ),
|
||||
(String) ctx
|
||||
.getVariable( MAVEN_PROXY_NTLM_DOMAIN ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -39,10 +39,11 @@ public class HTTPLinkValidatorTest
|
||||
System.err.println( "maven.mode.online : " + mavenOnline );
|
||||
if ( mavenOnline )
|
||||
{
|
||||
hlv = new OnlineHTTPLinkValidator( System.getProperty( "maven.proxy.host" ), System
|
||||
.getProperty( "maven.proxy.port" ), System.getProperty( "maven.proxy.username" ), System
|
||||
.getProperty( "maven.proxy.password" ), System.getProperty( "maven.proxy.ntlm.host" ), System
|
||||
.getProperty( "maven.proxy.ntlm.domain" ) );
|
||||
hlv = new OnlineHTTPLinkValidator( System.getProperty( "maven.linkcheck.proxy.host" ), System
|
||||
.getProperty( "maven.linkcheck.proxy.port" ), System.getProperty( "maven.linkcheck.proxy.username" ),
|
||||
System.getProperty( "maven.linkcheck.proxy.password" ), System
|
||||
.getProperty( "maven.linkcheck.proxy.ntlm.host" ), System
|
||||
.getProperty( "maven.linkcheck.proxy.ntlm.domain" ) );
|
||||
|
||||
assertEquals( LinkValidationResult.VALID, checkLink( "http://www.apache.org" ).getStatus() );
|
||||
assertEquals( LinkValidationResult.ERROR, checkLink( "http://www.example.com>);" ).getStatus() );
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<action dev="aheritier" type="fix" issue="MPLINKCHECK-20" due-to="Ignacio G. Mac Dowell">StackOverflowError processing apidocs/index-all.html.</action>
|
||||
<action dev="aheritier" type="add" issue="MPLINKCHECK-19">Support NTLM proxies.</action>
|
||||
<action dev="aheritier" type="update" issue="MPLINKCHECK-10">"Moved Permanently" sites are reported as a warning and not as an error.</action>
|
||||
<action dev="aheritier" type="add" issue="MPLINKCHECK-5">linkcheck plugin uses global proxy settings. There is no way to perform check using a proxy while still having a non-proxied project.</action>
|
||||
<action dev="aheritier" type="add">If maven is in offline mode the report doesn't test external urls. A warning is displayed in the report.</action>
|
||||
<action dev="brett" type="update">Make compatible with Maven 1.1</action>
|
||||
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependency is updated : commons-collections v2.1 -> v3.0</action>
|
||||
|
||||
@@ -58,7 +58,57 @@
|
||||
Those urls in files that start with one of the excluded urls will be ignored.
|
||||
Defaults to <code>pom.repository.url</code>.
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>maven.linkcheck.proxy.host</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
The IP or address of your proxy.
|
||||
Defaults to <code>maven.proxy.host</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.linkcheck.proxy.port</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
The port number of your proxy.
|
||||
Defaults to <code>maven.proxy.port</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.linkcheck.proxy.username</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
User name if your proxy requires authentication.
|
||||
Defaults to <code>maven.proxy.username</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.linkcheck.proxy.password</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Password if your proxy requires authentication.
|
||||
Defaults to <code>maven.proxy.password</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.linkcheck.proxy.ntlm.host</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
The host to use if you are using NTLM authentication.
|
||||
Defaults to <code>maven.proxy.ntlm.host</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.linkcheck.proxy.ntlm.domain</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
The NT domain to use if you are using NTLM authentication.
|
||||
Defaults to <code>maven.proxy.ntlm.domain</code>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user