Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package maven-install-plugin for 
openSUSE:Factory checked in at 2022-05-12 23:00:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/maven-install-plugin (Old)
 and      /work/SRC/openSUSE:Factory/.maven-install-plugin.new.1538 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "maven-install-plugin"

Thu May 12 23:00:12 2022 rev:4 rq:976411 version:3.0.0~M1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/maven-install-plugin/maven-install-plugin.changes    
    2022-03-22 19:40:48.619128310 +0100
+++ 
/work/SRC/openSUSE:Factory/.maven-install-plugin.new.1538/maven-install-plugin.changes
      2022-05-12 23:00:31.472810030 +0200
@@ -1,0 +2,16 @@
+Wed May 11 13:49:05 UTC 2022 - Fridrich Strba <[email protected]>
+
+- Upgrade to upstream verson 3.0.0 milestone M1
+- Added patches:
+  * 0001-MINSTALL-143-Remove-a-lot-of-checksum-related-dead-c.patch
+  * 0002-MINSTALL-171-Update-plugin-requires-Maven-3.2.5.patch
+    + Backport upstream fixes to avoid the org.sonatype.aether
+      dependencies
+  * 0003-Fix-tests-with-modular-javas.patch
+    + Add a maven profile to open needed modules to unnamed module
+    + Fixes tests with Java 17
+  * 0004-Fix-tests-with-maven-resolver-1.7.3.patch
+    + maven-resolver 1.7.x had an incompatible change
+    + This fix allows us to use the maven-resolver 1.7.3
+
+-------------------------------------------------------------------

Old:
----
  maven-install-plugin-2.5.2-source-release.zip

New:
----
  0001-MINSTALL-143-Remove-a-lot-of-checksum-related-dead-c.patch
  0002-MINSTALL-171-Update-plugin-requires-Maven-3.2.5.patch
  0003-Fix-tests-with-modular-javas.patch
  0004-Fix-tests-with-maven-resolver-1.7.3.patch
  maven-install-plugin-3.0.0-M1-source-release.zip

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ maven-install-plugin.spec ++++++
--- /var/tmp/diff_new_pack.tk0cCK/_old  2022-05-12 23:00:32.056810813 +0200
+++ /var/tmp/diff_new_pack.tk0cCK/_new  2022-05-12 23:00:32.060810819 +0200
@@ -16,32 +16,45 @@
 #
 
 
+%global base_ver 3.0.0
+%global milestone M1
+%bcond_with tests
 Name:           maven-install-plugin
-Version:        2.5.2
+Version:        %{base_ver}~%{milestone}
 Release:        0
 Summary:        Maven Install Plugin
 License:        Apache-2.0
 Group:          Development/Libraries/Java
-URL:            http://maven.apache.org/plugins/maven-install-plugin
-Source0:        
https://repo1.maven.org/maven2/org/apache/maven/plugins/%{name}/%{version}/%{name}-%{version}-source-release.zip
+URL:            https://maven.apache.org/plugins/maven-install-plugin
+Source0:        
https://repo1.maven.org/maven2/org/apache/maven/plugins/%{name}/%{base_ver}-%{milestone}/%{name}-%{base_ver}-%{milestone}-source-release.zip
+Patch0:         0001-MINSTALL-143-Remove-a-lot-of-checksum-related-dead-c.patch
+Patch1:         0002-MINSTALL-171-Update-plugin-requires-Maven-3.2.5.patch
+Patch2:         0003-Fix-tests-with-modular-javas.patch
+Patch3:         0004-Fix-tests-with-maven-resolver-1.7.3.patch
 BuildRequires:  fdupes
 BuildRequires:  java-devel >= 1.8
 BuildRequires:  maven-local
 BuildRequires:  unzip
-BuildRequires:  mvn(commons-codec:commons-codec)
 BuildRequires:  mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
 BuildRequires:  mvn(org.apache.maven.plugins:maven-plugin-plugin)
 BuildRequires:  mvn(org.apache.maven.plugins:maven-plugins:pom:)
-BuildRequires:  mvn(org.apache.maven.shared:maven-shared-utils)
+BuildRequires:  mvn(org.apache.maven.shared:maven-artifact-transfer)
 BuildRequires:  mvn(org.apache.maven:maven-artifact)
