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:
1 parent
07ecab2756
commit
9ede010fa4
6 files changed
+89
-17
No files matched your search
@@ -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
|
||||
{
|
||||
|
||||
+5
-4
@@ -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() );
|
||||
|
||||
Reference in new issue
Block a user