You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/10/03 17:49:45 UTC

[maven-verifier] branch MSHARED-1139 updated (20e15e7 -> 0745def)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch MSHARED-1139
in repository https://gitbox.apache.org/repos/asf/maven-verifier.git


    omit 20e15e7  [MSHARED-1139] Calculate baseurl by means of Path and URI in Verifier#newDefaultFilterMap()/#verifyFilePresence()
     add 78065a7  [MSHARED-1146] Deprecate redundant constructors
     new 0745def  [MSHARED-1139] Calculate baseurl by means of Path and URI in Verifier#newDefaultFilterMap()/#verifyFilePresence()

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (20e15e7)
            \
             N -- N -- N   refs/heads/MSHARED-1139 (0745def)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/maven/shared/verifier/Verifier.java | 191 +++++++++++++++++----
 1 file changed, 153 insertions(+), 38 deletions(-)


[maven-verifier] 01/01: [MSHARED-1139] Calculate baseurl by means of Path and URI in Verifier#newDefaultFilterMap()/#verifyFilePresence()

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MSHARED-1139
in repository https://gitbox.apache.org/repos/asf/maven-verifier.git

commit 0745def398b25bbcf62579f65da2e5e59b534179
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Thu Sep 22 22:24:18 2022 +0200

    [MSHARED-1139] Calculate baseurl by means of Path and URI in Verifier#newDefaultFilterMap()/#verifyFilePresence()
---
 .../org/apache/maven/shared/verifier/Verifier.java | 23 +++++++---------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/src/main/java/org/apache/maven/shared/verifier/Verifier.java b/src/main/java/org/apache/maven/shared/verifier/Verifier.java
index f4b2c1d..752fdc8 100644
--- a/src/main/java/org/apache/maven/shared/verifier/Verifier.java
+++ b/src/main/java/org/apache/maven/shared/verifier/Verifier.java
@@ -31,6 +31,7 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.charset.Charset;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -942,20 +943,9 @@ public class Verifier
     {
         Map<String, String> filterMap = new HashMap<>();
 
-        String basedir = new File( getBasedir() ).getAbsolutePath();
-        filterMap.put( "@basedir@", basedir );
-
-        /*
-         * NOTE: Maven fails to properly handle percent-encoded "file:" URLs (WAGON-111) so don't use File.toURI() here
-         * and just do it the simple way.
-         */
-        String baseurl = basedir;
-        if ( !baseurl.startsWith( "/" ) )
-        {
-            baseurl = '/' + baseurl;
-        }
-        baseurl = "file://" + baseurl.replace( '\\', '/' );
-        filterMap.put( "@baseurl@", baseurl );
+        Path basedir = Paths.get( getBasedir() ).toAbsolutePath();
+        filterMap.put( "@basedir@", basedir.toString() );
+        filterMap.put( "@baseurl@", basedir.toUri().toASCIIString() );
 
         return filterMap;
     }
@@ -1064,9 +1054,10 @@ public class Verifier
     private void verifyFilePresence( String filePath, boolean wanted )
         throws VerificationException
     {
-        if ( filePath.indexOf( "!/" ) > 0 )
+        if ( filePath.contains( "!/" ) )
         {
-            String urlString = "jar:file:" + getBasedir() + "/" + filePath;
+            Path basedir = Paths.get( getBasedir() ).toAbsolutePath();
+            String urlString = "jar:" + basedir.toUri().toASCIIString() + "/" + filePath;
 
             InputStream is = null;
             try