-BuildRequires:  mvn(org.apache.maven:maven-artifact-manager)
+BuildRequires:  mvn(org.apache.maven:maven-plugin-api)
+BuildRequires:  mvn(org.slf4j:slf4j-api)
+BuildArch:      noarch
+%if %{with tests}
+BuildRequires:  mvn(junit:junit)
+BuildRequires:  
mvn(org.apache.maven.plugin-testing:maven-plugin-testing-harness)
 BuildRequires:  mvn(org.apache.maven:maven-compat)
 BuildRequires:  mvn(org.apache.maven:maven-core)
 BuildRequires:  mvn(org.apache.maven:maven-model)
-BuildRequires:  mvn(org.apache.maven:maven-plugin-api)
-BuildRequires:  mvn(org.apache.maven:maven-project)
-BuildRequires:  mvn(org.codehaus.plexus:plexus-utils)
-BuildArch:      noarch
+BuildRequires:  mvn(org.eclipse.aether:aether-api)
+BuildRequires:  mvn(org.eclipse.aether:aether-impl) >= 1.7
+BuildRequires:  mvn(org.eclipse.aether:aether-util)
+BuildRequires:  mvn(org.mockito:mockito-core)
+BuildRequires:  mvn(org.slf4j:slf4j-nop)
+%endif
 
 %description
 Copies the project artifacts to the user's local repository.
@@ -49,27 +62,24 @@
 %package javadoc
 Summary:        Javadoc for %{name}
 Group:          Documentation/HTML
-Requires:       jpackage-utils
 
 %description javadoc
 API documentation for %{name}.
 
 %prep
-%setup -q
-# maven-core has scope "provided" in Plugin Testing Harness, so we
-# need to provide it or tests will fail to compile.  This works for
-# upstream because upstream uses a different version of Plugin Testing
-# Harness in which scope of maven-core dependency is "compile".
-%pom_add_dep org.apache.maven:maven-core::test
-
-%pom_add_dep org.apache.maven:maven-compat
+%setup -q -n %{name}-%{base_ver}-%{milestone}
+%autopatch -p1
 
 %build
-%{mvn_build} -f -- \
+%{mvn_build} \
+%if %{without tests}
+    -f \
+%endif
+    -- \
 %if %{?pkg_vcmp:%pkg_vcmp java-devel >= 9}%{!?pkg_vcmp:0}
     -Dmaven.compiler.release=8 \
 %endif
-    -Dsource=8 -DmavenVersion=3.1.1
+    -Dsource=8
 
 %install
 %mvn_install

++++++ 0001-MINSTALL-143-Remove-a-lot-of-checksum-related-dead-c.patch ++++++
>From 9b3a90c35c74a56803c671a9a49e048f125d86fc Mon Sep 17 00:00:00 2001
From: Elliotte Rusty Harold <[email protected]>
Date: Fri, 12 Jun 2020 14:47:07 -0400
Subject: [PATCH 1/4] [MINSTALL-143] Remove a lot of checksum related dead code
 and commented out tests  (#8)

* clean up warnings
* remove checksum code that was commented out
---
 .../plugins/install/InstallFileMojoTest.java  | 52 +++------------
 .../plugins/install/InstallMojoTest.java      | 33 +---------
 .../apache/maven/plugins/install/Utils.java   | 63 -------------------
 3 files changed, 11 insertions(+), 137 deletions(-)
 delete mode 100644 src/test/java/org/apache/maven/plugins/install/Utils.java

diff --git 
a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java 
b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
index f915047..f0360c9 100644
--- a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
@@ -21,7 +21,6 @@ package org.apache.maven.plugins.install;
 
 import java.io.File;
 import java.io.Reader;
-import java.util.Map;
 
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Model;
@@ -66,11 +65,6 @@ public class InstallFileMojoTest
         super.setUp();
 
         FileUtils.deleteDirectory( new File( getBasedir() + "/" + LOCAL_REPO ) 
);
-        
-//        LegacySupport legacySupport = lookup( LegacySupport.class );
-//        RepositorySystemSession repositorySession = new 
DefaultRepositorySystemSession();
-//        MavenExecutionRequest executionRequest = new 
DefaultMavenExecutionRequest();
-//        legacySupport.setSession( new MavenSession( getContainer(), 
repositorySession, executionRequest, null ) );
     }
 
     public void testInstallFileTestEnvironment()
@@ -166,29 +160,18 @@ public class InstallFileMojoTest
         File installedPom = new File( getBasedir(), LOCAL_REPO + groupId + "/" 
+ artifactId + "/" + version + "/" +
             artifactId + "-" + version + "." + "pom" );
 
