From 01a7a72224eed74113902a121a3997265042c5b2 Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Thu, 4 Jan 2024 12:13:12 +0100 Subject: [PATCH] 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. --- patches/api/Paper-Plugins.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/api/Paper-Plugins.patch b/patches/api/Paper-Plugins.patch index 8b515ddce1..a29a69bb42 100644 --- a/patches/api/Paper-Plugins.patch +++ b/patches/api/Paper-Plugins.patch @@ -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[]