From 19e5f3b8c7733b325759beb713430553fdd4de33 Mon Sep 17 00:00:00 2001 From: aheritier Date: Sun, 25 Mar 2007 22:08:45 +0000 Subject: [PATCH] Links to local files with a parameter aren't found. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@522361 13f79535-47bb-0310-9956-ffa450edef68 --- .../plugin/linkcheck/validation/FileLinkValidator.java | 9 +++++++++ linkcheck/xdocs/changes.xml | 1 + 2 files changed, 10 insertions(+) diff --git a/linkcheck/src/main/org/apache/maven/plugin/linkcheck/validation/FileLinkValidator.java b/linkcheck/src/main/org/apache/maven/plugin/linkcheck/validation/FileLinkValidator.java index 92928dae..d1e054e6 100644 --- a/linkcheck/src/main/org/apache/maven/plugin/linkcheck/validation/FileLinkValidator.java +++ b/linkcheck/src/main/org/apache/maven/plugin/linkcheck/validation/FileLinkValidator.java @@ -70,6 +70,15 @@ public final class FileLinkValidator if ( link.trim().length() == 0 ) return lvi.getSource(); } + if ( link.indexOf( '?' ) != -1 ) + { + link = link.substring( 0, link.indexOf( '?' ) ); + + //If the link was just ?param=something or similar, then the file is the file it came from + //XXX: Theoretically we could even validate the anchor tag? + if ( link.trim().length() == 0 ) + return lvi.getSource(); + } File f = new File( lvi.getSource().getParentFile(), link ); return f; } diff --git a/linkcheck/xdocs/changes.xml b/linkcheck/xdocs/changes.xml index 5ab2f5fc..6e160dcc 100644 --- a/linkcheck/xdocs/changes.xml +++ b/linkcheck/xdocs/changes.xml @@ -26,6 +26,7 @@ + Links to local files with a parameter aren't found. Upgrade maven-model to version 3.0.2. Update jelly dependency to match the ones in maven 1.1 core. Maven 1.0.x : The report is incomplete if one or more files has errors in them.