-        Model model;
+        try ( Reader reader = ReaderFactory.newXmlReader( installedPom ) ) {
+            Model model = new MavenXpp3Reader().read( reader );
 
-        Reader reader = null;
-        try
-        {
-            reader = ReaderFactory.newXmlReader( installedPom );
-            model = new MavenXpp3Reader().read( reader );
-            reader.close();
-            reader = null;
-        }
-        finally
-        {
-            IOUtil.close( reader );
+            assertEquals( "4.0.0", model.getModelVersion() );
+    
+            assertEquals( (String) getVariableValueFromObject( mojo, "groupId" 
), model.getGroupId() );
+    
+            assertEquals( artifactId, model.getArtifactId() );
+    
+            assertEquals( version, model.getVersion() );
         }
 
-        assertEquals( "4.0.0", model.getModelVersion() );
-
-        assertEquals( (String) getVariableValueFromObject( mojo, "groupId" ), 
model.getGroupId() );
-
-        assertEquals( artifactId, model.getArtifactId() );
-
-        assertEquals( version, model.getVersion() );
-
         assertEquals( 5, FileUtils.getFiles( new File( LOCAL_REPO ), null, 
null ).size() );
     }
 
@@ -253,7 +236,7 @@ public class InstallFileMojoTest
         assertEquals( 4, FileUtils.getFiles( new File( LOCAL_REPO ), null, 
null ).size() );
     }
 
-    public void testInstallFileWithChecksum()
+    public void testInstallFile()
         throws Exception
     {
         File testPom =
@@ -267,10 +250,6 @@ public class InstallFileMojoTest
 
         assignValuesForParameter( mojo );
 
-//        boolean createChecksum = (Boolean) getVariableValueFromObject( mojo, 
"createChecksum" );
-//
-//        assertTrue( createChecksum );
-
         mojo.execute();
 
         String localPath = getBasedir() + "/" + LOCAL_REPO + groupId + "/" + 
artifactId + "/" + version + "/" +
@@ -278,19 +257,8 @@ public class InstallFileMojoTest
         
         File installedArtifact = new File( localPath + "." + "jar" );
         
-        //get the actual checksum of the artifact
-//        Map<String, Object> csums = ChecksumUtils.calc( file, 
Utils.CHECKSUM_ALGORITHMS );
-//        for (Map.Entry<String, Object> csum : csums.entrySet()) {
-//            Object actualSum = csum.getValue();
-//            File sum = new File( localPath + ".jar." + 
csum.getKey().toLowerCase().replace( "-", "" ) );
-//            assertTrue( sum.exists() );
-//            String generatedSum = FileUtils.fileRead( sum, "UTF-8" );
-//            assertEquals( actualSum, generatedSum );
-//        }
-
         assertTrue( installedArtifact.exists() );
         
-//        assertEquals( 9, FileUtils.getFiles( new File( LOCAL_REPO ), null, 
null ).size() );
         assertEquals( 5, FileUtils.getFiles( new File( LOCAL_REPO ), null, 
null ).size() );
     }
 
diff --git 
a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java 
b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
index e211a18..63ac6fa 100644
--- a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
@@ -58,14 +58,7 @@ public class InstallMojoTest
     {
         super.setUp();
 
-        System.out.println( ">>>Cleaning local repo " + getBasedir() + "/" + 
LOCAL_REPO + "..." );
-
         FileUtils.deleteDirectory( new File( getBasedir() + "/" + LOCAL_REPO ) 
);
-        
-//        LegacySupport legacySupport = lookup( LegacySupport.class );
-//        RepositorySystemSession repositorySession = new 
DefaultRepositorySystemSession();
-//        MavenExecutionRequest executionRequest = new 
DefaultMavenExecutionRequest();
-//        legacySupport.setSession( new MavenSession( getContainer(), 
repositorySession, executionRequest, null ) );
     }
 
     public void testInstallTestEnvironment()
@@ -250,7 +243,7 @@ public class InstallMojoTest
         assertEquals( 4, FileUtils.getFiles( new File( LOCAL_REPO ), null, 
null ).size() );
     }
 
-    public void testBasicInstallAndCreateChecksumIsTrue()
+    public void testBasicInstallAndCreate()
         throws Exception
     {
         File testPom = new File( getBasedir(), 
"target/test-classes/unit/basic-install-checksum/plugin-config.xml" );
@@ -270,10 +263,6 @@ public class InstallMojoTest
 
         artifact = (InstallArtifactStub) project.getArtifact();
 
-//        boolean createChecksum = (Boolean) getVariableValueFromObject( mojo, 
"createChecksum" );
-//
-//        assertTrue( createChecksum );
-
         artifact.setFile( file );
 
         mojo.execute();
