Pass system properties to maven repo session (#10117)

The maven repository sessions used by the maven library loader requires
the java.version property to later evaluate the active profiles of
dependencies when downloading them during the plugin loader logic.

This commit fixes this by passing all system properties as a hopefully
future-proof way to provide the required data to said session.
This commit is contained in:
Bjarne Koll 2024-01-04 12:13:12 +01:00
parent 6c5ad653e5
commit 01a7a72224

View file

@ -841,6 +841,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.repository = locator.getService(RepositorySystem.class);
+ this.session = MavenRepositorySystemUtils.newSession();
+
+ this.session.setSystemProperties(System.getProperties());
+ this.session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_FAIL);
+ this.session.setLocalRepositoryManager(this.repository.newLocalRepositoryManager(this.session, new LocalRepository("libraries")));
+ this.session.setTransferListener(new AbstractTransferListener() {
@ -2069,6 +2070,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
{
private final Logger logger;
@@ -0,0 +0,0 @@ class LibraryLoader
this.repository = locator.getService( RepositorySystem.class );
this.session = MavenRepositorySystemUtils.newSession();
+ session.setSystemProperties(System.getProperties()); // Paper - paper plugins, backport system properties fix for transitive dependency parsing, see #10116
session.setChecksumPolicy( RepositoryPolicy.CHECKSUM_POLICY_FAIL );
session.setLocalRepositoryManager( repository.newLocalRepositoryManager( session, new LocalRepository( "libraries" ) ) );
session.setTransferListener( new AbstractTransferListener()
@@ -0,0 +0,0 @@ class LibraryLoader
}
logger.log( Level.INFO, "[{0}] Loading {1} libraries... please wait", new Object[]