@@ -302,31 +291,11 @@ public class InstallMojoTest
         String localPath = getBasedir() + "/" + LOCAL_REPO + groupId + "/" + 
artifact.getArtifactId() + "/" +
                         artifact.getVersion() + "/" + artifact.getArtifactId() 
+ "-" + artifact.getVersion();
         
-        //get the actual checksum of the pom
-//        Map<String, Object> csums = ChecksumUtils.calc( pom, 
Utils.CHECKSUM_ALGORITHMS );
-//        for (Map.Entry<String, Object> csum : csums.entrySet()) {
-//            Object actualPomSum = csum.getValue();
-//            File pomSum = new File( localPath + ".pom." + 
csum.getKey().toLowerCase().replace( "-", "" ) );
-//            assertTrue( pomSum.exists() );
-//            String generatedPomSum = FileUtils.fileRead( pomSum, "UTF-8" );
-//            assertEquals( actualPomSum, generatedPomSum );
-//        }
-
-        //get the actual checksum of the artifact
-//        csums = ChecksumUtils.calc( file, Utils.CHECKSUM_ALGORITHMS );
-//        for (Map.Entry<String, Object> csum : csums.entrySet()) {
-//            Object actualSum = csum.getValue();
-//            File sum = new File( localPath + "." + packaging + "." + 
csum.getKey().toLowerCase().replace( "-", "" ) );
-//            assertTrue( sum.exists() );
-//            String generatedSum = FileUtils.fileRead( sum, "UTF-8" );
-//            assertEquals( actualSum, generatedSum );
-//        }
 
         File installedArtifact = new File( localPath + "." + packaging );
 
         assertTrue( installedArtifact.exists() );
         
-//        assertEquals( 9, FileUtils.getFiles( new File( LOCAL_REPO ), null, 
null ).size() );
         assertEquals( 5, FileUtils.getFiles( new File( LOCAL_REPO ), null, 
null ).size() );
     }
 
diff --git a/src/test/java/org/apache/maven/plugins/install/Utils.java 
b/src/test/java/org/apache/maven/plugins/install/Utils.java
deleted file mode 100644
index 33c262c..0000000
--- a/src/test/java/org/apache/maven/plugins/install/Utils.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.maven.plugins.install;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.sonatype.aether.util.ChecksumUtils;
-
-/**
- * A utility class to assist testing.
- *
- * @author Benjamin Bentmann
- */
-public class Utils
-{
-
-    public static final List<String> CHECKSUM_ALGORITHMS = Arrays.asList( 
"MD5", "SHA-1" );
-
-    /**
-     * Verifies the checksum files in the local repo for the given file.
-     *
-     * @param file The file to verify its checksum with, must not be 
<code>null</code>.
-     * @throws MojoExecutionException In case the checksums were incorrect.
-     * @throws IOException If the files couldn't be read.
-     */
-    public static void verifyChecksum( File file )
-        throws MojoExecutionException, IOException
-    {
-        Map<String, Object> checksums = ChecksumUtils.calc( file, 
CHECKSUM_ALGORITHMS );
-        for ( Map.Entry<String, Object> entry : checksums.entrySet() )
-        {
-            File cksumFile = new File( file + "." + 
entry.getKey().toLowerCase().replace( "-", "" ) );
-            String actualChecksum = ChecksumUtils.read( cksumFile );
-            if ( !actualChecksum.equals( entry.getValue() ) )
-            {
-                throw new MojoExecutionException( "Incorrect " + 
entry.getKey() + " checksum for file: " + file );
-            }
-        }
-    }
-
-}
-- 
2.36.0


++++++ 0002-MINSTALL-171-Update-plugin-requires-Maven-3.2.5.patch ++++++
>From 9f5b6e0601e1667422717dfe824dbd406bb6ef67 Mon Sep 17 00:00:00 2001
From: Tamas Cservenak <[email protected]>
Date: Thu, 9 Dec 2021 19:20:36 +0100
Subject: [PATCH 2/4] [MINSTALL-171] Update plugin (requires Maven 3.2.5+)

Update plugin source and dependencies:
* update Maven requirement to 3.2.5+
* drop org.sonatype resolver, use org.eclipse
* set maven bits to provided
* drop legacy dependencies, use current ones
---
 pom.xml                                       | 43 ++++++++++++++++---
 .../plugins/install/InstallFileMojoTest.java  | 19 ++++----
 .../plugins/install/InstallMojoTest.java      | 16 ++++---
 3 files changed, 58 insertions(+), 20 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3dc9d05..78cfb73 100644
--- a/pom.xml
+++ b/pom.xml
@@ -63,7 +63,10 @@
   </distributionManagement>
 
   <properties>
-    <mavenVersion>3.0</mavenVersion>
+    <mavenVersion>3.2.5</mavenVersion>
+    <slf4jVersion>1.7.32</slf4jVersion>
+    <aetherVersion>1.1.0</aetherVersion>
+    <surefire.version>2.22.2</surefire.version>
     <javaVersion>7</javaVersion>
   </properties>
 
@@ -72,13 +75,21 @@
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
       <version>${mavenVersion}</version>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
       <version>${mavenVersion}</version>
+      <scope>provided</scope>
+    </dependency>
+    <!-- This is here to override 3.0 coming with maven-artifact-transfer -->
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>${mavenVersion}</version>
+      <scope>provided</scope>
     </dependency>
-
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-artifact-transfer</artifactId>
@@ -95,13 +106,13 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>4.12</version>
+      <version>4.13.2</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.plugin-testing</groupId>
       <artifactId>maven-plugin-testing-harness</artifactId>
-      <version>2.1</version>
+      <version>3.3.0</version>
       <scope>test</scope>
     </dependency>
     <dependency> <!-- used by maven-plugin-testing-harness, don't give it 
compile scope! -->
@@ -119,13 +130,31 @@
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
-      <version>1.7.5</version>
+      <version>${slf4jVersion}</version>
       <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-nop</artifactId>
-      <version>1.7.5</version>
+      <version>${slf4jVersion}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.aether</groupId>
+      <artifactId>aether-api</artifactId>
+      <version>${aetherVersion}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.aether</groupId>
+      <artifactId>aether-util</artifactId>
+      <version>${aetherVersion}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.aether</groupId>
+      <artifactId>aether-impl</artifactId>
+      <version>${aetherVersion}</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
@@ -149,7 +178,7 @@
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-invoker-plugin</artifactId>
-              <version>3.0.1</version>
+              <version>3.2.2</version>
               <configuration>
                 
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                 <cloneClean>true</cloneClean>
diff --git 
a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java 
b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
index f0360c9..bf040b1 100644
--- a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
@@ -26,15 +26,14 @@ import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.plugins.install.InstallFileMojo;
 import org.apache.maven.project.DefaultProjectBuildingRequest;
 import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.shared.utils.ReaderFactory;
 import org.apache.maven.shared.utils.io.FileUtils;
-import org.apache.maven.shared.utils.io.IOUtil;
-import org.sonatype.aether.impl.internal.EnhancedLocalRepositoryManager;
-import org.sonatype.aether.util.ChecksumUtils;
-import org.sonatype.aether.util.DefaultRepositorySystemSession;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
 
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -282,12 +281,16 @@ public class InstallFileMojoTest
     {
         return parameter.replace( '.', '/' );
     }
-    
-    private MavenSession createMavenSession()
+
+    private MavenSession createMavenSession() throws 
NoLocalRepositoryManagerException
     {
         MavenSession session = mock( MavenSession.class );
         DefaultRepositorySystemSession repositorySession  = new 
DefaultRepositorySystemSession();
-        repositorySession.setLocalRepositoryManager( new 
EnhancedLocalRepositoryManager( new File( LOCAL_REPO )     ) );
+        repositorySession.setLocalRepositoryManager(
+                new EnhancedLocalRepositoryManagerFactory().newInstance(
+                        repositorySession, new LocalRepository( LOCAL_REPO )
+                )
+        );
         ProjectBuildingRequest buildingRequest = new 
DefaultProjectBuildingRequest();
         buildingRequest.setRepositorySession( repositorySession );
         when( session.getProjectBuildingRequest() ).thenReturn( 
buildingRequest );
diff --git 
a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java 
b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
index 63ac6fa..ed73d2c 100644
--- a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
@@ -38,8 +38,10 @@ import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.shared.transfer.repository.RepositoryManager;
 import org.apache.maven.shared.utils.io.FileUtils;
-import org.sonatype.aether.impl.internal.EnhancedLocalRepositoryManager;
-import org.sonatype.aether.util.DefaultRepositorySystemSession;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
 
 /**
  * @author <a href="mailto:[email protected]";>Allan Ramirez</a>
@@ -85,7 +87,7 @@ public class InstallMojoTest
 
         MavenProject project = (MavenProject) getVariableValueFromObject( 
mojo, "project" );
         updateMavenProject( project );
-        
+
         setVariableValueToObject( mojo, "reactorProjects", 
Collections.singletonList( project ) );
         setVariableValueToObject( mojo, "session", createMavenSession() );
 
@@ -343,11 +345,15 @@ public class InstallMojoTest
         return parameter.replace( '.', '/' );
     }
     
-    private MavenSession createMavenSession()
+    private MavenSession createMavenSession() throws 
NoLocalRepositoryManagerException
     {
         MavenSession session = mock( MavenSession.class );
         DefaultRepositorySystemSession repositorySession  = new 
DefaultRepositorySystemSession();
-        repositorySession.setLocalRepositoryManager( new 
EnhancedLocalRepositoryManager( new File( LOCAL_REPO )     ) );
+        repositorySession.setLocalRepositoryManager(
+                new EnhancedLocalRepositoryManagerFactory().newInstance(
+                        repositorySession, new LocalRepository( LOCAL_REPO )
+                )
+        );
         ProjectBuildingRequest buildingRequest = new 
DefaultProjectBuildingRequest();
         buildingRequest.setRepositorySession( repositorySession );
         when( session.getProjectBuildingRequest() ).thenReturn( 
buildingRequest );
-- 
2.36.0


++++++ 0003-Fix-tests-with-modular-javas.patch ++++++
>From b4aee1ca2ac7911f7c9c98dd338ee4f6183129ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <[email protected]>
Date: Wed, 11 May 2022 10:31:57 +0200
Subject: [PATCH 3/4] Fix tests with modular javas

---
 pom.xml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/pom.xml b/pom.xml
index 78cfb73..b10e114 100644
--- a/pom.xml
+++ b/pom.xml
@@ -205,6 +205,22 @@
         </pluginManagement>
       </build>
     </profile>
+    <profile>
+      <id>jdk9+</id>
+      <activation>
+        <jdk>[9,)</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
 </project>
-- 
2.36.0


++++++ 0004-Fix-tests-with-maven-resolver-1.7.3.patch ++++++
>From 41a42b6af91a486ce6822b5ed1d9a05e2ca33f59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <[email protected]>
Date: Wed, 11 May 2022 10:32:19 +0200
Subject: [PATCH 4/4] Fix tests with maven-resolver 1.7.3

---
 .../org/apache/maven/plugins/install/InstallFileMojoTest.java  | 3 ++-
 .../java/org/apache/maven/plugins/install/InstallMojoTest.java | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java 
b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
index bf040b1..34acb7a 100644
--- a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
@@ -31,6 +31,7 @@ import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.shared.utils.ReaderFactory;
 import org.apache.maven.shared.utils.io.FileUtils;
 import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.internal.impl.DefaultTrackingFileManager;
 import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory;
 import org.eclipse.aether.repository.LocalRepository;
 import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
@@ -287,7 +288,7 @@ public class InstallFileMojoTest
         MavenSession session = mock( MavenSession.class );
         DefaultRepositorySystemSession repositorySession  = new 
DefaultRepositorySystemSession();
         repositorySession.setLocalRepositoryManager(
-                new EnhancedLocalRepositoryManagerFactory().newInstance(
+                new EnhancedLocalRepositoryManagerFactory( new 
DefaultTrackingFileManager() ).newInstance(
                         repositorySession, new LocalRepository( LOCAL_REPO )
                 )
         );
diff --git 
a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java 
b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
index ed73d2c..bcdd36e 100644
--- a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
@@ -39,6 +39,7 @@ import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.shared.transfer.repository.RepositoryManager;
 import org.apache.maven.shared.utils.io.FileUtils;
 import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.internal.impl.DefaultTrackingFileManager;
 import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory;
 import org.eclipse.aether.repository.LocalRepository;
 import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
@@ -350,7 +351,7 @@ public class InstallMojoTest
         MavenSession session = mock( MavenSession.class );
         DefaultRepositorySystemSession repositorySession  = new 
DefaultRepositorySystemSession();
         repositorySession.setLocalRepositoryManager(
-                new EnhancedLocalRepositoryManagerFactory().newInstance(
+                new EnhancedLocalRepositoryManagerFactory( new 
DefaultTrackingFileManager() ).newInstance(
                         repositorySession, new LocalRepository( LOCAL_REPO )
                 )
         );
-- 
2.36.0

Reply via email to