[1.0,2.0) Versions 1.0 (included) to 2.0 (not included)
*
[1.0,2.0] Versions 1.0 to 2.0 (both included)
*
[1.5,) Versions 1.5 and higher
From 268f9565746175f5900670e372092e0c071d85bd Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Mon, 19 Jul 2021 23:45:50 +0200
Subject: [PATCH 063/183] Use proper term: directory
---
apache-maven/src/bin/mvn.cmd | 2 +-
.../projects/project-builder/it0063/jdk/jre/placeholder.txt | 2 +-
.../it0063/jdk/jre/placeholder.txt | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index b8367f61e3e3..d8f26265f8c8 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -74,7 +74,7 @@ goto error
set MAVEN_CMD_LINE_ARGS=%*
-@REM Find the project basedir, i.e., the directory that contains the folder ".mvn".
+@REM Find the project basedir, i.e., the directory that contains the directory ".mvn".
@REM Fallback to current working directory if not found.
set "MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%"
diff --git a/maven-core/src/test/projects/project-builder/it0063/jdk/jre/placeholder.txt b/maven-core/src/test/projects/project-builder/it0063/jdk/jre/placeholder.txt
index e26e86087ce3..4a9eb145a1e3 100644
--- a/maven-core/src/test/projects/project-builder/it0063/jdk/jre/placeholder.txt
+++ b/maven-core/src/test/projects/project-builder/it0063/jdk/jre/placeholder.txt
@@ -1 +1 @@
-need it so that empty folder does not get deleted
\ No newline at end of file
+need it so that empty directory does not get deleted
diff --git a/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/jre/placeholder.txt b/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/jre/placeholder.txt
index e26e86087ce3..4a9eb145a1e3 100644
--- a/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/jre/placeholder.txt
+++ b/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/jre/placeholder.txt
@@ -1 +1 @@
-need it so that empty folder does not get deleted
\ No newline at end of file
+need it so that empty directory does not get deleted
From 25df095829bff8a1744db7dbf1ddd14aa1f8d43f Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Mon, 19 Jul 2021 23:56:22 +0200
Subject: [PATCH 064/183] [MNG-7190] Load mavenrc from /usr/local/etc also in
Bourne shell script
---
apache-maven/src/bin/mvn | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 1d429303a6b1..cc2cdacba096 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -29,6 +29,10 @@
if [ -z "$MAVEN_SKIP_RC" ] ; then
+ if [ -f /usr/local/etc/mavenrc ] ; then
+ . /usr/local/etc/mavenrc
+ fi
+
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
From c395ca976dc9eaed65dcdc0037508d1edbfb57f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Boutemy?=
Date: Tue, 20 Jul 2021 22:41:03 +0200
Subject: [PATCH 065/183] [MNG-7190] add /usr/local/etc/mavenrc to reference
documentation
---
apache-maven/src/site/apt/index.apt.vm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apache-maven/src/site/apt/index.apt.vm b/apache-maven/src/site/apt/index.apt.vm
index 994aeab1d9eb..1d802661d98f 100644
--- a/apache-maven/src/site/apt/index.apt.vm
+++ b/apache-maven/src/site/apt/index.apt.vm
@@ -31,9 +31,9 @@ ${project.name}
* <<>> invocation can be customised through:
- * <<>> and <<<~/.mavenrc>>> scripts on Unix,
+ * <<>> (since 3.8.2), <<>> and <<<$HOME/.mavenrc>>> scripts on Unix,
- * <<<~\mavenrc_pre.bat>>> and <<<~\mavenrc_pre.cmd>>> scripts on Windows,
+ * <<<%USERPROFILE%\\mavenrc_pre.bat>>> and <<<%USERPROFILE%\\mavenrc_pre.cmd>>> scripts on Windows,
[]
From b74199ed446c83282ad806afaf962a7f74eac0ea Mon Sep 17 00:00:00 2001
From: Guillaume Nodet
Date: Wed, 25 Nov 2020 20:12:04 +0100
Subject: [PATCH 066/183] [MNG-7034] StackOverflowError thrown if a cycle
exists in BOM imports
This closes #484
---
.../model/building/DefaultModelBuilder.java | 11 +-
.../building/DefaultModelBuilderTest.java | 153 ++++++++++++++++++
2 files changed, 162 insertions(+), 2 deletions(-)
create mode 100644 maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderTest.java
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
index a8568efb2753..a089f9d991df 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
@@ -248,6 +248,13 @@ public DefaultModelBuilder setReportingConverter( ReportingConverter reportingCo
@Override
public ModelBuildingResult build( ModelBuildingRequest request )
throws ModelBuildingException
+ {
+ return build( request, new LinkedHashSet() );
+ }
+
+ @SuppressWarnings( "checkstyle:methodlength" )
+ protected ModelBuildingResult build( ModelBuildingRequest request, Collection importIds )
+ throws ModelBuildingException
{
// phase 1
DefaultModelBuildingResult result = new DefaultModelBuildingResult();
@@ -427,7 +434,7 @@ else if ( !parentIds.add( parentData.getId() ) )
if ( !request.isTwoPhaseBuilding() )
{
- build( request, result );
+ build( request, result, importIds );
}
return result;
@@ -1303,7 +1310,7 @@ private void importDependencyManagement( Model model, ModelBuildingRequest reque
final ModelBuildingResult importResult;
try
{
- importResult = build( importRequest );
+ importResult = build( importRequest, importIds );
}
catch ( ModelBuildingException e )
{
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderTest.java
new file mode 100644
index 000000000000..4e7919a6c2ed
--- /dev/null
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderTest.java
@@ -0,0 +1,153 @@
+package org.apache.maven.model.building;
+
+ /*
+ * 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 org.apache.maven.model.Dependency;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Repository;
+import org.apache.maven.model.resolution.InvalidRepositoryException;
+import org.apache.maven.model.resolution.ModelResolver;
+import org.apache.maven.model.resolution.UnresolvableModelException;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * @author Guillaume Nodet
+ */
+public class DefaultModelBuilderTest
+{
+
+ private static final String BASE1_ID = "thegroup:base1:pom";
+ private static final String BASE1_ID2 = "thegroup:base1:1";
+
+ private static final String BASE1 = "\n" +
+ " 4.0.0\n" +
+ " thegroup\n" +
+ " base1\n" +
+ " 1\n" +
+ " pom\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " thegroup\n" +
+ " base2\n" +
+ " 1\n" +
+ " pom\n" +
+ " import\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "\n";
+
+ private static final String BASE2_ID = "thegroup:base2:pom";
+ private static final String BASE2_ID2 = "thegroup:base2:1";
+
+ private static final String BASE2 = "\n" +
+ " 4.0.0\n" +
+ " thegroup\n" +
+ " base2\n" +
+ " 1\n" +
+ " pom\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " thegroup\n" +
+ " base1\n" +
+ " 1\n" +
+ " pom\n" +
+ " import\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "\n";
+
+ @Test( expected = ModelBuildingException.class )
+ public void testCycleInImports()
+ throws Exception
+ {
+ ModelBuilder builder = new DefaultModelBuilderFactory().newInstance();
+ assertNotNull( builder );
+
+ DefaultModelBuildingRequest request = new DefaultModelBuildingRequest();
+ request.setModelSource( new StringModelSource( BASE1 ) );
+ request.setModelResolver( new CycleInImportsResolver() );
+
+ builder.build( request );
+ }
+
+ static class CycleInImportsResolver extends BaseModelResolver
+ {
+ @Override
+ public ModelSource resolveModel(Dependency dependency) throws UnresolvableModelException
+ {
+ switch ( dependency.getManagementKey() )
+ {
+ case BASE1_ID: return new StringModelSource( BASE1 );
+ case BASE2_ID: return new StringModelSource( BASE2 );
+ }
+ return null;
+ }
+ }
+
+ static class BaseModelResolver implements ModelResolver
+ {
+ @Override
+ public ModelSource resolveModel( String groupId, String artifactId, String version )
+ throws UnresolvableModelException
+ {
+ switch ( groupId + ":" + artifactId + ":" + version )
+ {
+ case BASE1_ID2: return new StringModelSource( BASE1 );
+ case BASE2_ID2: return new StringModelSource( BASE2 );
+ }
+ return null;
+ }
+
+ @Override
+ public ModelSource resolveModel( Parent parent ) throws UnresolvableModelException
+ {
+ return null;
+ }
+
+ @Override
+ public ModelSource resolveModel( Dependency dependency ) throws UnresolvableModelException
+ {
+ return null;
+ }
+
+ @Override
+ public void addRepository( Repository repository ) throws InvalidRepositoryException
+ {
+ }
+
+ @Override
+ public void addRepository(Repository repository, boolean replace) throws InvalidRepositoryException
+ {
+ }
+
+ @Override
+ public ModelResolver newCopy()
+ {
+ return this;
+ }
+ }
+
+}
From 22a8cfa05976b23284388675dcabd7e5e8037fb0 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Thu, 22 Jul 2021 21:07:03 +0200
Subject: [PATCH 067/183] [MNG-6648] 'mavenrc_pre' script does not receive
arguments like mavenrc in Bourne shell does
This closes #511
---
apache-maven/src/bin/mvn.cmd | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index d8f26265f8c8..0faa39f81de8 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -35,8 +35,8 @@
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat"
-if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd"
+if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
+if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre
@setlocal
From f32eb09892686cba083f9f175b3c8eac0ac42ae7 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Fri, 23 Jul 2021 22:45:34 +0200
Subject: [PATCH 068/183] [MNG-7010] Omit "NB: JAVA_HOME should point to a JDK
not a JRE"
This closes #512
---
apache-maven/src/bin/mvn | 5 ++---
apache-maven/src/bin/mvn.cmd | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index cc2cdacba096..29e0eabb837c 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -100,9 +100,8 @@ else
fi
if [ ! -x "$JAVACMD" ] ; then
- echo "The JAVA_HOME environment variable is not defined correctly" >&2
- echo "This environment variable is needed to run this program" >&2
- echo "NB: JAVA_HOME should point to a JDK not a JRE" >&2
+ echo "The JAVA_HOME environment variable is not defined correctly," >&2
+ echo "this environment variable is needed to run this program." >&2
exit 1
fi
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index 0faa39f81de8..fcb0f455a804 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -54,9 +54,8 @@ set "JAVACMD=%JAVA_HOME%\bin\java.exe"
:checkJCmd
if exist "%JAVACMD%" goto chkMHome
-echo The JAVA_HOME environment variable is not defined correctly >&2
-echo This environment variable is needed to run this program >&2
-echo NB: JAVA_HOME should point to a JDK not a JRE >&2
+echo The JAVA_HOME environment variable is not defined correctly, >&2
+echo this environment variable is needed to run this program. >&2
goto error
:chkMHome
From 51f6d8b8525d8bf218f70100ec99a7ae97097923 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sun, 25 Jul 2021 14:32:31 +0200
Subject: [PATCH 069/183] [MNG-7196] Upgrade Jansi to 2.3.4
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index dbe5eb2de604..750e63b1eeb8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -294,7 +294,7 @@ under the License.
org.fusesource.jansijansi
- 2.3.3
+ 2.3.4org.slf4j
From 7ecdb3c970d71de3e48fe4de691388868ac03630 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Tue, 27 Jul 2021 14:58:11 +0200
Subject: [PATCH 070/183] [MNG-7198] Upgrade SLF4J to 1.7.32
---
.../{MIT-slf4j-api-1.7.30.txt => MIT-slf4j-api-1.7.32.txt} | 0
pom.xml | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
rename apache-maven/src/main/appended-resources/licenses/{MIT-slf4j-api-1.7.30.txt => MIT-slf4j-api-1.7.32.txt} (100%)
diff --git a/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.30.txt b/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.32.txt
similarity index 100%
rename from apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.30.txt
rename to apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.32.txt
diff --git a/pom.xml b/pom.xml
index 750e63b1eeb8..318141ea1899 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@ under the License.
1.111.31.6.3
- 1.7.30
+ 1.7.322.2.11.7.4true
From ea98e05a04480131370aa0c110b8c54cf726c06f Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Wed, 4 Aug 2021 21:03:30 +0200
Subject: [PATCH 071/183] [maven-release-plugin] prepare release maven-3.8.2
---
apache-maven/pom.xml | 2 +-
maven-artifact/pom.xml | 2 +-
maven-builder-support/pom.xml | 2 +-
maven-compat/pom.xml | 2 +-
maven-core/pom.xml | 2 +-
maven-embedder/pom.xml | 2 +-
maven-model-builder/pom.xml | 2 +-
maven-model/pom.xml | 2 +-
maven-plugin-api/pom.xml | 2 +-
maven-repository-metadata/pom.xml | 2 +-
maven-resolver-provider/pom.xml | 2 +-
maven-settings-builder/pom.xml | 2 +-
maven-settings/pom.xml | 2 +-
maven-slf4j-provider/pom.xml | 2 +-
pom.xml | 6 +++---
15 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index 6e267ad5e25a..42491b3feb84 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2apache-maven
diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml
index 6b2aabfeebe7..d085c96530d2 100644
--- a/maven-artifact/pom.xml
+++ b/maven-artifact/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-artifact
diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml
index ed0df18ec467..af3608dbb1a5 100644
--- a/maven-builder-support/pom.xml
+++ b/maven-builder-support/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-builder-support
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index 55f4f2575342..161764395933 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-compat
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index dc5a422e202a..7c7b722310ce 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-core
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 2edf4171d63b..637a408cf40b 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-embedder
diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml
index a383fefe3e4f..1365b6b64026 100644
--- a/maven-model-builder/pom.xml
+++ b/maven-model-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-model-builder
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index cd9a63940231..c99d8e337fe2 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-model
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
index 3d93184524ee..8ac3cfbb5037 100644
--- a/maven-plugin-api/pom.xml
+++ b/maven-plugin-api/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-plugin-api
diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml
index b1ec1e540fb1..486e26e04be5 100644
--- a/maven-repository-metadata/pom.xml
+++ b/maven-repository-metadata/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-repository-metadata
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index 355a4ebab0c4..d4a1c61363e9 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-resolver-provider
diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml
index ee196b75d804..055eb0dbb485 100644
--- a/maven-settings-builder/pom.xml
+++ b/maven-settings-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-settings-builder
diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml
index bdc4c0f435bf..606550eea8fa 100644
--- a/maven-settings/pom.xml
+++ b/maven-settings/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-settings
diff --git a/maven-slf4j-provider/pom.xml b/maven-slf4j-provider/pom.xml
index b896f9548acd..b4280ce7a460 100644
--- a/maven-slf4j-provider/pom.xml
+++ b/maven-slf4j-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2-SNAPSHOT
+ 3.8.2maven-slf4j-provider
diff --git a/pom.xml b/pom.xml
index 318141ea1899..1875b9f65b72 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven
- 3.8.2-SNAPSHOT
+ 3.8.2pomApache Maven
@@ -77,7 +77,7 @@ under the License.
ref/3-LATESTNone**/package-info.java
- 2019-11-07T12:32:18Z
+ 2021-08-04T18:57:55Z
@@ -101,7 +101,7 @@ under the License.
scm:git:https://gitbox.apache.org/repos/asf/maven.gitscm:git:https://gitbox.apache.org/repos/asf/maven.githttps://github.com/apache/maven/tree/${project.scm.tag}
- maven-3.8.x
+ maven-3.8.2jira
From 865dcaa6fffc8fbc679f190280e1f0f7b1d783b5 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Wed, 4 Aug 2021 21:03:42 +0200
Subject: [PATCH 072/183] [maven-release-plugin] prepare for next development
iteration
---
apache-maven/pom.xml | 2 +-
maven-artifact/pom.xml | 2 +-
maven-builder-support/pom.xml | 2 +-
maven-compat/pom.xml | 2 +-
maven-core/pom.xml | 2 +-
maven-embedder/pom.xml | 2 +-
maven-model-builder/pom.xml | 2 +-
maven-model/pom.xml | 2 +-
maven-plugin-api/pom.xml | 2 +-
maven-repository-metadata/pom.xml | 2 +-
maven-resolver-provider/pom.xml | 2 +-
maven-settings-builder/pom.xml | 2 +-
maven-settings/pom.xml | 2 +-
maven-slf4j-provider/pom.xml | 2 +-
pom.xml | 4 ++--
15 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index 42491b3feb84..2cc6ca31d533 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTapache-maven
diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml
index d085c96530d2..5203f1b79592 100644
--- a/maven-artifact/pom.xml
+++ b/maven-artifact/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-artifact
diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml
index af3608dbb1a5..191bfc5967d0 100644
--- a/maven-builder-support/pom.xml
+++ b/maven-builder-support/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-builder-support
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index 161764395933..06686b980a5d 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-compat
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 7c7b722310ce..60b958f1f6fb 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-core
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 637a408cf40b..e0b647902053 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-embedder
diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml
index 1365b6b64026..06d42d38e31b 100644
--- a/maven-model-builder/pom.xml
+++ b/maven-model-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-model-builder
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index c99d8e337fe2..0e002c0c2f5e 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-model
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
index 8ac3cfbb5037..a0a708926b69 100644
--- a/maven-plugin-api/pom.xml
+++ b/maven-plugin-api/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-plugin-api
diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml
index 486e26e04be5..b4ac0f489b00 100644
--- a/maven-repository-metadata/pom.xml
+++ b/maven-repository-metadata/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-repository-metadata
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index d4a1c61363e9..70e0f4e5bc35 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-resolver-provider
diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml
index 055eb0dbb485..a85c8a8c1191 100644
--- a/maven-settings-builder/pom.xml
+++ b/maven-settings-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-settings-builder
diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml
index 606550eea8fa..6fa967c38ca3 100644
--- a/maven-settings/pom.xml
+++ b/maven-settings/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-settings
diff --git a/maven-slf4j-provider/pom.xml b/maven-slf4j-provider/pom.xml
index b4280ce7a460..802d226c9c0a 100644
--- a/maven-slf4j-provider/pom.xml
+++ b/maven-slf4j-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.2
+ 3.8.3-SNAPSHOTmaven-slf4j-provider
diff --git a/pom.xml b/pom.xml
index 1875b9f65b72..05b80b2db065 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven
- 3.8.2
+ 3.8.3-SNAPSHOTpomApache Maven
@@ -77,7 +77,7 @@ under the License.
ref/3-LATESTNone**/package-info.java
- 2021-08-04T18:57:55Z
+ 2021-08-04T19:03:41Z
From 9adb3aedf21ca9a49560957e0e1b9125266bb401 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Fri, 13 Aug 2021 21:59:19 +0200
Subject: [PATCH 073/183] Document Maven 3.8.1 and 3.8.2 releases
---
doap_Maven.rdf | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/doap_Maven.rdf b/doap_Maven.rdf
index 45b4e4bef3e4..0417fff803ea 100644
--- a/doap_Maven.rdf
+++ b/doap_Maven.rdf
@@ -33,6 +33,24 @@ under the License.
Latest stable release
+ 2021-08-04
+ 3.8.2
+ http://archive.apache.org/dist/maven/maven-3/3.8.2/binaries/apache-maven-3.8.2-bin.zip
+ http://archive.apache.org/dist/maven/maven-3/3.8.2/binaries/apache-maven-3.8.2-bin.tar.gz
+ http://archive.apache.org/dist/maven/maven-3/3.8.2/source/apache-maven-3.8.2-src.zip
+ http://archive.apache.org/dist/maven/maven-3/3.8.2/source/apache-maven-3.8.2-src.tar.gz
+
+
+ Latest stable release
+ 2021-04-04
+ 3.8.1
+ http://archive.apache.org/dist/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.zip
+ http://archive.apache.org/dist/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.tar.gz
+ http://archive.apache.org/dist/maven/maven-3/3.8.1/source/apache-maven-3.8.1-src.zip
+ http://archive.apache.org/dist/maven/maven-3/3.8.1/source/apache-maven-3.8.1-src.tar.gz
+
+
+ Apache Maven 3.6.22019-08-273.6.2http://archive.apache.org/dist/maven/maven-3/3.6.2/binaries/apache-maven-3.6.2-bin.zip
From 4dc115967a9ac1522fe01d33de1a3279d52a559a Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sat, 14 Aug 2021 10:27:09 +0200
Subject: [PATCH 074/183] Fix DOAP
---
doap_Maven.rdf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doap_Maven.rdf b/doap_Maven.rdf
index 0417fff803ea..531df1217a61 100644
--- a/doap_Maven.rdf
+++ b/doap_Maven.rdf
@@ -41,7 +41,7 @@ under the License.
http://archive.apache.org/dist/maven/maven-3/3.8.2/source/apache-maven-3.8.2-src.tar.gz
- Latest stable release
+ Apache Maven 3.8.12021-04-043.8.1http://archive.apache.org/dist/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.zip
From 547dfddb2ef02f44d9f2d0730348eaedfcd2e126 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Wed, 22 Jan 2020 09:25:24 +0100
Subject: [PATCH 075/183] Improve license handling
* Stream line the output of the license listing
* Exclude jsoup from final distribution since we only need its license information
* Use proper SPDX ID for our license
This closes #317
---
apache-maven/pom.xml | 6 +++---
.../appended-resources/META-INF/LICENSE.vm | 19 +++++++++++--------
.../licenses/{ASL-2.0.txt => Apache-2.0.txt} | 0
apache-maven/src/main/assembly/component.xml | 1 +
4 files changed, 15 insertions(+), 11 deletions(-)
rename apache-maven/src/main/appended-resources/licenses/{ASL-2.0.txt => Apache-2.0.txt} (100%)
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index 2cc6ca31d533..a4cf0396c61b 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -79,10 +79,10 @@ under the License.
+
-
org.jsoupjsoupruntime
diff --git a/apache-maven/src/main/appended-resources/META-INF/LICENSE.vm b/apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
index 25ac46f3770f..43357d142ef0 100644
--- a/apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
+++ b/apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
@@ -18,21 +18,21 @@
##
-Apache Maven includes a number of components and libraries with separate
-copyright notices and license terms. Your use of those components are
-subject to the terms and conditions of the following licenses:
+Apache Maven includes a number of components and libraries with separate
+copyright notices and license terms. Your use of those components are
+subject to the terms and conditions of the following licenses:
##
#set ( $apacheMavenGroupIds = [ "org.apache.maven", "org.apache.maven.wagon", "org.apache.maven.resolver",
"org.apache.maven.shared" ] )
#set ( $MITLicenseNames = [ "MIT License", "MIT license", "The MIT License" ] )
#foreach ( $project in $projects )
-#**##foreach ( $license in $project.licenses)
+#**##foreach ( $license in $project.licenses )
#* *##set ( $groupId = $project.artifact.groupId )
#* *##set ( $directory = 'lib' )
#* *##if ( !$apacheMavenGroupIds.contains( $groupId ) )
#* *### advertise about each non-Maven dependency
#* *###
-#* *### infer SPDX license code
+#* *### infer SPDX license id
#* *##if ( $license.name == "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0" )
#* *##set ( $spdx = 'CDDL-1.0' )
#* *##elseif ( $MITLicenseNames.contains( $license.name ) )
@@ -40,7 +40,7 @@ subject to the terms and conditions of the following licenses:
#* *##elseif ( $license.name == "Eclipse Public License, Version 1.0" )
#* *##set ( $spdx = 'EPL-1.0' )
#* *##elseif ( $license.url.contains( "www.apache.org/licenses/LICENSE-2.0" ) )
-#* *##set ( $spdx = 'ASL-2.0' )
+#* *##set ( $spdx = 'Apache-2.0' )
#* *##else
#* *### unrecognized license will require analysis to know obligations
#* *##set ( $spdx = 'unrecognized' )
@@ -68,13 +68,16 @@ subject to the terms and conditions of the following licenses:
#* *##else
#* *##set ( $downloaded = $locator.getResourceAsFile( "licenses/${spdx}.txt", "licenses/${licFile}" ) )
#* *##end
+
#* *### add dependency info to output
- $directory/${project.artifact.artifactId}-${project.artifact.version}.jar: $project.artifact.toString().replace( ':eclipse-plugin:', ':jar:' )
- $project.name
+ Project: $project.name
#if ( $project.url )Project URL: ${project.url}#end
- License: $license.name#if ( $spdx ) ($spdx)#end $license.url ($licFile)
+ License: $license.name#if ( $spdx ) ($spdx)#end
+
+ License URL: $license.url ($licFile)
#* *##end
#**##end
diff --git a/apache-maven/src/main/appended-resources/licenses/ASL-2.0.txt b/apache-maven/src/main/appended-resources/licenses/Apache-2.0.txt
similarity index 100%
rename from apache-maven/src/main/appended-resources/licenses/ASL-2.0.txt
rename to apache-maven/src/main/appended-resources/licenses/Apache-2.0.txt
diff --git a/apache-maven/src/main/assembly/component.xml b/apache-maven/src/main/assembly/component.xml
index 4f9ff1662854..657d06bf026b 100644
--- a/apache-maven/src/main/assembly/component.xml
+++ b/apache-maven/src/main/assembly/component.xml
@@ -31,6 +31,7 @@ under the License.
liborg.codehaus.plexus:plexus-classworlds
+ org.jsoup:jsoup
From 0c3fe074bbd3272a7b46c28683c6ed50d0daede7 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Mon, 9 Dec 2019 19:43:44 +0100
Subject: [PATCH 076/183] [MNG-6818] - Upgrade plexus-utils 3.3.0
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 05b80b2db065..82128161c01c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,7 +56,7 @@ under the License.
2.21.02.1.01.25
- 3.2.1
+ 3.3.04.2.20.3.43.4.3
From ccafe8bf46ad874ca0cfba6ea5961b34f1630f82 Mon Sep 17 00:00:00 2001
From: "artem.krosheninnikov"
Date: Sun, 5 Jan 2020 22:24:21 +0300
Subject: [PATCH 077/183] [MNG-6841] update plexus-interpolation to 1.26
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 82128161c01c..4a4f69ba3f0a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,7 +55,7 @@ under the License.
4.122.21.02.1.0
- 1.25
+ 1.263.3.04.2.20.3.4
From c76c9d9116b4626c20abe26c025623797249f997 Mon Sep 17 00:00:00 2001
From: Tamas Cservenak
Date: Fri, 10 Sep 2021 14:33:45 +0200
Subject: [PATCH 078/183] [MNG-7246] Upgrade Plexus Cipher and Sec Dispatcher
to 2.0
Both plexus-cipher and plexus-sec-dispatcher have had a
groupId change, but plexus-cipher change was implemented
for 1.8 version.
Latest versions of artifacts are 2.0. This PR
ups plexus-cipher version and adds proper changes
for plexus-sec-dispatcher groupId change.
This closes #534
---
.../project-with-inheritance/pom.xml | 2 +-
.../project-with-inheritance/pom.xml | 2 +-
.../org/apache/maven/lifecycle/pom.xml | 2 +-
maven-embedder/pom.xml | 2 +-
maven-settings-builder/pom.xml | 2 +-
pom.xml | 17 ++++++-----------
6 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/maven-core/src/test/projects/lifecycle-executor/project-with-inheritance/pom.xml b/maven-core/src/test/projects/lifecycle-executor/project-with-inheritance/pom.xml
index c9a894d9059b..7d0850e48382 100644
--- a/maven-core/src/test/projects/lifecycle-executor/project-with-inheritance/pom.xml
+++ b/maven-core/src/test/projects/lifecycle-executor/project-with-inheritance/pom.xml
@@ -473,7 +473,7 @@ under the License.
${mercuryMp3Version}
- org.sonatype.plexus
+ org.codehaus.plexusplexus-sec-dispatcher${securityDispatcherVersion}
diff --git a/maven-core/src/test/projects/plugin-manager/project-with-inheritance/pom.xml b/maven-core/src/test/projects/plugin-manager/project-with-inheritance/pom.xml
index c9a894d9059b..7d0850e48382 100644
--- a/maven-core/src/test/projects/plugin-manager/project-with-inheritance/pom.xml
+++ b/maven-core/src/test/projects/plugin-manager/project-with-inheritance/pom.xml
@@ -473,7 +473,7 @@ under the License.
${mercuryMp3Version}
- org.sonatype.plexus
+ org.codehaus.plexusplexus-sec-dispatcher${securityDispatcherVersion}
diff --git a/maven-core/src/test/resources/org/apache/maven/lifecycle/pom.xml b/maven-core/src/test/resources/org/apache/maven/lifecycle/pom.xml
index 531e5510c5a7..5caaac1ba285 100644
--- a/maven-core/src/test/resources/org/apache/maven/lifecycle/pom.xml
+++ b/maven-core/src/test/resources/org/apache/maven/lifecycle/pom.xml
@@ -473,7 +473,7 @@ under the License.
${mercuryMp3Version}
- org.sonatype.plexus
+ org.codehaus.plexusplexus-sec-dispatcher${securityDispatcherVersion}
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index e0b647902053..fc90bbc13493 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -131,7 +131,7 @@ under the License.
org.eclipse.sisu.plexus
- org.sonatype.plexus
+ org.codehaus.plexusplexus-sec-dispatcher
diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml
index a85c8a8c1191..dd0c09bb9ce8 100644
--- a/maven-settings-builder/pom.xml
+++ b/maven-settings-builder/pom.xml
@@ -62,7 +62,7 @@ under the License.
maven-settings
- org.sonatype.plexus
+ org.codehaus.plexusplexus-sec-dispatcher
diff --git a/pom.xml b/pom.xml
index 4a4f69ba3f0a..40a7ee81ade0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,8 +61,8 @@ under the License.
0.3.43.4.31.12.1
- 1.4
- 1.8
+ 2.0
+ 2.01.111.31.6.3
@@ -402,15 +402,9 @@ under the License.
${commonsLangVersion}
- org.sonatype.plexus
+ org.codehaus.plexusplexus-sec-dispatcher${securityDispatcherVersion}
-
-
- org.sonatype.plexus
- plexus-cipher
-
- org.codehaus.plexus
@@ -641,15 +635,16 @@ under the License.
enforcevalidate
- ensure-no-org.sonatype:plexus-cipher
+ ensure-no-sonatype-cipher-and-sec-dispatcher
+ org.sonatype.plexus:plexus-sec-dispatcherorg.sonatype.plexus:plexus-cipher
- ensure no more org.sonatype.plexus:plexus-cipher as groupId changed. you have to add some exclusions.
+ ensure no more org.sonatype.plexus:plexus-cipher and org.sonatype.plexus:plexus-sec-dispatcher.
From 383cabf9e4992eeff36c9b5731d95bafa72398d3 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Mon, 16 Aug 2021 18:08:39 +0200
Subject: [PATCH 079/183] [MNG-7216] [Regression] Revert MNG-7170
This reverts commit 5a8997312680a4b9c69a129801524691bc546c08.
This closes #524
---
.../maven/project/ProjectBuilderTest.java | 26 -------------------
.../projects/modelsourcebasedir/pom.xml | 19 --------------
.../model/building/DefaultModelBuilder.java | 9 +------
3 files changed, 1 insertion(+), 53 deletions(-)
delete mode 100644 maven-core/src/test/resources/projects/modelsourcebasedir/pom.xml
diff --git a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
index 37d51cd49d00..6adb10e8f4e2 100644
--- a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
@@ -39,8 +39,6 @@
import org.apache.maven.model.Plugin;
import org.apache.maven.model.building.FileModelSource;
import org.apache.maven.model.building.ModelBuildingRequest;
-import org.apache.maven.model.building.ModelProblem;
-import org.apache.maven.model.building.ModelProblem.Severity;
import org.apache.maven.model.building.ModelSource;
import org.apache.maven.shared.utils.io.FileUtils;
@@ -85,30 +83,6 @@ public void testBuildFromModelSource()
assertNotNull( result.getProject().getParentFile() );
}
- public void testBuildFromModelSourceResolvesBasedir()
- throws Exception
- {
- File pomFile = new File( "src/test/resources/projects/modelsourcebasedir/pom.xml" );
- MavenSession mavenSession = createMavenSession( null );
- ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
- configuration.setRepositorySession( mavenSession.getRepositorySession() );
- ModelSource modelSource = new FileModelSource( pomFile );
- ProjectBuildingResult result =
- getContainer().lookup( org.apache.maven.project.ProjectBuilder.class ).build( modelSource, configuration );
-
- assertEquals( pomFile.getAbsoluteFile(), result.getProject().getModel().getPomFile().getAbsoluteFile() );
- int errors = 0;
- for ( ModelProblem p : result.getProblems() )
- {
- if ( p.getSeverity() == Severity.ERROR )
- {
- errors++;
- }
- }
- assertEquals( 0, errors );
- }
-
-
public void testVersionlessManagedDependency()
throws Exception
{
diff --git a/maven-core/src/test/resources/projects/modelsourcebasedir/pom.xml b/maven-core/src/test/resources/projects/modelsourcebasedir/pom.xml
deleted file mode 100644
index ec0f7d385a9b..000000000000
--- a/maven-core/src/test/resources/projects/modelsourcebasedir/pom.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
- 4.0.0
- test.readparent
- local-parent
- pom
- 1.0
-
-
-
- blah
- blah
- 0.0.1-SNASPSHOT
- system
- ${basedir}/blah.jar
-
-
-
-
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
index a089f9d991df..70c9ed529cd2 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
@@ -624,14 +624,7 @@ private Model readModel( ModelSource modelSource, File pomFile, ModelBuildingReq
throw problems.newModelBuildingException();
}
- if ( pomFile != null )
- {
- model.setPomFile( pomFile );
- }
- else if ( modelSource instanceof FileModelSource )
- {
- model.setPomFile( ( (FileModelSource) modelSource ).getFile() );
- }
+ model.setPomFile( pomFile );
problems.setSource( model );
modelValidator.validateRawModel( model, request, problems );
From e08834b79e9387811ece442f6e7b445b19110fcf Mon Sep 17 00:00:00 2001
From: Tamas Cservenak
Date: Mon, 13 Sep 2021 17:56:54 +0200
Subject: [PATCH 080/183] [MNG-7250] Upgrade Sisu Inject/Plexus to 0.3.5
Since we have replaced the old JSR 250 library with javax.annotation library we
go straight to 1.2.
This closes #539
---
.../appended-resources/META-INF/LICENSE.vm | 6 +-
.../appended-resources/META-INF/NOTICE.vm | 2 +-
.../appended-resources/licenses/CDDL-1.0.txt | 384 ---------
.../unrecognized-javax.annotation-api-1.2.txt | 759 ++++++++++++++++++
.../resources/META-INF/maven/extension.xml | 2 +-
maven-embedder/pom.xml | 2 +-
pom.xml | 16 +-
7 files changed, 772 insertions(+), 399 deletions(-)
delete mode 100644 apache-maven/src/main/appended-resources/licenses/CDDL-1.0.txt
create mode 100644 apache-maven/src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.2.txt
diff --git a/apache-maven/src/main/appended-resources/META-INF/LICENSE.vm b/apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
index 43357d142ef0..b589e36e0222 100644
--- a/apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
+++ b/apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
@@ -33,9 +33,7 @@ subject to the terms and conditions of the following licenses:
#* *### advertise about each non-Maven dependency
#* *###
#* *### infer SPDX license id
-#* *##if ( $license.name == "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0" )
-#* *##set ( $spdx = 'CDDL-1.0' )
-#* *##elseif ( $MITLicenseNames.contains( $license.name ) )
+#* *##if ( $MITLicenseNames.contains( $license.name ) )
#* *##set ( $spdx = 'MIT' )
#* *##elseif ( $license.name == "Eclipse Public License, Version 1.0" )
#* *##set ( $spdx = 'EPL-1.0' )
@@ -62,7 +60,7 @@ subject to the terms and conditions of the following licenses:
#* *###
#* *### copy license file to lib/$artifactId.license
#* *##set ( $licFile = $directory + '/' + $project.artifact.artifactId + '.license' )
-#* *##if ( $spdx == "MIT" )
+#* *##if ( $spdx == "MIT" || $spdx == "unrecognized" )
#* *### MIT license contains date and copyright that makes the file specific to each artifact
#* *##set ( $downloaded = $locator.getResourceAsFile( "licenses/${spdx}-${project.artifact.artifactId}-${project.artifact.version}.txt", "licenses/${licFile}" ) )
#* *##else
diff --git a/apache-maven/src/main/appended-resources/META-INF/NOTICE.vm b/apache-maven/src/main/appended-resources/META-INF/NOTICE.vm
index acf7ba42e070..3cfd92583cd2 100644
--- a/apache-maven/src/main/appended-resources/META-INF/NOTICE.vm
+++ b/apache-maven/src/main/appended-resources/META-INF/NOTICE.vm
@@ -36,7 +36,7 @@ javolution (http://javolution.org/).
This product includes software developed by
Rome (https://rome.dev.java.net/).
-about.html in archive lib/org.eclipse.sisu.inject-0.3.4.jar
+about.html in archive lib/org.eclipse.sisu.inject-0.3.5.jar
diff --git a/apache-maven/src/main/appended-resources/licenses/CDDL-1.0.txt b/apache-maven/src/main/appended-resources/licenses/CDDL-1.0.txt
deleted file mode 100644
index 9bc6342e22c9..000000000000
--- a/apache-maven/src/main/appended-resources/licenses/CDDL-1.0.txt
+++ /dev/null
@@ -1,384 +0,0 @@
-COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
-
-
- 1. Definitions.
-
- 1.1. "Contributor" means each individual or entity that
- creates or contributes to the creation of Modifications.
-
- 1.2. "Contributor Version" means the combination of the
- Original Software, prior Modifications used by a
- Contributor (if any), and the Modifications made by that
- particular Contributor.
-
- 1.3. "Covered Software" means (a) the Original Software, or
- (b) Modifications, or (c) the combination of files
- containing Original Software with files containing
- Modifications, in each case including portions thereof.
-
- 1.4. "Executable" means the Covered Software in any form
- other than Source Code.
-
- 1.5. "Initial Developer" means the individual or entity
- that first makes Original Software available under this
- License.
-
- 1.6. "Larger Work" means a work which combines Covered
- Software or portions thereof with code not governed by the
- terms of this License.
-
- 1.7. "License" means this document.
-
- 1.8. "Licensable" means having the right to grant, to the
- maximum extent possible, whether at the time of the initial
- grant or subsequently acquired, any and all of the rights
- conveyed herein.
-
- 1.9. "Modifications" means the Source Code and Executable
- form of any of the following:
-
- A. Any file that results from an addition to,
- deletion from or modification of the contents of a
- file containing Original Software or previous
- Modifications;
-
- B. Any new file that contains any part of the
- Original Software or previous Modification; or
-
- C. Any new file that is contributed or otherwise made
- available under the terms of this License.
-
- 1.10. "Original Software" means the Source Code and
- Executable form of computer software code that is
- originally released under this License.
-
- 1.11. "Patent Claims" means any patent claim(s), now owned
- or hereafter acquired, including without limitation,
- method, process, and apparatus claims, in any patent
- Licensable by grantor.
-
- 1.12. "Source Code" means (a) the common form of computer
- software code in which modifications are made and (b)
- associated documentation included in or with such code.
-
- 1.13. "You" (or "Your") means an individual or a legal
- entity exercising rights under, and complying with all of
- the terms of, this License. For legal entities, "You"
- includes any entity which controls, is controlled by, or is
- under common control with You. For purposes of this
- definition, "control" means (a) the power, direct or
- indirect, to cause the direction or management of such
- entity, whether by contract or otherwise, or (b) ownership
- of more than fifty percent (50%) of the outstanding shares
- or beneficial ownership of such entity.
-
- 2. License Grants.
-
- 2.1. The Initial Developer Grant.
-
- Conditioned upon Your compliance with Section 3.1 below and
- subject to third party intellectual property claims, the
- Initial Developer hereby grants You a world-wide,
- royalty-free, non-exclusive license:
-
- (a) under intellectual property rights (other than
- patent or trademark) Licensable by Initial Developer,
- to use, reproduce, modify, display, perform,
- sublicense and distribute the Original Software (or
- portions thereof), with or without Modifications,
- and/or as part of a Larger Work; and
-
- (b) under Patent Claims infringed by the making,
- using or selling of Original Software, to make, have
- made, use, practice, sell, and offer for sale, and/or
- otherwise dispose of the Original Software (or
- portions thereof).
-
- (c) The licenses granted in Sections 2.1(a) and (b)
- are effective on the date Initial Developer first
- distributes or otherwise makes the Original Software
- available to a third party under the terms of this
- License.
-
- (d) Notwithstanding Section 2.1(b) above, no patent
- license is granted: (1) for code that You delete from
- the Original Software, or (2) for infringements
- caused by: (i) the modification of the Original
- Software, or (ii) the combination of the Original
- Software with other software or devices.
-
- 2.2. Contributor Grant.
-
- Conditioned upon Your compliance with Section 3.1 below and
- subject to third party intellectual property claims, each
- Contributor hereby grants You a world-wide, royalty-free,
- non-exclusive license:
-
- (a) under intellectual property rights (other than
- patent or trademark) Licensable by Contributor to
- use, reproduce, modify, display, perform, sublicense
- and distribute the Modifications created by such
- Contributor (or portions thereof), either on an
- unmodified basis, with other Modifications, as
- Covered Software and/or as part of a Larger Work; and
-
-
- (b) under Patent Claims infringed by the making,
- using, or selling of Modifications made by that
- Contributor either alone and/or in combination with
- its Contributor Version (or portions of such
- combination), to make, use, sell, offer for sale,
- have made, and/or otherwise dispose of: (1)
- Modifications made by that Contributor (or portions
- thereof); and (2) the combination of Modifications
- made by that Contributor with its Contributor Version
- (or portions of such combination).
-
- (c) The licenses granted in Sections 2.2(a) and
- 2.2(b) are effective on the date Contributor first
- distributes or otherwise makes the Modifications
- available to a third party.
-
- (d) Notwithstanding Section 2.2(b) above, no patent
- license is granted: (1) for any code that Contributor
- has deleted from the Contributor Version; (2) for
- infringements caused by: (i) third party
- modifications of Contributor Version, or (ii) the
- combination of Modifications made by that Contributor
- with other software (except as part of the
- Contributor Version) or other devices; or (3) under
- Patent Claims infringed by Covered Software in the
- absence of Modifications made by that Contributor.
-
- 3. Distribution Obligations.
-
- 3.1. Availability of Source Code.
-
- Any Covered Software that You distribute or otherwise make
- available in Executable form must also be made available in
- Source Code form and that Source Code form must be
- distributed only under the terms of this License. You must
- include a copy of this License with every copy of the
- Source Code form of the Covered Software You distribute or
- otherwise make available. You must inform recipients of any
- such Covered Software in Executable form as to how they can
- obtain such Covered Software in Source Code form in a
- reasonable manner on or through a medium customarily used
- for software exchange.
-
- 3.2. Modifications.
-
- The Modifications that You create or to which You
- contribute are governed by the terms of this License. You
- represent that You believe Your Modifications are Your
- original creation(s) and/or You have sufficient rights to
- grant the rights conveyed by this License.
-
- 3.3. Required Notices.
-
- You must include a notice in each of Your Modifications
- that identifies You as the Contributor of the Modification.
- You may not remove or alter any copyright, patent or
- trademark notices contained within the Covered Software, or
- any notices of licensing or any descriptive text giving
- attribution to any Contributor or the Initial Developer.
-
- 3.4. Application of Additional Terms.
-
- You may not offer or impose any terms on any Covered
- Software in Source Code form that alters or restricts the
- applicable version of this License or the recipients"
- rights hereunder. You may choose to offer, and to charge a
- fee for, warranty, support, indemnity or liability
- obligations to one or more recipients of Covered Software.
- However, you may do so only on Your own behalf, and not on
- behalf of the Initial Developer or any Contributor. You
- must make it absolutely clear that any such warranty,
- support, indemnity or liability obligation is offered by
- You alone, and You hereby agree to indemnify the Initial
- Developer and every Contributor for any liability incurred
- by the Initial Developer or such Contributor as a result of
- warranty, support, indemnity or liability terms You offer.
-
-
- 3.5. Distribution of Executable Versions.
-
- You may distribute the Executable form of the Covered
- Software under the terms of this License or under the terms
- of a license of Your choice, which may contain terms
- different from this License, provided that You are in
- compliance with the terms of this License and that the
- license for the Executable form does not attempt to limit
- or alter the recipient"s rights in the Source Code form
- from the rights set forth in this License. If You
- distribute the Covered Software in Executable form under a
- different license, You must make it absolutely clear that
- any terms which differ from this License are offered by You
- alone, not by the Initial Developer or Contributor. You
- hereby agree to indemnify the Initial Developer and every
- Contributor for any liability incurred by the Initial
- Developer or such Contributor as a result of any such terms
- You offer.
-
- 3.6. Larger Works.
-
- You may create a Larger Work by combining Covered Software
- with other code not governed by the terms of this License
- and distribute the Larger Work as a single product. In such
- a case, You must make sure the requirements of this License
- are fulfilled for the Covered Software.
-
- 4. Versions of the License.
-
- 4.1. New Versions.
-
- Sun Microsystems, Inc. is the initial license steward and
- may publish revised and/or new versions of this License
- from time to time. Each version will be given a
- distinguishing version number. Except as provided in
- Section 4.3, no one other than the license steward has the
- right to modify this License.
-
- 4.2. Effect of New Versions.
-
- You may always continue to use, distribute or otherwise
- make the Covered Software available under the terms of the
- version of the License under which You originally received
- the Covered Software. If the Initial Developer includes a
- notice in the Original Software prohibiting it from being
- distributed or otherwise made available under any
- subsequent version of the License, You must distribute and
- make the Covered Software available under the terms of the
- version of the License under which You originally received
- the Covered Software. Otherwise, You may also choose to
- use, distribute or otherwise make the Covered Software
- available under the terms of any subsequent version of the
- License published by the license steward.
-
- 4.3. Modified Versions.
-
- When You are an Initial Developer and You want to create a
- new license for Your Original Software, You may create and
- use a modified version of this License if You: (a) rename
- the license and remove any references to the name of the
- license steward (except to note that the license differs
- from this License); and (b) otherwise make it clear that
- the license contains terms which differ from this License.
-
-
- 5. DISCLAIMER OF WARRANTY.
-
- COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS"
- BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
- INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED
- SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR
- PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND
- PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY
- COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
- INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF
- ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
- WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
- ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
- DISCLAIMER.
-
- 6. TERMINATION.
-
- 6.1. This License and the rights granted hereunder will
- terminate automatically if You fail to comply with terms
- herein and fail to cure such breach within 30 days of
- becoming aware of the breach. Provisions which, by their
- nature, must remain in effect beyond the termination of
- this License shall survive.
-
- 6.2. If You assert a patent infringement claim (excluding
- declaratory judgment actions) against Initial Developer or
- a Contributor (the Initial Developer or Contributor against
- whom You assert such claim is referred to as "Participant")
- alleging that the Participant Software (meaning the
- Contributor Version where the Participant is a Contributor
- or the Original Software where the Participant is the
- Initial Developer) directly or indirectly infringes any
- patent, then any and all rights granted directly or
- indirectly to You by such Participant, the Initial
- Developer (if the Initial Developer is not the Participant)
- and all Contributors under Sections 2.1 and/or 2.2 of this
- License shall, upon 60 days notice from Participant
- terminate prospectively and automatically at the expiration
- of such 60 day notice period, unless if within such 60 day
- period You withdraw Your claim with respect to the
- Participant Software against such Participant either
- unilaterally or pursuant to a written agreement with
- Participant.
-
- 6.3. In the event of termination under Sections 6.1 or 6.2
- above, all end user licenses that have been validly granted
- by You or any distributor hereunder prior to termination
- (excluding licenses granted to You by any distributor)
- shall survive termination.
-
- 7. LIMITATION OF LIABILITY.
-
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
- (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE
- INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
- COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE
- LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
- CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
- LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK
- STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
- INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
- LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL
- INJURY RESULTING FROM SUCH PARTY"S NEGLIGENCE TO THE EXTENT
- APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO
- NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
- CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT
- APPLY TO YOU.
-
- 8. U.S. GOVERNMENT END USERS.
-
- The Covered Software is a "commercial item," as that term is
- defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial
- computer software" (as that term is defined at 48 C.F.R. "
- 252.227-7014(a)(1)) and "commercial computer software
- documentation" as such terms are used in 48 C.F.R. 12.212 (Sept.
- 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1
- through 227.7202-4 (June 1995), all U.S. Government End Users
- acquire Covered Software with only those rights set forth herein.
- This U.S. Government Rights clause is in lieu of, and supersedes,
- any other FAR, DFAR, or other clause or provision that addresses
- Government rights in computer software under this License.
-
- 9. MISCELLANEOUS.
-
- This License represents the complete agreement concerning subject
- matter hereof. If any provision of this License is held to be
- unenforceable, such provision shall be reformed only to the
- extent necessary to make it enforceable. This License shall be
- governed by the law of the jurisdiction specified in a notice
- contained within the Original Software (except to the extent
- applicable law, if any, provides otherwise), excluding such
- jurisdiction"s conflict-of-law provisions. Any litigation
- relating to this License shall be subject to the jurisdiction of
- the courts located in the jurisdiction and venue specified in a
- notice contained within the Original Software, with the losing
- party responsible for costs, including, without limitation, court
- costs and reasonable attorneys" fees and expenses. The
- application of the United Nations Convention on Contracts for the
- International Sale of Goods is expressly excluded. Any law or
- regulation which provides that the language of a contract shall
- be construed against the drafter shall not apply to this License.
- You agree that You alone are responsible for compliance with the
- United States export administration regulations (and the export
- control laws and regulation of any other countries) when You use,
- distribute or otherwise make available any Covered Software.
-
- 10. RESPONSIBILITY FOR CLAIMS.
-
- As between Initial Developer and the Contributors, each party is
- responsible for claims and damages arising, directly or
- indirectly, out of its utilization of rights under this License
- and You agree to work with Initial Developer and Contributors to
- distribute such responsibility on an equitable basis. Nothing
- herein is intended or shall be deemed to constitute any admission
- of liability.
diff --git a/apache-maven/src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.2.txt b/apache-maven/src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.2.txt
new file mode 100644
index 000000000000..b1c74f95ede8
--- /dev/null
+++ b/apache-maven/src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.2.txt
@@ -0,0 +1,759 @@
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1
+
+1. Definitions.
+
+ 1.1. "Contributor" means each individual or entity that creates or
+ contributes to the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original
+ Software, prior Modifications used by a Contributor (if any), and
+ the Modifications made by that particular Contributor.
+
+ 1.3. "Covered Software" means (a) the Original Software, or (b)
+ Modifications, or (c) the combination of files containing Original
+ Software with files containing Modifications, in each case including
+ portions thereof.
+
+ 1.4. "Executable" means the Covered Software in any form other than
+ Source Code.
+
+ 1.5. "Initial Developer" means the individual or entity that first
+ makes Original Software available under this License.
+
+ 1.6. "Larger Work" means a work which combines Covered Software or
+ portions thereof with code not governed by the terms of this License.
+
+ 1.7. "License" means this document.
+
+ 1.8. "Licensable" means having the right to grant, to the maximum
+ extent possible, whether at the time of the initial grant or
+ subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means the Source Code and Executable form of
+ any of the following:
+
+ A. Any file that results from an addition to, deletion from or
+ modification of the contents of a file containing Original Software
+ or previous Modifications;
+
+ B. Any new file that contains any part of the Original Software or
+ previous Modification; or
+
+ C. Any new file that is contributed or otherwise made available
+ under the terms of this License.
+
+ 1.10. "Original Software" means the Source Code and Executable form
+ of computer software code that is originally released under this
+ License.
+
+ 1.11. "Patent Claims" means any patent claim(s), now owned or
+ hereafter acquired, including without limitation, method, process,
+ and apparatus claims, in any patent Licensable by grantor.
+
+ 1.12. "Source Code" means (a) the common form of computer software
+ code in which modifications are made and (b) associated
+ documentation included in or with such code.
+
+ 1.13. "You" (or "Your") means an individual or a legal entity
+ exercising rights under, and complying with all of the terms of,
+ this License. For legal entities, "You" includes any entity which
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, "control" means (a) the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or (b) ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+2. License Grants.
+
+ 2.1. The Initial Developer Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and subject
+ to third party intellectual property claims, the Initial Developer
+ hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Initial Developer, to use, reproduce,
+ modify, display, perform, sublicense and distribute the Original
+ Software (or portions thereof), with or without Modifications,
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using or selling of
+ Original Software, to make, have made, use, practice, sell, and
+ offer for sale, and/or otherwise dispose of the Original Software
+ (or portions thereof).
+
+ (c) The licenses granted in Sections 2.1(a) and (b) are effective on
+ the date Initial Developer first distributes or otherwise makes the
+ Original Software available to a third party under the terms of this
+ License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is
+ granted: (1) for code that You delete from the Original Software, or
+ (2) for infringements caused by: (i) the modification of the
+ Original Software, or (ii) the combination of the Original Software
+ with other software or devices.
+
+ 2.2. Contributor Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and subject
+ to third party intellectual property claims, each Contributor hereby
+ grants You a world-wide, royalty-free, non-exclusive license:
+
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Contributor to use, reproduce, modify,
+ display, perform, sublicense and distribute the Modifications
+ created by such Contributor (or portions thereof), either on an
+ unmodified basis, with other Modifications, as Covered Software
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or selling
+ of Modifications made by that Contributor either alone and/or in
+ combination with its Contributor Version (or portions of such
+ combination), to make, use, sell, offer for sale, have made, and/or
+ otherwise dispose of: (1) Modifications made by that Contributor (or
+ portions thereof); and (2) the combination of Modifications made by
+ that Contributor with its Contributor Version (or portions of such
+ combination).
+
+ (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+ on the date Contributor first distributes or otherwise makes the
+ Modifications available to a third party.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is
+ granted: (1) for any code that Contributor has deleted from the
+ Contributor Version; (2) for infringements caused by: (i) third
+ party modifications of Contributor Version, or (ii) the combination
+ of Modifications made by that Contributor with other software
+ (except as part of the Contributor Version) or other devices; or (3)
+ under Patent Claims infringed by Covered Software in the absence of
+ Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Availability of Source Code.
+
+ Any Covered Software that You distribute or otherwise make available
+ in Executable form must also be made available in Source Code form
+ and that Source Code form must be distributed only under the terms
+ of this License. You must include a copy of this License with every
+ copy of the Source Code form of the Covered Software You distribute
+ or otherwise make available. You must inform recipients of any such
+ Covered Software in Executable form as to how they can obtain such
+ Covered Software in Source Code form in a reasonable manner on or
+ through a medium customarily used for software exchange.
+
+ 3.2. Modifications.
+
+ The Modifications that You create or to which You contribute are
+ governed by the terms of this License. You represent that You
+ believe Your Modifications are Your original creation(s) and/or You
+ have sufficient rights to grant the rights conveyed by this License.
+
+ 3.3. Required Notices.
+
+ You must include a notice in each of Your Modifications that
+ identifies You as the Contributor of the Modification. You may not
+ remove or alter any copyright, patent or trademark notices contained
+ within the Covered Software, or any notices of licensing or any
+ descriptive text giving attribution to any Contributor or the
+ Initial Developer.
+
+ 3.4. Application of Additional Terms.
+
+ You may not offer or impose any terms on any Covered Software in
+ Source Code form that alters or restricts the applicable version of
+ this License or the recipients' rights hereunder. You may choose to
+ offer, and to charge a fee for, warranty, support, indemnity or
+ liability obligations to one or more recipients of Covered Software.
+ However, you may do so only on Your own behalf, and not on behalf of
+ the Initial Developer or any Contributor. You must make it
+ absolutely clear that any such warranty, support, indemnity or
+ liability obligation is offered by You alone, and You hereby agree
+ to indemnify the Initial Developer and every Contributor for any
+ liability incurred by the Initial Developer or such Contributor as a
+ result of warranty, support, indemnity or liability terms You offer.
+
+ 3.5. Distribution of Executable Versions.
+
+ You may distribute the Executable form of the Covered Software under
+ the terms of this License or under the terms of a license of Your
+ choice, which may contain terms different from this License,
+ provided that You are in compliance with the terms of this License
+ and that the license for the Executable form does not attempt to
+ limit or alter the recipient's rights in the Source Code form from
+ the rights set forth in this License. If You distribute the Covered
+ Software in Executable form under a different license, You must make
+ it absolutely clear that any terms which differ from this License
+ are offered by You alone, not by the Initial Developer or
+ Contributor. You hereby agree to indemnify the Initial Developer and
+ every Contributor for any liability incurred by the Initial
+ Developer or such Contributor as a result of any such terms You offer.
+
+ 3.6. Larger Works.
+
+ You may create a Larger Work by combining Covered Software with
+ other code not governed by the terms of this License and distribute
+ the Larger Work as a single product. In such a case, You must make
+ sure the requirements of this License are fulfilled for the Covered
+ Software.
+
+4. Versions of the License.
+
+ 4.1. New Versions.
+
+ Oracle is the initial license steward and may publish revised and/or
+ new versions of this License from time to time. Each version will be
+ given a distinguishing version number. Except as provided in Section
+ 4.3, no one other than the license steward has the right to modify
+ this License.
+
+ 4.2. Effect of New Versions.
+
+ You may always continue to use, distribute or otherwise make the
+ Covered Software available under the terms of the version of the
+ License under which You originally received the Covered Software. If
+ the Initial Developer includes a notice in the Original Software
+ prohibiting it from being distributed or otherwise made available
+ under any subsequent version of the License, You must distribute and
+ make the Covered Software available under the terms of the version
+ of the License under which You originally received the Covered
+ Software. Otherwise, You may also choose to use, distribute or
+ otherwise make the Covered Software available under the terms of any
+ subsequent version of the License published by the license steward.
+
+ 4.3. Modified Versions.
+
+ When You are an Initial Developer and You want to create a new
+ license for Your Original Software, You may create and use a
+ modified version of this License if You: (a) rename the license and
+ remove any references to the name of the license steward (except to
+ note that the license differs from this License); and (b) otherwise
+ make it clear that the license contains terms which differ from this
+ License.
+
+5. DISCLAIMER OF WARRANTY.
+
+ COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+ INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE
+ IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR
+ NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
+ THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE
+ DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY
+ OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING,
+ REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN
+ ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS
+ AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION.
+
+ 6.1. This License and the rights granted hereunder will terminate
+ automatically if You fail to comply with terms herein and fail to
+ cure such breach within 30 days of becoming aware of the breach.
+ Provisions which, by their nature, must remain in effect beyond the
+ termination of this License shall survive.
+
+ 6.2. If You assert a patent infringement claim (excluding
+ declaratory judgment actions) against Initial Developer or a
+ Contributor (the Initial Developer or Contributor against whom You
+ assert such claim is referred to as "Participant") alleging that the
+ Participant Software (meaning the Contributor Version where the
+ Participant is a Contributor or the Original Software where the
+ Participant is the Initial Developer) directly or indirectly
+ infringes any patent, then any and all rights granted directly or
+ indirectly to You by such Participant, the Initial Developer (if the
+ Initial Developer is not the Participant) and all Contributors under
+ Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice
+ from Participant terminate prospectively and automatically at the
+ expiration of such 60 day notice period, unless if within such 60
+ day period You withdraw Your claim with respect to the Participant
+ Software against such Participant either unilaterally or pursuant to
+ a written agreement with Participant.
+
+ 6.3. If You assert a patent infringement claim against Participant
+ alleging that the Participant Software directly or indirectly
+ infringes any patent where such claim is resolved (such as by
+ license or settlement) prior to the initiation of patent
+ infringement litigation, then the reasonable value of the licenses
+ granted by such Participant under Sections 2.1 or 2.2 shall be taken
+ into account in determining the amount or value of any payment or
+ license.
+
+ 6.4. In the event of termination under Sections 6.1 or 6.2 above,
+ all end user licenses that have been validly granted by You or any
+ distributor hereunder prior to termination (excluding licenses
+ granted to You by any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE
+ INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
+ COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE
+ TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
+ CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+ LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER
+ FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR
+ LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE
+ POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT
+ APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH
+ PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
+ LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR
+ LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
+ AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+ The Covered Software is a "commercial item," as that term is defined
+ in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+ software" (as that term is defined at 48 C.F.R. §
+ 252.227-7014(a)(1)) and "commercial computer software documentation"
+ as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent
+ with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4
+ (June 1995), all U.S. Government End Users acquire Covered Software
+ with only those rights set forth herein. This U.S. Government Rights
+ clause is in lieu of, and supersedes, any other FAR, DFAR, or other
+ clause or provision that addresses Government rights in computer
+ software under this License.
+
+9. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. This License shall be governed by
+ the law of the jurisdiction specified in a notice contained within
+ the Original Software (except to the extent applicable law, if any,
+ provides otherwise), excluding such jurisdiction's conflict-of-law
+ provisions. Any litigation relating to this License shall be subject
+ to the jurisdiction of the courts located in the jurisdiction and
+ venue specified in a notice contained within the Original Software,
+ with the losing party responsible for costs, including, without
+ limitation, court costs and reasonable attorneys' fees and expenses.
+ The application of the United Nations Convention on Contracts for
+ the International Sale of Goods is expressly excluded. Any law or
+ regulation which provides that the language of a contract shall be
+ construed against the drafter shall not apply to this License. You
+ agree that You alone are responsible for compliance with the United
+ States export administration regulations (and the export control
+ laws and regulation of any other countries) when You use, distribute
+ or otherwise make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or indirectly,
+ out of its utilization of rights under this License and You agree to
+ work with Initial Developer and Contributors to distribute such
+ responsibility on an equitable basis. Nothing herein is intended or
+ shall be deemed to constitute any admission of liability.
+
+------------------------------------------------------------------------
+
+NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION
+LICENSE (CDDL)
+
+The code released under the CDDL shall be governed by the laws of the
+State of California (excluding conflict-of-law provisions). Any
+litigation relating to this License shall be subject to the jurisdiction
+of the Federal Courts of the Northern District of California and the
+state courts of the State of California, with venue lying in Santa Clara
+County, California.
+
+
+
+ The GNU General Public License (GPL) Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor
+Boston, MA 02110-1335
+USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to
+share and change it. By contrast, the GNU General Public License is
+intended to guarantee your freedom to share and change free software--to
+make sure the software is free for all its users. This General Public
+License applies to most of the Free Software Foundation's software and
+to any other program whose authors commit to using it. (Some other Free
+Software Foundation software is covered by the GNU Library General
+Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price.
+Our General Public Licenses are designed to make sure that you have the
+freedom to distribute copies of free software (and charge for this
+service if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone
+to deny you these rights or to ask you to surrender the rights. These
+restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis
+or for a fee, you must give the recipients all the rights that you have.
+You must make sure that they, too, receive or can get the source code.
+And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+Finally, any free program is threatened constantly by software patents.
+We wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program
+proprietary. To prevent this, we have made it clear that any patent must
+be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and
+modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a
+notice placed by the copyright holder saying it may be distributed under
+the terms of this General Public License. The "Program", below, refers
+to any such program or work, and a "work based on the Program" means
+either the Program or any derivative work under copyright law: that is
+to say, a work containing the Program or a portion of it, either
+verbatim or with modifications and/or translated into another language.
+(Hereinafter, translation is included without limitation in the term
+"modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of running
+the Program is not restricted, and the output from the Program is
+covered only if its contents constitute a work based on the Program
+(independent of having been made by running the Program). Whether that
+is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source
+code as you receive it, in any medium, provided that you conspicuously
+and appropriately publish on each copy an appropriate copyright notice
+and disclaimer of warranty; keep intact all the notices that refer to
+this License and to the absence of any warranty; and give any other
+recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of
+it, thus forming a work based on the Program, and copy and distribute
+such modifications or work under the terms of Section 1 above, provided
+that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any part
+ thereof, to be licensed as a whole at no charge to all third parties
+ under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a notice
+ that there is no warranty (or else, saying that you provide a
+ warranty) and that users may redistribute the program under these
+ conditions, and telling the user how to view a copy of this License.
+ (Exception: if the Program itself is interactive but does not
+ normally print such an announcement, your work based on the Program
+ is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program, and
+can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based on
+the Program, the distribution of the whole must be on the terms of this
+License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of a
+storage or distribution medium does not bring the other work under the
+scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections 1
+ and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your cost
+ of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer to
+ distribute corresponding source code. (This alternative is allowed
+ only for noncommercial distribution and only if you received the
+ program in object code or executable form with such an offer, in
+ accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source code
+means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to control
+compilation and installation of the executable. However, as a special
+exception, the source code distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies the
+executable.
+
+If distribution of executable or object code is made by offering access
+to copy from a designated place, then offering equivalent access to copy
+the source code from the same place counts as distribution of the source
+code, even though third parties are not compelled to copy the source
+along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt otherwise
+to copy, modify, sublicense or distribute the Program is void, and will
+automatically terminate your rights under this License. However, parties
+who have received copies, or rights, from you under this License will
+not have their licenses terminated so long as such parties remain in
+full compliance.
+
+5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and all
+its terms and conditions for copying, distributing or modifying the
+Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further restrictions
+on the recipients' exercise of the rights granted herein. You are not
+responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot distribute
+so as to satisfy simultaneously your obligations under this License and
+any other pertinent obligations, then as a consequence you may not
+distribute the Program at all. For example, if a patent license would
+not permit royalty-free redistribution of the Program by all those who
+receive copies directly or indirectly through you, then the only way you
+could satisfy both it and this License would be to refrain entirely from
+distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is implemented
+by public license practices. Many people have made generous
+contributions to the wide range of software distributed through that
+system in reliance on consistent application of that system; it is up to
+the author/donor to decide if he or she is willing to distribute
+software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be
+a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License may
+add an explicit geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or among countries
+not thus excluded. In such case, this License incorporates the
+limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new
+versions of the General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Program does not specify a version
+number of this License, you may choose any version ever published by the
+Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the
+author to ask for permission. For software which is copyrighted by the
+Free Software Foundation, write to the Free Software Foundation; we
+sometimes make exceptions for this. Our decision will be guided by the
+two goals of preserving the free status of all derivatives of our free
+software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
+YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
+DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
+DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM
+(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
+INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
+THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR
+OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to
+attach them to the start of each source file to most effectively convey
+the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ One line to give the program's name and a brief idea of what it does.
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type
+ `show w'. This is free software, and you are welcome to redistribute
+ it under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the
+appropriate parts of the General Public License. Of course, the commands
+you use may be called something other than `show w' and `show c'; they
+could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ program `Gnomovision' (which makes passes at compilers) written by
+ James Hacker.
+
+ signature of Ty Coon, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications
+with the library. If this is what you want to do, use the GNU Library
+General Public License instead of this License.
+
+#
+
+Certain source files distributed by Oracle America, Inc. and/or its
+affiliates are subject to the following clarification and special
+exception to the GPLv2, based on the GNU Project exception for its
+Classpath libraries, known as the GNU Classpath Exception, but only
+where Oracle has expressly included in the particular source file's
+header the words "Oracle designates this particular file as subject to
+the "Classpath" exception as provided by Oracle in the LICENSE file
+that accompanied this code."
+
+You should also note that Oracle includes multiple, independent
+programs in this software package. Some of those programs are provided
+under licenses deemed incompatible with the GPLv2 by the Free Software
+Foundation and others. For example, the package includes programs
+licensed under the Apache License, Version 2.0. Such programs are
+licensed to you under their original licenses.
+
+Oracle facilitates your further distribution of this package by adding
+the Classpath Exception to the necessary parts of its GPLv2 code, which
+permits you to use that code in combination with other independent
+modules not licensed under the GPLv2. However, note that this would
+not permit you to commingle code under an incompatible license with
+Oracle's GPLv2 licensed code by, for example, cutting and pasting such
+code into a file also containing Oracle's GPLv2 licensed code and then
+distributing the result. Additionally, if you were to remove the
+Classpath Exception from any of the files to which it applies and
+distribute the result, you would likely be required to license some or
+all of the other code in that distribution under the GPLv2 as well, and
+since the GPLv2 is incompatible with the license terms of some items
+included in the distribution by Oracle, removing the Classpath
+Exception could therefore effectively compromise your ability to
+further distribute the package.
+
+Proceed with caution and we recommend that you obtain the advice of a
+lawyer skilled in open source matters before removing the Classpath
+Exception or making modifications to this package which may
+subsequently be redistributed and/or involve the use of third party
+software.
+
+CLASSPATH EXCEPTION
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License version 2 cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from or
+based on this library. If you modify this library, you may extend this
+exception to your version of the library, but you are not obligated to
+do so. If you do not wish to do so, delete this exception statement
+from your version.
diff --git a/maven-core/src/main/resources/META-INF/maven/extension.xml b/maven-core/src/main/resources/META-INF/maven/extension.xml
index 6bd836927364..1fa9d41750b6 100644
--- a/maven-core/src/main/resources/META-INF/maven/extension.xml
+++ b/maven-core/src/main/resources/META-INF/maven/extension.xml
@@ -166,7 +166,7 @@ under the License.
org.apache.maven.resolver:maven-resolver-impljavax.inject:javax.inject
- javax.annotation:jsr250-api
+ javax.annotation:javax.annotation-apiorg.slf4j:slf4j-apiorg.fusesource.jansi:jansi
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index fc90bbc13493..232bb9031048 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -116,7 +116,7 @@ under the License.
javax.annotation
- jsr250-api
+ javax.annotation-apiorg.codehaus.plexus
diff --git a/pom.xml b/pom.xml
index 40a7ee81ade0..9e68774899cc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,7 +58,7 @@ under the License.
1.263.3.04.2.2
- 0.3.4
+ 0.3.53.4.31.12.12.0
@@ -248,12 +248,12 @@ under the License.
org.eclipse.sisuorg.eclipse.sisu.plexus
- ${sisuInjectVersion}
+ ${sisuVersion}org.eclipse.sisuorg.eclipse.sisu.inject
- ${sisuInjectVersion}
+ ${sisuVersion}javax.inject
@@ -262,8 +262,8 @@ under the License.
javax.annotation
- jsr250-api
- 1.0
+ javax.annotation-api
+ 1.2org.codehaus.plexus
@@ -480,7 +480,7 @@ under the License.
org.eclipse.sisusisu-maven-plugin
- ${sisuInjectVersion}
+ ${sisuVersion}
@@ -545,10 +545,10 @@ under the License.
src/test/remote-repo/****/*.odg
- src/main/appended-resources/licenses/CDDL-1.0.txtsrc/main/appended-resources/licenses/EPL-1.0.txt
+ src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.2.txt
From 4e5b3d55545e5f03f05ac7b0cd1b56689df36201 Mon Sep 17 00:00:00 2001
From: Falko Modler
Date: Sun, 22 Aug 2021 22:52:30 +0200
Subject: [PATCH 081/183] [MNG-7251] Fix threadLocalArtifactsHolder leaking
into cloned project
This closes #527
---
.../apache/maven/project/MavenProject.java | 49 ++++++++++---------
.../maven/project/MavenProjectTest.java | 43 ++++++++++++++++
2 files changed, 68 insertions(+), 24 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
index 157b7a0f0a55..94d678814534 100644
--- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
+++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
@@ -143,13 +143,7 @@ public class MavenProject
private Artifact artifact;
- private final ThreadLocal threadLocalArtifactsHolder = new ThreadLocal()
- {
- protected ArtifactsHolder initialValue()
- {
- return new ArtifactsHolder();
- }
- };
+ private ThreadLocal threadLocalArtifactsHolder = newThreadLocalArtifactsHolder();
private Model originalModel;
@@ -188,6 +182,17 @@ public MavenProject()
setModel( model );
}
+ private static ThreadLocal newThreadLocalArtifactsHolder()
+ {
+ return new ThreadLocal()
+ {
+ protected ArtifactsHolder initialValue()
+ {
+ return new ArtifactsHolder();
+ }
+ };
+ }
+
public MavenProject( Model model )
{
setModel( model );
@@ -1181,7 +1186,8 @@ public MavenProject clone()
{
throw new UnsupportedOperationException( e );
}
-
+ // clone must have it's own TL, otherwise the artifacts are intermingled!
+ clone.threadLocalArtifactsHolder = newThreadLocalArtifactsHolder();
clone.deepCopy( this );
return clone;
@@ -1224,6 +1230,7 @@ private void deepCopy( MavenProject project )
// copy fields
file = project.file;
basedir = project.basedir;
+ threadLocalArtifactsHolder.set( project.threadLocalArtifactsHolder.get().copy() );
// don't need a deep copy, they don't get modified or added/removed to/from - but make them unmodifiable to be
// sure!
@@ -1232,11 +1239,6 @@ private void deepCopy( MavenProject project )
setDependencyArtifacts( Collections.unmodifiableSet( project.getDependencyArtifacts() ) );
}
- if ( project.getArtifacts() != null )
- {
- setArtifacts( Collections.unmodifiableSet( project.getArtifacts() ) );
- }
-
if ( project.getParentFile() != null )
{
parentFile = new File( project.getParentFile().getAbsolutePath() );
@@ -1479,13 +1481,7 @@ public void addLifecyclePhase( String lifecyclePhase )
// ----------------------------------------------------------------------------------------------------------------
//
- //
- // D E P R E C A T E D
- //
- //
- // ----------------------------------------------------------------------------------------------------------------
- //
- // Everything below will be removed for Maven 4.0.0
+ // D E P R E C A T E D - Everything below will be removed for Maven 4.0.0
//
// ----------------------------------------------------------------------------------------------------------------
@@ -1506,7 +1502,6 @@ public String getModulePathAdjustment( MavenProject moduleProject )
if ( moduleFile != null )
{
File moduleDir = moduleFile.getCanonicalFile().getParentFile();
-
module = moduleDir.getName();
}
@@ -1827,7 +1822,6 @@ public Reporting getReporting()
public void setReportArtifacts( Set reportArtifacts )
{
this.reportArtifacts = reportArtifacts;
-
reportArtifactMap = null;
}
@@ -1851,7 +1845,6 @@ public Map getReportArtifactMap()
public void setExtensionArtifacts( Set extensionArtifacts )
{
this.extensionArtifacts = extensionArtifacts;
-
extensionArtifactMap = null;
}
@@ -1885,7 +1878,6 @@ public List getReportPlugins()
public Xpp3Dom getReportConfiguration( String pluginGroupId, String pluginArtifactId, String reportSetId )
{
Xpp3Dom dom = null;
-
// ----------------------------------------------------------------------
// I would like to be able to lookup the Mojo object using a key but
// we have a limitation in modello that will be remedied shortly. So
@@ -1995,5 +1987,14 @@ private static class ArtifactsHolder
private ArtifactFilter artifactFilter;
private Set artifacts;
private Map artifactMap;
+
+ ArtifactsHolder copy()
+ {
+ ArtifactsHolder copy = new ArtifactsHolder();
+ copy.artifactFilter = artifactFilter;
+ copy.artifacts = artifacts != null ? new LinkedHashSet<>( artifacts ) : null;
+ copy.artifactMap = artifactMap != null ? new LinkedHashMap<>( artifactMap ) : null;
+ return copy;
+ }
}
}
diff --git a/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java b/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java
index 6b4258b3fde9..2344d8f77345 100644
--- a/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java
@@ -21,13 +21,18 @@
import java.io.File;
import java.io.IOException;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicReference;
+import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.model.Profile;
+import org.mockito.Mockito;
public class MavenProjectTest
extends AbstractMavenProjectTestCase
@@ -188,6 +193,44 @@ public void testCloneWithBaseDir()
assertEquals( "Base directory is preserved across clone", projectToClone.getBasedir(), clonedProject.getBasedir() );
}
+ public void testCloneWithArtifacts()
+ throws InterruptedException
+ {
+ Artifact initialArtifact = Mockito.mock( Artifact.class, "initialArtifact" );
+ MavenProject originalProject = new MavenProject();
+ originalProject.setArtifacts( Collections.singleton( initialArtifact ) );
+ assertEquals( "Sanity check: originalProject returns artifact that has just been set",
+ Collections.singleton( initialArtifact ), originalProject.getArtifacts() );
+
+ final MavenProject clonedProject = originalProject.clone();
+
+ assertEquals( "Cloned project returns the artifact that was set for the original project",
+ Collections.singleton( initialArtifact ), clonedProject.getArtifacts() );
+
+ Artifact anotherArtifact = Mockito.mock( Artifact.class, "anotherArtifact" );
+ clonedProject.setArtifacts( Collections.singleton( anotherArtifact ) );
+ assertEquals( "Sanity check: clonedProject returns artifact that has just been set",
+ Collections.singleton( anotherArtifact ), clonedProject.getArtifacts() );
+
+ assertEquals( "Original project returns the artifact that was set initially (not the one for clonedProject)",
+ Collections.singleton( initialArtifact ), originalProject.getArtifacts() );
+
+ final AtomicReference> artifactsFromThread = new AtomicReference<>();
+ Thread thread = new Thread( new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ artifactsFromThread.set( clonedProject.getArtifacts() );
+ }
+ } );
+ thread.start();
+ thread.join();
+
+ assertEquals( "Another thread does not see the same artifacts",
+ Collections.emptySet(), artifactsFromThread.get() );
+ }
+
public void testUndefinedOutputDirectory()
throws Exception
{
From 1ea42b0371f1bc99a4e0629c3734ad4ccfc0dcbd Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sat, 11 Sep 2021 13:43:19 +0200
Subject: [PATCH 082/183] [MNG-7219] [Regression] plexus-cipher missing from
transitive dependencies
---
apache-maven/pom.xml | 4 ----
maven-compat/pom.xml | 5 -----
maven-core/pom.xml | 5 -----
3 files changed, 14 deletions(-)
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index a4cf0396c61b..d98d4326f002 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -113,10 +113,6 @@ under the License.
org.fusesource.jansijansi
-
- org.codehaus.plexus
- plexus-cipher
-
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index 06686b980a5d..46259815a4fe 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -99,11 +99,6 @@ under the License.
wagon-provider-api
-
- org.codehaus.plexus
- plexus-cipher
- test
- org.apache.maven.wagonwagon-file
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 60b958f1f6fb..b3f048b3c07c 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -122,11 +122,6 @@ under the License.
org.codehaus.plexusplexus-component-annotations
-
- org.codehaus.plexus
- plexus-cipher
- test
- org.apache.commonscommons-lang3
From 98a9d089bda8870fd658208d98bdc73a5f039b0f Mon Sep 17 00:00:00 2001
From: Guillaume Nodet
Date: Thu, 9 Sep 2021 16:25:21 +0200
Subject: [PATCH 083/183] [MNG-7236] The DefaultPluginVersionResolver should
cache results for the session
---
.../DefaultPluginVersionResolver.java | 89 ++++++++++++++++++-
1 file changed, 85 insertions(+), 4 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
index 82e32fb310b3..2d2d1cba7b41 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
@@ -25,7 +25,10 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
import org.apache.maven.artifact.repository.metadata.Metadata;
import org.apache.maven.artifact.repository.metadata.Versioning;
@@ -49,6 +52,7 @@
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.RequestTrace;
+import org.eclipse.aether.SessionData;
import org.eclipse.aether.metadata.DefaultMetadata;
import org.eclipse.aether.repository.ArtifactRepository;
import org.eclipse.aether.repository.RemoteRepository;
@@ -72,6 +76,8 @@ public class DefaultPluginVersionResolver
private static final String REPOSITORY_CONTEXT = "plugin";
+ private static final Object CACHE_KEY = new Object();
+
@Requirement
private Logger logger;
@@ -91,12 +97,26 @@ public PluginVersionResult resolve( PluginVersionRequest request )
if ( result == null )
{
- result = resolveFromRepository( request );
+ ConcurrentMap cache = getCache( request.getRepositorySession().getData() );
+ Key key = getKey( request );
+ result = cache.get( key );
- if ( logger.isDebugEnabled() )
+ if ( result == null )
{
- logger.debug( "Resolved plugin version for " + request.getGroupId() + ":" + request.getArtifactId()
- + " to " + result.getVersion() + " from repository " + result.getRepository() );
+ result = resolveFromRepository( request );
+
+ if ( logger.isDebugEnabled() )
+ {
+ logger.debug( "Resolved plugin version for " + request.getGroupId() + ":" + request.getArtifactId()
+ + " to " + result.getVersion() + " from repository " + result.getRepository() );
+ }
+
+ cache.putIfAbsent( key, result );
+ }
+ else if ( logger.isDebugEnabled() )
+ {
+ logger.debug( "Reusing cached resolved plugin version for " + request.getGroupId() + ":"
+ + request.getArtifactId() + " to " + result.getVersion() + " from POM " + request.getPom() );
}
}
else if ( logger.isDebugEnabled() )
@@ -384,6 +404,67 @@ private PluginVersionResult resolveFromProject( PluginVersionRequest request, Li
return null;
}
+ @SuppressWarnings( "unchecked" )
+ private ConcurrentMap getCache( SessionData data )
+ {
+ ConcurrentMap cache =
+ ( ConcurrentMap ) data.get( CACHE_KEY );
+ while ( cache == null )
+ {
+ cache = new ConcurrentHashMap<>( 256 );
+ if ( data.set( CACHE_KEY, null, cache ) )
+ {
+ break;
+ }
+ cache = ( ConcurrentMap ) data.get( CACHE_KEY );
+ }
+ return cache;
+ }
+
+ private static Key getKey( PluginVersionRequest request )
+ {
+ return new Key( request.getGroupId(), request.getArtifactId(), request.getRepositories() );
+ }
+
+ static class Key
+ {
+ final String groupId;
+ final String artifactId;
+ final List repositories;
+ final int hash;
+
+ Key( String groupId, String artifactId, List repositories )
+ {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.repositories = repositories;
+ this.hash = Objects.hash( groupId, artifactId, repositories );
+ }
+
+ @Override
+ public boolean equals( Object o )
+ {
+ if ( this == o )
+ {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() )
+ {
+ return false;
+ }
+ Key key = ( Key ) o;
+ return groupId.equals( key.groupId )
+ && artifactId.equals( key.artifactId )
+ && repositories.equals( key.repositories );
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return hash;
+ }
+ }
+
static class Versions
{
From 93f9e85955abb40bb090bad689f15fa9969ef9ba Mon Sep 17 00:00:00 2001
From: Romain Manni-Bucau
Date: Thu, 3 Dec 2020 20:07:03 +0100
Subject: [PATCH 084/183] [MNG-7045] Drop CDI API from Maven
This closes #540
---
maven-core/src/main/resources/META-INF/maven/extension.xml | 4 +++-
pom.xml | 6 ++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/maven-core/src/main/resources/META-INF/maven/extension.xml b/maven-core/src/main/resources/META-INF/maven/extension.xml
index 1fa9d41750b6..73bee382de9c 100644
--- a/maven-core/src/main/resources/META-INF/maven/extension.xml
+++ b/maven-core/src/main/resources/META-INF/maven/extension.xml
@@ -94,9 +94,11 @@ under the License.
javax.inject.*
-
+
javax.annotation.*
diff --git a/pom.xml b/pom.xml
index 9e68774899cc..65f5d22411a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -249,6 +249,12 @@ under the License.
org.eclipse.sisuorg.eclipse.sisu.plexus${sisuVersion}
+
+
+ javax.enterprise
+ cdi-api
+
+ org.eclipse.sisu
From d1aa1e1f0a891609256c60b2b7b5b8efaceea563 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Thu, 16 Sep 2021 10:08:23 +0200
Subject: [PATCH 085/183] [MNG-7252] Fix warnings issued by dependency:analyze
This closes #541
---
maven-core/pom.xml | 8 ++++++++
maven-embedder/pom.xml | 1 +
.../apache/maven/model/building/FileModelSourceTest.java | 4 ++--
maven-resolver-provider/pom.xml | 4 ----
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index b3f048b3c07c..748ce6cd3960 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -118,6 +118,10 @@ under the License.
org.codehaus.plexusplexus-classworlds
+
+ org.codehaus.plexus
+ plexus-interpolation
+ org.codehaus.plexusplexus-component-annotations
@@ -126,6 +130,10 @@ under the License.
org.apache.commonscommons-lang3
+
+ org.slf4j
+ slf4j-api
+ commons-jxpathcommons-jxpath
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 232bb9031048..7a3cc7e0d14a 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -114,6 +114,7 @@ under the License.
javax.injectjavax.inject
+
javax.annotationjavax.annotation-api
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/building/FileModelSourceTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/building/FileModelSourceTest.java
index 9b0ecd9ddf57..6c8ebe0e4220 100644
--- a/maven-model-builder/src/test/java/org/apache/maven/model/building/FileModelSourceTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/building/FileModelSourceTest.java
@@ -22,7 +22,7 @@
import java.io.IOException;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertTrue;
-import org.apache.commons.lang3.SystemUtils;
+import org.codehaus.plexus.util.Os;;
import static org.junit.Assume.assumeTrue;
import org.junit.Test;
@@ -53,7 +53,7 @@ public void testEquals()
public void testWindowsPaths()
throws Exception
{
- assumeTrue( SystemUtils.IS_OS_WINDOWS );
+ assumeTrue( Os.isFamily( "Windows" ) );
File upperCaseFile = createTempFile( "TESTE" );
String absolutePath = upperCaseFile.getAbsolutePath();
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index 70e0f4e5bc35..ca317a9edeca 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -108,10 +108,6 @@ under the License.
mockito-coretest
-
- org.slf4j
- slf4j-api
- org.slf4jslf4j-simple
From 8c66edc0417f37540b3a6ef4b266ff88bdbd8327 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Thu, 16 Sep 2021 13:52:15 +0200
Subject: [PATCH 086/183] [MNG-7254] Expand Windows native libraries for Jansi
due to JDK-8195129 (workaround)
This closes #542
---
apache-maven/pom.xml | 16 ++++++++++++++++
apache-maven/src/bin/mvn | 1 +
apache-maven/src/bin/mvn.cmd | 1 +
apache-maven/src/lib/jansi-native/README.txt | 8 ++++++++
.../src/main/assembly/.component.xml.swp | Bin 0 -> 12288 bytes
apache-maven/src/main/assembly/component.xml | 7 +++++++
6 files changed, 33 insertions(+)
create mode 100644 apache-maven/src/lib/jansi-native/README.txt
create mode 100644 apache-maven/src/main/assembly/.component.xml.swp
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index d98d4326f002..b6068d0fc972 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -131,6 +131,22 @@ under the License.
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+ jansi
+ org/fusesource/jansi/internal/native/Windows/**
+
+
+
+ unpack-jansi-native
+
+ unpack-dependencies
+
+
+
+ org.apache.maven.pluginsmaven-compiler-plugin
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 29e0eabb837c..90f9a758d9cf 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -197,5 +197,6 @@ exec "$JAVACMD" \
-classpath "${CLASSWORLDS_JAR}" \
"-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
"-Dmaven.home=${MAVEN_HOME}" \
+ "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/jansi-native" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${CLASSWORLDS_LAUNCHER} "$@"
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index fcb0f455a804..9fb4a98c7e24 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -174,6 +174,7 @@ set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-classpath %CLASSWORLDS_JAR% ^
"-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^
"-Dmaven.home=%MAVEN_HOME%" ^
+ "-Dlibrary.jansi.path=%MAVEN_HOME%\lib\jansi-native" ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
diff --git a/apache-maven/src/lib/jansi-native/README.txt b/apache-maven/src/lib/jansi-native/README.txt
new file mode 100644
index 000000000000..26a957e1b564
--- /dev/null
+++ b/apache-maven/src/lib/jansi-native/README.txt
@@ -0,0 +1,8 @@
+This directory contains Jansi native libraries extracted from Jansi JAR.
+
+You can add your own build for platforms not natively supported by Jansi.
+See here [1] on how to compile for your platform and and here [2] how libraries
+follow Jansi's directory and filename conventions.
+
+[1] https://github.com/fusesource/jansi/tree/master/src/main/native
+[2] https://github.com/fusesource/jansi/blob/321a8ff71c731e10f4ea05c607860180276b2215/src/main/java/org/fusesource/jansi/internal/OSInfo.java
diff --git a/apache-maven/src/main/assembly/.component.xml.swp b/apache-maven/src/main/assembly/.component.xml.swp
new file mode 100644
index 0000000000000000000000000000000000000000..52c487e4a78f44dad9a6220103ec18dab7e0e89c
GIT binary patch
literal 12288
zcmeI2Ux*t;9LJ|sYpb?O1w{mz#)@sd?B=c%+iN^X?{XNt>p#tp?;n+atIrV|a#CCfJl4>gbba*>_Y%xqgrOqiBu*)5js7nErf
z)0S;d3MRDCZM%tQre9M9QUyj(AkdBM;hhTyC&qK3^@Eu`^zPjYBQ#7+QUy{4QUy{4
zQUy{4QUy{4QUy{4ZWINyw}m{1V7A5qHRI1MD?a05`jIM-Dv&CWDv&CWDv&CWDv&CW
zDv&CWDv&CWD)2v4z;X!r34XsB{sI7h{~!GS|H_?&dC3Q@E!beJ0V|#3*cFB7VHQ2g00}k+X%S`UIEX5BVZT!V+SGM
zf-k_Q;C*l&ya0S)g9Weye7T*F&%s;ZMG$}nI1L^Kzu!v8_uw;d5nKT0z#_S
zWg8(sfUm&YKm!{T!9lPW+yj2Tg^*9cyWmyefv3PxFa{m~zugR7`z9zO{FPsEEuR3HB9!LM26tJNX%&_d<$e(r
zGSFV2XSmO7E&bk<%jyQWQ|%?uTlDe+lYy?V
z*ptoDT8k@+e@ar_vNWA8QPoqLwH383K|SVk>2TX}-5&J=0V75|UxrTmG@DI4Ez#c$
zs|U@sdQ8}?x;=1s7{jW}*SQ!q6OrjA6Oqu>k!sUAA29mqAH*2vCXoqPw4MK6+=G!Z
z6h7(lfot#=ubsJQ3B|L*(tL@Hk~D4kO{PtUc}zG=*gZ3EZZdz@J&wARdK138+{RHk
zrp$i3f7|;J=gC<3q4U==XRfDwWxiILF0L9yi7_^Z`<3cylZ__?1A}Dal^~8VI*^!E
zEz4(4*7EHZMrPJ$N(R1-q?L=cLbgqn|_DL1W}2X=-CZYFU9YJePF?HQE2j+Ahv&oBgGFd%@2lqTbw^~NSaguo)&*blhGpxihUF?u9&6l*y3DVk!V19#(G7>+T60_|
z%_#A%nAkTSp6kyaYlOAwfUlMy3a+d8q{0E*wlybhOute*mT772O`84lxkmqdu7Rk{
zLbX~fADcUqot`frpRW`vHFLtq89Dk-4Z6x1p5)CAPx5A?Mh0$XrbvERO>w|isLl7D
z={KB2B*Vs?PRHmRjGUgpxn%Qnd9E4-ndL%hOV}(!!re%K#lw#_DRceV*dWSdHg9m7
zx|V1LR+G`DTw=b!hAQ0Nw7F6cNl{BU)a7liBheIjqEwj~ql{z6<5Sl4FjXijeahRO
z%b8Z=ytVyO&rKM_y9xGH!)iHXiRC|1Wp+-*?PMj!IYNcY8&Yz&u^Oc!W
ztu$XjX_gi$XNZyw-NEcc9j>&`>w#ttT@_HcSxXv70nf>Ta6|We_H=+9utV!TYI*R}
zw(2fJo3I7Ux0KTITrk91#{2A?%8KioG*-uS%P(o}W?%v#)o(=}{m3)NX9y}xcR
zdq9!`$Kk>`OnhgfBwLOH@uaX^IEk#cqai~eaa$sP*a!CWhl=>&eeH3SUaQ2w>937Z
k&?Jr{N)NoJad_3ipqP~iJ?e+**
+
+ target/dependency/org/fusesource/jansi/internal/native
+ lib/jansi-native
+
+ **
+
+ src/binbin
From ab54d17dc2ec355c1e002e8751739edd9a96fcc3 Mon Sep 17 00:00:00 2001
From: George Gastaldi
Date: Fri, 17 Sep 2021 12:18:27 -0300
Subject: [PATCH 087/183] [MNG-7253] Display relocation message defined in
model
Move logging to DefaultArtifactDescriptorReader
This closes #544
---
.../DefaultProjectDependenciesResolver.java | 12 ------------
.../DefaultArtifactDescriptorReader.java | 18 ++++++++++++++++--
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
index 7500e43d2a38..3644b67ef408 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
@@ -181,18 +181,6 @@ public DependencyResolutionResult resolve( DependencyResolutionRequest request )
depRequest.setRoot( node );
- if ( logger.isWarnEnabled() )
- {
- for ( DependencyNode child : node.getChildren() )
- {
- if ( !child.getRelocations().isEmpty() )
- {
- logger.warn( "The artifact " + child.getRelocations().get( 0 ) + " has been relocated to "
- + child.getDependency().getArtifact() );
- }
- }
- }
-
if ( logger.isDebugEnabled() )
{
node.accept( new GraphLogger( project ) );
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
index c2ba0a3d729a..888f4581b460 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
@@ -68,6 +68,8 @@
import org.eclipse.aether.spi.locator.Service;
import org.eclipse.aether.spi.locator.ServiceLocator;
import org.eclipse.aether.transfer.ArtifactNotFoundException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Benjamin Bentmann
@@ -77,6 +79,8 @@
public class DefaultArtifactDescriptorReader
implements ArtifactDescriptorReader, Service
{
+ private static final Logger LOGGER = LoggerFactory.getLogger( DefaultArtifactDescriptorReader.class );
+
private RemoteRepositoryManager remoteRepositoryManager;
private VersionResolver versionResolver;
@@ -316,10 +320,20 @@ private Model loadPom( RepositorySystemSession session, ArtifactDescriptorReques
if ( relocation != null )
{
result.addRelocation( a );
- a =
+ Artifact relocatedArtifact =
new RelocatedArtifact( a, relocation.getGroupId(), relocation.getArtifactId(),
relocation.getVersion() );
- result.setArtifact( a );
+ if ( LOGGER.isWarnEnabled() )
+ {
+ String message = "The artifact " + a + " has been relocated to " + relocatedArtifact;
+ if ( relocation.getMessage() != null )
+ {
+ message += ": " + relocation.getMessage();
+ }
+ LOGGER.warn( message );
+ }
+ result.setArtifact( relocatedArtifact );
+ a = relocatedArtifact;
}
else
{
From 8882a9c599013182e42f0c7c321396c23b84dbe0 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 29 May 2021 09:31:49 -0400
Subject: [PATCH 088/183] [MNG-7164] Add constructor
MojoExecutionException(Throwable)
This closes #474
---
.../plugin/AbstractMojoExecutionException.java | 12 ++++++++++++
.../apache/maven/plugin/MojoExecutionException.java | 13 +++++++++++++
.../apache/maven/plugin/MojoFailureException.java | 13 +++++++++++++
3 files changed, 38 insertions(+)
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojoExecutionException.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojoExecutionException.java
index 52aded3d654d..e8df3095f212 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojoExecutionException.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojoExecutionException.java
@@ -41,6 +41,18 @@ public AbstractMojoExecutionException( String message, Throwable cause )
super( message, cause );
}
+ /**
+ * Constructs a new {@code AbstractMojoExecutionException} exception wrapping an underlying {@code Throwable}.
+ *
+ * @param cause the cause which is saved for later retrieval by the {@link #getCause()} method.
+ * A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.
+ * @since 3.8.3
+ */
+ public AbstractMojoExecutionException( Throwable cause )
+ {
+ super( cause );
+ }
+
public String getLongMessage()
{
return longMessage;
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoExecutionException.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoExecutionException.java
index 4d8c416e077d..6d089898600c 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoExecutionException.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoExecutionException.java
@@ -76,4 +76,17 @@ public MojoExecutionException( String message )
{
super( message );
}
+
+ /**
+ * Constructs a new {@code MojoExecutionException} exception wrapping an underlying {@code Throwable}.
+ *
+ * @param cause the cause which is saved for later retrieval by the {@link #getCause()} method.
+ * A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.
+ * @since 3.8.3
+ */
+ public MojoExecutionException( Throwable cause )
+ {
+ super( cause );
+ }
+
}
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoFailureException.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoFailureException.java
index 342d081f00b2..72faec679eb9 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoFailureException.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoFailureException.java
@@ -65,4 +65,17 @@ public MojoFailureException( String message, Throwable cause )
{
super( message, cause );
}
+
+ /**
+ * Constructs a new {@code MojoFailureException} exception wrapping an underlying {@code Throwable}.
+ *
+ * @param cause the cause which is saved for later retrieval by the {@link #getCause()} method.
+ * A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.
+ * @since 3.8.3
+ */
+ public MojoFailureException( Throwable cause )
+ {
+ super( cause );
+ }
+
}
From 0a6bbb8301717d386e6588a7ea32e3e2451c7060 Mon Sep 17 00:00:00 2001
From: Guillaume Nodet
Date: Thu, 9 Sep 2021 16:10:25 +0200
Subject: [PATCH 089/183] [MNG-7235] Speed improvements when calculating the
sorted project graph
This closes #530
---
.../graph/DefaultProjectDependencyGraph.java | 49 ++++++++++++++++---
1 file changed, 41 insertions(+), 8 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/graph/DefaultProjectDependencyGraph.java b/maven-core/src/main/java/org/apache/maven/graph/DefaultProjectDependencyGraph.java
index e0067f1fe4ae..7804312c9f90 100644
--- a/maven-core/src/main/java/org/apache/maven/graph/DefaultProjectDependencyGraph.java
+++ b/maven-core/src/main/java/org/apache/maven/graph/DefaultProjectDependencyGraph.java
@@ -22,8 +22,11 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.Set;
@@ -42,9 +45,13 @@ public class DefaultProjectDependencyGraph
implements ProjectDependencyGraph
{
- private ProjectSorter sorter;
+ private final ProjectSorter sorter;
- private List allProjects;
+ private final List allProjects;
+
+ private final Map order;
+
+ private final Map projects;
/**
* Creates a new project dependency graph based on the specified projects.
@@ -59,6 +66,16 @@ public DefaultProjectDependencyGraph( Collection projects )
super();
this.allProjects = Collections.unmodifiableList( new ArrayList<>( projects ) );
this.sorter = new ProjectSorter( projects );
+ List sorted = this.sorter.getSortedProjects();
+ this.order = new HashMap<>( sorted.size() );
+ this.projects = new HashMap<>( sorted.size() );
+ int index = 0;
+ for ( MavenProject project : sorted )
+ {
+ String id = ProjectSorter.getId( project );
+ this.projects.put( id, project );
+ this.order.put( project, index++ );
+ }
}
/**
@@ -78,6 +95,16 @@ public DefaultProjectDependencyGraph( final List allProjects,
super();
this.allProjects = Collections.unmodifiableList( new ArrayList<>( allProjects ) );
this.sorter = new ProjectSorter( projects );
+ List sorted = this.sorter.getSortedProjects();
+ this.order = new HashMap<>( sorted.size() );
+ this.projects = new HashMap<>( sorted.size() );
+ int index = 0;
+ for ( MavenProject project : sorted )
+ {
+ String id = ProjectSorter.getId( project );
+ this.projects.put( id, project );
+ this.order.put( project, index++ );
+ }
}
/**
@@ -140,15 +167,13 @@ private void getUpstreamProjects( String projectId, Collection projectId
private List getSortedProjects( Set projectIds )
{
List result = new ArrayList<>( projectIds.size() );
-
- for ( MavenProject mavenProject : sorter.getSortedProjects() )
+ for ( String projectId : projectIds )
{
- if ( projectIds.contains( ProjectSorter.getId( mavenProject ) ) )
- {
- result.add( mavenProject );
- }
+ result.add( projects.get( projectId ) );
}
+ Collections.sort( result, new MavenProjectComparator() );
+
return result;
}
@@ -158,4 +183,12 @@ public String toString()
return sorter.getSortedProjects().toString();
}
+ private class MavenProjectComparator implements Comparator
+ {
+ @Override
+ public int compare( MavenProject o1, MavenProject o2 )
+ {
+ return order.get( o1 ) - order.get( o2 );
+ }
+ }
}
From ff8e977a158738155dc465c6a97ffaf31982d739 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Mon, 27 Sep 2021 20:28:25 +0200
Subject: [PATCH 090/183] [maven-release-plugin] prepare release maven-3.8.3
---
apache-maven/pom.xml | 2 +-
maven-artifact/pom.xml | 2 +-
maven-builder-support/pom.xml | 2 +-
maven-compat/pom.xml | 2 +-
maven-core/pom.xml | 2 +-
maven-embedder/pom.xml | 2 +-
maven-model-builder/pom.xml | 2 +-
maven-model/pom.xml | 2 +-
maven-plugin-api/pom.xml | 2 +-
maven-repository-metadata/pom.xml | 2 +-
maven-resolver-provider/pom.xml | 2 +-
maven-settings-builder/pom.xml | 2 +-
maven-settings/pom.xml | 2 +-
maven-slf4j-provider/pom.xml | 2 +-
pom.xml | 6 +++---
15 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index b6068d0fc972..c17f8a6d5e6a 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3apache-maven
diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml
index 5203f1b79592..6cf8468499a4 100644
--- a/maven-artifact/pom.xml
+++ b/maven-artifact/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-artifact
diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml
index 191bfc5967d0..959d8ec3fc84 100644
--- a/maven-builder-support/pom.xml
+++ b/maven-builder-support/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-builder-support
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index 46259815a4fe..75e2289d2f06 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-compat
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 748ce6cd3960..d4c5111666c3 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-core
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 7a3cc7e0d14a..1c632c93f884 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-embedder
diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml
index 06d42d38e31b..8cb1008a6675 100644
--- a/maven-model-builder/pom.xml
+++ b/maven-model-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-model-builder
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index 0e002c0c2f5e..df81d72f91c0 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-model
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
index a0a708926b69..a1a72a1967b4 100644
--- a/maven-plugin-api/pom.xml
+++ b/maven-plugin-api/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-plugin-api
diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml
index b4ac0f489b00..4b4cc2b88999 100644
--- a/maven-repository-metadata/pom.xml
+++ b/maven-repository-metadata/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-repository-metadata
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index ca317a9edeca..52e94e5c3c7b 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-resolver-provider
diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml
index dd0c09bb9ce8..677c13999c0c 100644
--- a/maven-settings-builder/pom.xml
+++ b/maven-settings-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-settings-builder
diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml
index 6fa967c38ca3..b77437c27c9a 100644
--- a/maven-settings/pom.xml
+++ b/maven-settings/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-settings
diff --git a/maven-slf4j-provider/pom.xml b/maven-slf4j-provider/pom.xml
index 802d226c9c0a..eea89b72de1e 100644
--- a/maven-slf4j-provider/pom.xml
+++ b/maven-slf4j-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3-SNAPSHOT
+ 3.8.3maven-slf4j-provider
diff --git a/pom.xml b/pom.xml
index 65f5d22411a2..f584a2e60d55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven
- 3.8.3-SNAPSHOT
+ 3.8.3pomApache Maven
@@ -77,7 +77,7 @@ under the License.
ref/3-LATESTNone**/package-info.java
- 2021-08-04T19:03:41Z
+ 2021-09-27T18:25:22Z
@@ -101,7 +101,7 @@ under the License.
scm:git:https://gitbox.apache.org/repos/asf/maven.gitscm:git:https://gitbox.apache.org/repos/asf/maven.githttps://github.com/apache/maven/tree/${project.scm.tag}
- maven-3.8.2
+ maven-3.8.3jira
From 21e597ec777f0b74eed4e067b58b6eb8b0c9fad4 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Mon, 27 Sep 2021 20:28:37 +0200
Subject: [PATCH 091/183] [maven-release-plugin] prepare for next development
iteration
---
apache-maven/pom.xml | 2 +-
maven-artifact/pom.xml | 2 +-
maven-builder-support/pom.xml | 2 +-
maven-compat/pom.xml | 2 +-
maven-core/pom.xml | 2 +-
maven-embedder/pom.xml | 2 +-
maven-model-builder/pom.xml | 2 +-
maven-model/pom.xml | 2 +-
maven-plugin-api/pom.xml | 2 +-
maven-repository-metadata/pom.xml | 2 +-
maven-resolver-provider/pom.xml | 2 +-
maven-settings-builder/pom.xml | 2 +-
maven-settings/pom.xml | 2 +-
maven-slf4j-provider/pom.xml | 2 +-
pom.xml | 4 ++--
15 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index c17f8a6d5e6a..5f713bb71c29 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTapache-maven
diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml
index 6cf8468499a4..68af732ea550 100644
--- a/maven-artifact/pom.xml
+++ b/maven-artifact/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-artifact
diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml
index 959d8ec3fc84..897fe185f4bc 100644
--- a/maven-builder-support/pom.xml
+++ b/maven-builder-support/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-builder-support
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index 75e2289d2f06..221bf2c19ccd 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-compat
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index d4c5111666c3..86aea1ff2319 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-core
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 1c632c93f884..af2cd81ce593 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-embedder
diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml
index 8cb1008a6675..e08f1af28731 100644
--- a/maven-model-builder/pom.xml
+++ b/maven-model-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-model-builder
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index df81d72f91c0..f7e07c866bac 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-model
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
index a1a72a1967b4..630a46cf283b 100644
--- a/maven-plugin-api/pom.xml
+++ b/maven-plugin-api/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-plugin-api
diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml
index 4b4cc2b88999..0c9e5318dc62 100644
--- a/maven-repository-metadata/pom.xml
+++ b/maven-repository-metadata/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-repository-metadata
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index 52e94e5c3c7b..f941dd0e3577 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-resolver-provider
diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml
index 677c13999c0c..2ffbd9457d8e 100644
--- a/maven-settings-builder/pom.xml
+++ b/maven-settings-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-settings-builder
diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml
index b77437c27c9a..c585d573387f 100644
--- a/maven-settings/pom.xml
+++ b/maven-settings/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-settings
diff --git a/maven-slf4j-provider/pom.xml b/maven-slf4j-provider/pom.xml
index eea89b72de1e..e63956fcf359 100644
--- a/maven-slf4j-provider/pom.xml
+++ b/maven-slf4j-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.3
+ 3.8.4-SNAPSHOTmaven-slf4j-provider
diff --git a/pom.xml b/pom.xml
index f584a2e60d55..a5848644d563 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven
- 3.8.3
+ 3.8.4-SNAPSHOTpomApache Maven
@@ -77,7 +77,7 @@ under the License.
ref/3-LATESTNone**/package-info.java
- 2021-09-27T18:25:22Z
+ 2021-09-27T18:28:35Z
From b6186e2c7714158b5a2709f4af9d40b194c53f55 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Mon, 27 Sep 2021 22:16:35 +0200
Subject: [PATCH 092/183] Remove swap file
---
.../src/main/assembly/.component.xml.swp | Bin 12288 -> 0 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 apache-maven/src/main/assembly/.component.xml.swp
diff --git a/apache-maven/src/main/assembly/.component.xml.swp b/apache-maven/src/main/assembly/.component.xml.swp
deleted file mode 100644
index 52c487e4a78f44dad9a6220103ec18dab7e0e89c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 12288
zcmeI2Ux*t;9LJ|sYpb?O1w{mz#)@sd?B=c%+iN^X?{XNt>p#tp?;n+atIrV|a#CCfJl4>gbba*>_Y%xqgrOqiBu*)5js7nErf
z)0S;d3MRDCZM%tQre9M9QUyj(AkdBM;hhTyC&qK3^@Eu`^zPjYBQ#7+QUy{4QUy{4
zQUy{4QUy{4QUy{4ZWINyw}m{1V7A5qHRI1MD?a05`jIM-Dv&CWDv&CWDv&CWDv&CW
zDv&CWDv&CWD)2v4z;X!r34XsB{sI7h{~!GS|H_?&dC3Q@E!beJ0V|#3*cFB7VHQ2g00}k+X%S`UIEX5BVZT!V+SGM
zf-k_Q;C*l&ya0S)g9Weye7T*F&%s;ZMG$}nI1L^Kzu!v8_uw;d5nKT0z#_S
zWg8(sfUm&YKm!{T!9lPW+yj2Tg^*9cyWmyefv3PxFa{m~zugR7`z9zO{FPsEEuR3HB9!LM26tJNX%&_d<$e(r
zGSFV2XSmO7E&bk<%jyQWQ|%?uTlDe+lYy?V
z*ptoDT8k@+e@ar_vNWA8QPoqLwH383K|SVk>2TX}-5&J=0V75|UxrTmG@DI4Ez#c$
zs|U@sdQ8}?x;=1s7{jW}*SQ!q6OrjA6Oqu>k!sUAA29mqAH*2vCXoqPw4MK6+=G!Z
z6h7(lfot#=ubsJQ3B|L*(tL@Hk~D4kO{PtUc}zG=*gZ3EZZdz@J&wARdK138+{RHk
zrp$i3f7|;J=gC<3q4U==XRfDwWxiILF0L9yi7_^Z`<3cylZ__?1A}Dal^~8VI*^!E
zEz4(4*7EHZMrPJ$N(R1-q?L=cLbgqn|_DL1W}2X=-CZYFU9YJePF?HQE2j+Ahv&oBgGFd%@2lqTbw^~NSaguo)&*blhGpxihUF?u9&6l*y3DVk!V19#(G7>+T60_|
z%_#A%nAkTSp6kyaYlOAwfUlMy3a+d8q{0E*wlybhOute*mT772O`84lxkmqdu7Rk{
zLbX~fADcUqot`frpRW`vHFLtq89Dk-4Z6x1p5)CAPx5A?Mh0$XrbvERO>w|isLl7D
z={KB2B*Vs?PRHmRjGUgpxn%Qnd9E4-ndL%hOV}(!!re%K#lw#_DRceV*dWSdHg9m7
zx|V1LR+G`DTw=b!hAQ0Nw7F6cNl{BU)a7liBheIjqEwj~ql{z6<5Sl4FjXijeahRO
z%b8Z=ytVyO&rKM_y9xGH!)iHXiRC|1Wp+-*?PMj!IYNcY8&Yz&u^Oc!W
ztu$XjX_gi$XNZyw-NEcc9j>&`>w#ttT@_HcSxXv70nf>Ta6|We_H=+9utV!TYI*R}
zw(2fJo3I7Ux0KTITrk91#{2A?%8KioG*-uS%P(o}W?%v#)o(=}{m3)NX9y}xcR
zdq9!`$Kk>`OnhgfBwLOH@uaX^IEk#cqai~eaa$sP*a!CWhl=>&eeH3SUaQ2w>937Z
k&?Jr{N)NoJad_3ipqP~iJ?e+
Date: Wed, 29 Sep 2021 11:29:35 +0100
Subject: [PATCH 093/183] [MNG-7270] Switch to shell alternative to "which"
In some circumstances the init script calls `which`, which may or may not be
available on the host system. Instead, use `command -v`, which is nearly
equivalent. One area it differs is if the command being queried is defined as
a shell alias. To avoid that, call `unset -f command` to avoid the situation
where "command" has been re-defined as a shell function.
See here for more information on this approach:
Tested with bash, sh (bash invoked as sh), posh, dash, zsh and mksh.
This closes #556
---
apache-maven/src/bin/mvn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 90f9a758d9cf..dfa384b8e141 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -94,7 +94,7 @@ if $mingw ; then
fi
if [ -z "$JAVA_HOME" ] ; then
- JAVACMD=`which java`
+ JAVACMD="`\\unset -f command; \\command -v java`"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
From 5c36bf5ef78a162cefea47ccdaf0d28e01c1426c Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sat, 16 Oct 2021 15:21:28 +0200
Subject: [PATCH 094/183] [MNG-7312] Revert ThreadLocal approach from MNG-6843
and MNG-7251
Revert "[MNG-7251] Fix threadLocalArtifactsHolder leaking into cloned project"
This reverts commit 4e5b3d55545e5f03f05ac7b0cd1b56689df36201.
Revert "[MNG-6843] Parallel build fails due to missing JAR artifacts in compilePath"
This reverts commit 76d5f0d942f52650d3bdf775b6af42d23d69066b.
===
This closes #595
---
.../apache/maven/project/MavenProject.java | 102 +++++++++---------
.../maven/project/MavenProjectTest.java | 43 --------
2 files changed, 48 insertions(+), 97 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
index 94d678814534..db0f4a90116f 100644
--- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
+++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
@@ -92,9 +92,13 @@
public class MavenProject
implements Cloneable
{
+
private static final Logger LOGGER = LoggerFactory.getLogger( MavenProject.class );
+
public static final String EMPTY_PROJECT_GROUP_ID = "unknown";
+
public static final String EMPTY_PROJECT_ARTIFACT_ID = "empty-project";
+
public static final String EMPTY_PROJECT_VERSION = "0";
private Model model;
@@ -107,6 +111,10 @@ public class MavenProject
private Set resolvedArtifacts;
+ private ArtifactFilter artifactFilter;
+
+ private Set artifacts;
+
private Artifact parentArtifact;
private Set pluginArtifacts;
@@ -143,7 +151,8 @@ public class MavenProject
private Artifact artifact;
- private ThreadLocal threadLocalArtifactsHolder = newThreadLocalArtifactsHolder();
+ // calculated.
+ private Map artifactMap;
private Model originalModel;
@@ -176,21 +185,12 @@ public class MavenProject
public MavenProject()
{
Model model = new Model();
+
model.setGroupId( EMPTY_PROJECT_GROUP_ID );
model.setArtifactId( EMPTY_PROJECT_ARTIFACT_ID );
model.setVersion( EMPTY_PROJECT_VERSION );
- setModel( model );
- }
- private static ThreadLocal newThreadLocalArtifactsHolder()
- {
- return new ThreadLocal()
- {
- protected ArtifactsHolder initialValue()
- {
- return new ArtifactsHolder();
- }
- };
+ setModel( model );
}
public MavenProject( Model model )
@@ -695,11 +695,10 @@ public void addLicense( License license )
public void setArtifacts( Set artifacts )
{
- ArtifactsHolder artifactsHolder = threadLocalArtifactsHolder.get();
- artifactsHolder.artifacts = artifacts;
+ this.artifacts = artifacts;
// flush the calculated artifactMap
- artifactsHolder.artifactMap = null;
+ artifactMap = null;
}
/**
@@ -712,36 +711,34 @@ public void setArtifacts( Set artifacts )
*/
public Set getArtifacts()
{
- ArtifactsHolder artifactsHolder = threadLocalArtifactsHolder.get();
- if ( artifactsHolder.artifacts == null )
+ if ( artifacts == null )
{
- if ( artifactsHolder.artifactFilter == null || resolvedArtifacts == null )
+ if ( artifactFilter == null || resolvedArtifacts == null )
{
- artifactsHolder.artifacts = new LinkedHashSet<>();
+ artifacts = new LinkedHashSet<>();
}
else
{
- artifactsHolder.artifacts = new LinkedHashSet<>( resolvedArtifacts.size() * 2 );
+ artifacts = new LinkedHashSet<>( resolvedArtifacts.size() * 2 );
for ( Artifact artifact : resolvedArtifacts )
{
- if ( artifactsHolder.artifactFilter.include( artifact ) )
+ if ( artifactFilter.include( artifact ) )
{
- artifactsHolder.artifacts.add( artifact );
+ artifacts.add( artifact );
}
}
}
}
- return artifactsHolder.artifacts;
+ return artifacts;
}
public Map getArtifactMap()
{
- ArtifactsHolder artifactsHolder = threadLocalArtifactsHolder.get();
- if ( artifactsHolder.artifactMap == null )
+ if ( artifactMap == null )
{
- artifactsHolder.artifactMap = ArtifactUtils.artifactMapByVersionlessId( getArtifacts() );
+ artifactMap = ArtifactUtils.artifactMapByVersionlessId( getArtifacts() );
}
- return artifactsHolder.artifactMap;
+ return artifactMap;
}
public void setPluginArtifacts( Set pluginArtifacts )
@@ -1186,8 +1183,7 @@ public MavenProject clone()
{
throw new UnsupportedOperationException( e );
}
- // clone must have it's own TL, otherwise the artifacts are intermingled!
- clone.threadLocalArtifactsHolder = newThreadLocalArtifactsHolder();
+
clone.deepCopy( this );
return clone;
@@ -1230,7 +1226,6 @@ private void deepCopy( MavenProject project )
// copy fields
file = project.file;
basedir = project.basedir;
- threadLocalArtifactsHolder.set( project.threadLocalArtifactsHolder.get().copy() );
// don't need a deep copy, they don't get modified or added/removed to/from - but make them unmodifiable to be
// sure!
@@ -1239,6 +1234,11 @@ private void deepCopy( MavenProject project )
setDependencyArtifacts( Collections.unmodifiableSet( project.getDependencyArtifacts() ) );
}
+ if ( project.getArtifacts() != null )
+ {
+ setArtifacts( Collections.unmodifiableSet( project.getArtifacts() ) );
+ }
+
if ( project.getParentFile() != null )
{
parentFile = new File( project.getParentFile().getAbsolutePath() );
@@ -1433,9 +1433,8 @@ public DependencyFilter getExtensionDependencyFilter()
public void setResolvedArtifacts( Set artifacts )
{
this.resolvedArtifacts = ( artifacts != null ) ? artifacts : Collections.emptySet();
- ArtifactsHolder artifactsHolder = threadLocalArtifactsHolder.get();
- artifactsHolder.artifacts = null;
- artifactsHolder.artifactMap = null;
+ this.artifacts = null;
+ this.artifactMap = null;
}
/**
@@ -1448,10 +1447,9 @@ public void setResolvedArtifacts( Set artifacts )
*/
public void setArtifactFilter( ArtifactFilter artifactFilter )
{
- ArtifactsHolder artifactsHolder = threadLocalArtifactsHolder.get();
- artifactsHolder.artifactFilter = artifactFilter;
- artifactsHolder.artifacts = null;
- artifactsHolder.artifactMap = null;
+ this.artifactFilter = artifactFilter;
+ this.artifacts = null;
+ this.artifactMap = null;
}
/**
@@ -1481,7 +1479,13 @@ public void addLifecyclePhase( String lifecyclePhase )
// ----------------------------------------------------------------------------------------------------------------
//
- // D E P R E C A T E D - Everything below will be removed for Maven 4.0.0
+ //
+ // D E P R E C A T E D
+ //
+ //
+ // ----------------------------------------------------------------------------------------------------------------
+ //
+ // Everything below will be removed for Maven 4.0.0
//
// ----------------------------------------------------------------------------------------------------------------
@@ -1502,6 +1506,7 @@ public String getModulePathAdjustment( MavenProject moduleProject )
if ( moduleFile != null )
{
File moduleDir = moduleFile.getCanonicalFile().getParentFile();
+
module = moduleDir.getName();
}
@@ -1822,6 +1827,7 @@ public Reporting getReporting()
public void setReportArtifacts( Set reportArtifacts )
{
this.reportArtifacts = reportArtifacts;
+
reportArtifactMap = null;
}
@@ -1838,6 +1844,7 @@ public Map getReportArtifactMap()
{
reportArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getReportArtifacts() );
}
+
return reportArtifactMap;
}
@@ -1845,6 +1852,7 @@ public Map getReportArtifactMap()
public void setExtensionArtifacts( Set extensionArtifacts )
{
this.extensionArtifacts = extensionArtifacts;
+
extensionArtifactMap = null;
}
@@ -1861,6 +1869,7 @@ public Map getExtensionArtifactMap()
{
extensionArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getExtensionArtifacts() );
}
+
return extensionArtifactMap;
}
@@ -1878,6 +1887,7 @@ public List getReportPlugins()
public Xpp3Dom getReportConfiguration( String pluginGroupId, String pluginArtifactId, String reportSetId )
{
Xpp3Dom dom = null;
+
// ----------------------------------------------------------------------
// I would like to be able to lookup the Mojo object using a key but
// we have a limitation in modello that will be remedied shortly. So
@@ -1981,20 +1991,4 @@ public void setProjectBuildingRequest( ProjectBuildingRequest projectBuildingReq
{
this.projectBuilderConfiguration = projectBuildingRequest;
}
-
- private static class ArtifactsHolder
- {
- private ArtifactFilter artifactFilter;
- private Set artifacts;
- private Map artifactMap;
-
- ArtifactsHolder copy()
- {
- ArtifactsHolder copy = new ArtifactsHolder();
- copy.artifactFilter = artifactFilter;
- copy.artifacts = artifacts != null ? new LinkedHashSet<>( artifacts ) : null;
- copy.artifactMap = artifactMap != null ? new LinkedHashMap<>( artifactMap ) : null;
- return copy;
- }
- }
}
diff --git a/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java b/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java
index 2344d8f77345..6b4258b3fde9 100644
--- a/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java
@@ -21,18 +21,13 @@
import java.io.File;
import java.io.IOException;
-import java.util.Collections;
import java.util.List;
import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
-import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.model.Profile;
-import org.mockito.Mockito;
public class MavenProjectTest
extends AbstractMavenProjectTestCase
@@ -193,44 +188,6 @@ public void testCloneWithBaseDir()
assertEquals( "Base directory is preserved across clone", projectToClone.getBasedir(), clonedProject.getBasedir() );
}
- public void testCloneWithArtifacts()
- throws InterruptedException
- {
- Artifact initialArtifact = Mockito.mock( Artifact.class, "initialArtifact" );
- MavenProject originalProject = new MavenProject();
- originalProject.setArtifacts( Collections.singleton( initialArtifact ) );
- assertEquals( "Sanity check: originalProject returns artifact that has just been set",
- Collections.singleton( initialArtifact ), originalProject.getArtifacts() );
-
- final MavenProject clonedProject = originalProject.clone();
-
- assertEquals( "Cloned project returns the artifact that was set for the original project",
- Collections.singleton( initialArtifact ), clonedProject.getArtifacts() );
-
- Artifact anotherArtifact = Mockito.mock( Artifact.class, "anotherArtifact" );
- clonedProject.setArtifacts( Collections.singleton( anotherArtifact ) );
- assertEquals( "Sanity check: clonedProject returns artifact that has just been set",
- Collections.singleton( anotherArtifact ), clonedProject.getArtifacts() );
-
- assertEquals( "Original project returns the artifact that was set initially (not the one for clonedProject)",
- Collections.singleton( initialArtifact ), originalProject.getArtifacts() );
-
- final AtomicReference> artifactsFromThread = new AtomicReference<>();
- Thread thread = new Thread( new Runnable()
- {
- @Override
- public void run()
- {
- artifactsFromThread.set( clonedProject.getArtifacts() );
- }
- } );
- thread.start();
- thread.join();
-
- assertEquals( "Another thread does not see the same artifacts",
- Collections.emptySet(), artifactsFromThread.get() );
- }
-
public void testUndefinedOutputDirectory()
throws Exception
{
From 19c3b917b3604f93fef0583a08e70f8695d3a359 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Fri, 12 Nov 2021 18:58:57 +0100
Subject: [PATCH 095/183] [MNG-7331] Upgrade Jansi to 2.4.0
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a5848644d563..02b9cc95604b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -300,7 +300,7 @@ under the License.
org.fusesource.jansijansi
- 2.3.4
+ 2.4.0org.slf4j
From 9b656c72d54e5bacbed989b64718c159fe39b537 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sun, 14 Nov 2021 10:14:42 +0100
Subject: [PATCH 096/183] [maven-release-plugin] prepare release maven-3.8.4
---
apache-maven/pom.xml | 2 +-
maven-artifact/pom.xml | 2 +-
maven-builder-support/pom.xml | 2 +-
maven-compat/pom.xml | 2 +-
maven-core/pom.xml | 2 +-
maven-embedder/pom.xml | 2 +-
maven-model-builder/pom.xml | 2 +-
maven-model/pom.xml | 2 +-
maven-plugin-api/pom.xml | 2 +-
maven-repository-metadata/pom.xml | 2 +-
maven-resolver-provider/pom.xml | 2 +-
maven-settings-builder/pom.xml | 2 +-
maven-settings/pom.xml | 2 +-
maven-slf4j-provider/pom.xml | 2 +-
pom.xml | 6 +++---
15 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index 5f713bb71c29..1c979bce60d0 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4apache-maven
diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml
index 68af732ea550..2ddb8c761aa3 100644
--- a/maven-artifact/pom.xml
+++ b/maven-artifact/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-artifact
diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml
index 897fe185f4bc..d33e3b1e9eda 100644
--- a/maven-builder-support/pom.xml
+++ b/maven-builder-support/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-builder-support
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index 221bf2c19ccd..d95264559ccf 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-compat
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 86aea1ff2319..32fb86fb8313 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-core
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index af2cd81ce593..f732b8957d40 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-embedder
diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml
index e08f1af28731..485553de88c8 100644
--- a/maven-model-builder/pom.xml
+++ b/maven-model-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-model-builder
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index f7e07c866bac..007ecbcdaf65 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-model
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
index 630a46cf283b..0c399f4a83c0 100644
--- a/maven-plugin-api/pom.xml
+++ b/maven-plugin-api/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-plugin-api
diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml
index 0c9e5318dc62..9caa582bc7d7 100644
--- a/maven-repository-metadata/pom.xml
+++ b/maven-repository-metadata/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-repository-metadata
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index f941dd0e3577..cb3c950035a1 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-resolver-provider
diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml
index 2ffbd9457d8e..3a53bd97cb40 100644
--- a/maven-settings-builder/pom.xml
+++ b/maven-settings-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-settings-builder
diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml
index c585d573387f..b2e5ef895f5e 100644
--- a/maven-settings/pom.xml
+++ b/maven-settings/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-settings
diff --git a/maven-slf4j-provider/pom.xml b/maven-slf4j-provider/pom.xml
index e63956fcf359..e848870a9c8b 100644
--- a/maven-slf4j-provider/pom.xml
+++ b/maven-slf4j-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4-SNAPSHOT
+ 3.8.4maven-slf4j-provider
diff --git a/pom.xml b/pom.xml
index 02b9cc95604b..e739a027b0d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven
- 3.8.4-SNAPSHOT
+ 3.8.4pomApache Maven
@@ -77,7 +77,7 @@ under the License.
ref/3-LATESTNone**/package-info.java
- 2021-09-27T18:28:35Z
+ 2021-11-14T09:12:47Z
@@ -101,7 +101,7 @@ under the License.
scm:git:https://gitbox.apache.org/repos/asf/maven.gitscm:git:https://gitbox.apache.org/repos/asf/maven.githttps://github.com/apache/maven/tree/${project.scm.tag}
- maven-3.8.3
+ maven-3.8.4jira
From 8af0a674db7cf1199d62e1cba60e29f84a144129 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sun, 14 Nov 2021 10:14:54 +0100
Subject: [PATCH 097/183] [maven-release-plugin] prepare for next development
iteration
---
apache-maven/pom.xml | 2 +-
maven-artifact/pom.xml | 2 +-
maven-builder-support/pom.xml | 2 +-
maven-compat/pom.xml | 2 +-
maven-core/pom.xml | 2 +-
maven-embedder/pom.xml | 2 +-
maven-model-builder/pom.xml | 2 +-
maven-model/pom.xml | 2 +-
maven-plugin-api/pom.xml | 2 +-
maven-repository-metadata/pom.xml | 2 +-
maven-resolver-provider/pom.xml | 2 +-
maven-settings-builder/pom.xml | 2 +-
maven-settings/pom.xml | 2 +-
maven-slf4j-provider/pom.xml | 2 +-
pom.xml | 6 +++---
15 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index 1c979bce60d0..6e12bb0e4d4c 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTapache-maven
diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml
index 2ddb8c761aa3..0ced0ebe53f0 100644
--- a/maven-artifact/pom.xml
+++ b/maven-artifact/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-artifact
diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml
index d33e3b1e9eda..9851384a8034 100644
--- a/maven-builder-support/pom.xml
+++ b/maven-builder-support/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-builder-support
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index d95264559ccf..c3715e6298be 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-compat
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 32fb86fb8313..ab8c71379277 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-core
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index f732b8957d40..c180c865ea66 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-embedder
diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml
index 485553de88c8..bf0b0f9f256a 100644
--- a/maven-model-builder/pom.xml
+++ b/maven-model-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-model-builder
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index 007ecbcdaf65..db70815c092a 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-model
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
index 0c399f4a83c0..ab836127524a 100644
--- a/maven-plugin-api/pom.xml
+++ b/maven-plugin-api/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-plugin-api
diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml
index 9caa582bc7d7..31c0418b0c98 100644
--- a/maven-repository-metadata/pom.xml
+++ b/maven-repository-metadata/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-repository-metadata
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index cb3c950035a1..62ff3f26c60c 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-resolver-provider
diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml
index 3a53bd97cb40..6391cf223fd1 100644
--- a/maven-settings-builder/pom.xml
+++ b/maven-settings-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-settings-builder
diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml
index b2e5ef895f5e..36dd1923ab1f 100644
--- a/maven-settings/pom.xml
+++ b/maven-settings/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-settings
diff --git a/maven-slf4j-provider/pom.xml b/maven-slf4j-provider/pom.xml
index e848870a9c8b..d12d0aedffba 100644
--- a/maven-slf4j-provider/pom.xml
+++ b/maven-slf4j-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.mavenmaven
- 3.8.4
+ 3.8.5-SNAPSHOTmaven-slf4j-provider
diff --git a/pom.xml b/pom.xml
index e739a027b0d9..5704043efefe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven
- 3.8.4
+ 3.8.5-SNAPSHOTpomApache Maven
@@ -77,7 +77,7 @@ under the License.
ref/3-LATESTNone**/package-info.java
- 2021-11-14T09:12:47Z
+ 2021-11-14T09:14:52Z
@@ -101,7 +101,7 @@ under the License.
scm:git:https://gitbox.apache.org/repos/asf/maven.gitscm:git:https://gitbox.apache.org/repos/asf/maven.githttps://github.com/apache/maven/tree/${project.scm.tag}
- maven-3.8.4
+ maven-3.8.3jira
From ed3279809cad6c77cd8e5c217230c612d1222d9a Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sun, 3 Oct 2021 18:47:20 +0200
Subject: [PATCH 098/183] Update DOAP with Maven 3.8.3 release
---
doap_Maven.rdf | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/doap_Maven.rdf b/doap_Maven.rdf
index 531df1217a61..1a1f8edb036f 100644
--- a/doap_Maven.rdf
+++ b/doap_Maven.rdf
@@ -33,6 +33,15 @@ under the License.
Latest stable release
+ 2021-09-27
+ 3.8.3
+ http://archive.apache.org/dist/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.zip
+ http://archive.apache.org/dist/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.tar.gz
+ http://archive.apache.org/dist/maven/maven-3/3.8.3/source/apache-maven-3.8.3-src.zip
+ http://archive.apache.org/dist/maven/maven-3/3.8.3/source/apache-maven-3.8.3-src.tar.gz
+
+
+ Apache Maven 3.8.22021-08-043.8.2http://archive.apache.org/dist/maven/maven-3/3.8.2/binaries/apache-maven-3.8.2-bin.zip
From f568170e361ee2f448227ec4c2bce5a2ab2aa99d Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sat, 20 Nov 2021 15:55:23 +0100
Subject: [PATCH 099/183] Update DOAP with Maven 3.8.4 release
---
doap_Maven.rdf | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/doap_Maven.rdf b/doap_Maven.rdf
index 1a1f8edb036f..07185589da38 100644
--- a/doap_Maven.rdf
+++ b/doap_Maven.rdf
@@ -33,6 +33,15 @@ under the License.
Latest stable release
+ 2021-11-14
+ 3.8.4
+ http://archive.apache.org/dist/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.zip
+ http://archive.apache.org/dist/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz
+ http://archive.apache.org/dist/maven/maven-3/3.8.4/source/apache-maven-3.8.4-src.zip
+ http://archive.apache.org/dist/maven/maven-3/3.8.4/source/apache-maven-3.8.4-src.tar.gz
+
+
+ Apache Maven 3.8.32021-09-273.8.3http://archive.apache.org/dist/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.zip
From 5bc395fd08719f221e10998db13475110d510651 Mon Sep 17 00:00:00 2001
From: Guillaume Nodet
Date: Wed, 1 Dec 2021 19:42:20 +0100
Subject: [PATCH 100/183] Add github checks to maven-3.8.x branch
---
.github/workflows/maven.yml | 147 ++++++++++++++++++++++++++++++++++++
1 file changed, 147 insertions(+)
create mode 100644 .github/workflows/maven.yml
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644
index 000000000000..addba89d6393
--- /dev/null
+++ b/.github/workflows/maven.yml
@@ -0,0 +1,147 @@
+# 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.
+
+name: Java CI
+
+on: [push, pull_request]
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest, macOS-latest]
+ fail-fast: false
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-java@v2
+ with:
+ java-version: 8
+ distribution: 'temurin'
+ cache: 'maven'
+
+ - name: Build with Maven
+ run: mvn verify -e -B -V -DdistributionFileName=apache-maven
+
+ - name: Upload built Maven
+ uses: actions/upload-artifact@v2
+ if: ${{ matrix.os == 'ubuntu-latest' }}
+ with:
+ name: built-maven
+ path: apache-maven/target/
+
+ - name: Upload built Apache Maven Wrapper
+ uses: actions/upload-artifact@v2
+ if: ${{ matrix.os == 'ubuntu-latest' }}
+ with:
+ name: built-apache-maven-wrapper
+ path: apache-maven-wrapper/target/
+
+ - name: Upload built Maven Wrapper
+ uses: actions/upload-artifact@v2
+ if: ${{ matrix.os == 'ubuntu-latest' }}
+ with:
+ name: built-maven-wrapper
+ path: maven-wrapper/target/maven-wrapper.jar
+
+ integration-test:
+ needs: build
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest, macOS-latest]
+ java: [8, 11, 17]
+
+ fail-fast: false
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - name: Collect environment context variables
+ shell: bash
+ env:
+ PR_HEAD_LABEL: ${{ github.event.pull_request.head.label }}
+ run: |
+ set +e
+ repo=maven-integration-testing
+ target_branch=master
+ target_user=apache
+ if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
+ user=${PR_HEAD_LABEL%:*}
+ branch=${PR_HEAD_LABEL#*:}
+ else
+ user=${GITHUB_REPOSITORY%/*}
+ branch=${GITHUB_REF#refs/heads/}
+ fi
+ if [ $branch != "master" ]; then
+ git ls-remote https://github.com/$user/$repo.git | grep "refs/heads/${branch}$" > /dev/null
+ if [ $? -eq 0 ]; then
+ echo "Found a branch \"$branch\" in fork \"$user/$repo\", configuring this for the integration tests to be run against."
+ target_branch=$branch
+ target_user=$user
+ else
+ echo "Could not find fork \"$user/$repo\" or a branch \"$branch\" in this fork. Falling back to \"$target_branch\" in \"$target_user/$repo\"."
+ fi
+ else
+ echo "Integration tests will run against $target_user/$repo for master builds."
+ fi
+ echo "REPO_BRANCH=$target_branch" >> $GITHUB_ENV
+ echo "REPO_USER=$target_user" >> $GITHUB_ENV
+
+ - name: Checkout maven-integration-testing
+ uses: actions/checkout@v2
+ with:
+ repository: ${{ env.REPO_USER }}/maven-integration-testing
+ path: maven-integration-testing/
+ ref: ${{ env.REPO_BRANCH }}
+
+ - name: Set up cache for ~/.m2/repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: it-m2-repo-${{ matrix.os }}-${{ hashFiles('maven-integration-testing/**/pom.xml') }}
+ restore-keys: |
+ it-m2-repo-${{ matrix.os }}-
+
+ - name: Download built Maven
+ uses: actions/download-artifact@v2
+ with:
+ name: built-maven
+ path: built-maven/
+
+ - name: Download built Apache Maven Wrapper
+ uses: actions/download-artifact@v2
+ with:
+ name: built-apache-maven-wrapper
+ path: built-apache-maven-wrapper/
+
+ - name: Download built Maven Wrapper
+ uses: actions/download-artifact@v2
+ with:
+ name: built-maven-wrapper
+ path: built-maven-wrapper/
+
+ - name: Set up JDK
+ uses: actions/setup-java@v2
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: 'temurin'
+ cache: 'maven'
+
+ - name: Running integration tests
+ shell: bash
+ run: mvn install -e -B -V -Prun-its,embedded -Dmaven.repo.local="$HOME/.m2/repository" -DmavenDistro="$GITHUB_WORKSPACE/built-maven/apache-maven-bin.zip" -DwrapperDistroDir="$GITHUB_WORKSPACE/built-apache-maven-wrapper/" -DmavenWrapper="$GITHUB_WORKSPACE/built-maven-wrapper/maven-wrapper.jar" -f maven-integration-testing/pom.xml
From 803c2155548f7d985e2f7afeb36f29761b5b1b49 Mon Sep 17 00:00:00 2001
From: Guillaume Nodet
Date: Thu, 2 Dec 2021 08:36:32 +0100
Subject: [PATCH 101/183] Fix github checks
---
.github/workflows/maven.yml | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index addba89d6393..3b82ac148897 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -46,20 +46,6 @@ jobs:
name: built-maven
path: apache-maven/target/
- - name: Upload built Apache Maven Wrapper
- uses: actions/upload-artifact@v2
- if: ${{ matrix.os == 'ubuntu-latest' }}
- with:
- name: built-apache-maven-wrapper
- path: apache-maven-wrapper/target/
-
- - name: Upload built Maven Wrapper
- uses: actions/upload-artifact@v2
- if: ${{ matrix.os == 'ubuntu-latest' }}
- with:
- name: built-maven-wrapper
- path: maven-wrapper/target/maven-wrapper.jar
-
integration-test:
needs: build
strategy:
@@ -123,18 +109,6 @@ jobs:
name: built-maven
path: built-maven/
- - name: Download built Apache Maven Wrapper
- uses: actions/download-artifact@v2
- with:
- name: built-apache-maven-wrapper
- path: built-apache-maven-wrapper/
-
- - name: Download built Maven Wrapper
- uses: actions/download-artifact@v2
- with:
- name: built-maven-wrapper
- path: built-maven-wrapper/
-
- name: Set up JDK
uses: actions/setup-java@v2
with:
@@ -144,4 +118,4 @@ jobs:
- name: Running integration tests
shell: bash
- run: mvn install -e -B -V -Prun-its,embedded -Dmaven.repo.local="$HOME/.m2/repository" -DmavenDistro="$GITHUB_WORKSPACE/built-maven/apache-maven-bin.zip" -DwrapperDistroDir="$GITHUB_WORKSPACE/built-apache-maven-wrapper/" -DmavenWrapper="$GITHUB_WORKSPACE/built-maven-wrapper/maven-wrapper.jar" -f maven-integration-testing/pom.xml
+ run: mvn install -e -B -V -Prun-its,embedded -Dmaven.repo.local="$HOME/.m2/repository" -DmavenDistro="$GITHUB_WORKSPACE/built-maven/apache-maven-bin.zip" -f maven-integration-testing/pom.xml
From 10a72f30f7bdd19e803820a215383b975a5283ce Mon Sep 17 00:00:00 2001
From: Guillaume Nodet
Date: Fri, 17 Dec 2021 08:42:18 +0100
Subject: [PATCH 102/183] [MNG-7156][MNG-7285] Add locking in MojoExecutor
(#628)
---
.../lifecycle/internal/MojoExecutor.java | 91 +++++++++++++++++++
.../maven/project/ProjectBuilderTest.java | 13 +++
2 files changed, 104 insertions(+)
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
index b78f54dc42f3..cf97c8cab954 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
@@ -39,6 +39,7 @@
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.util.StringUtils;
+import org.eclipse.aether.SessionData;
import java.util.ArrayList;
import java.util.Arrays;
@@ -48,6 +49,12 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
*
@@ -76,6 +83,8 @@ public class MojoExecutor
@Requirement
private ExecutionEventCatapult eventCatapult;
+ private final ReadWriteLock aggregatorLock = new ReentrantReadWriteLock();
+
public MojoExecutor()
{
}
@@ -197,6 +206,88 @@ private void execute( MavenSession session, MojoExecution mojoExecution, Project
}
}
+ try ( ProjectLock lock = new ProjectLock( session, mojoDescriptor, aggregatorLock ) )
+ {
+ doExecute( session, mojoExecution, projectIndex, dependencyContext );
+ }
+ }
+
+ /**
+ * Aggregating mojo executions (possibly) modify all MavenProjects, including those that are currently in use
+ * by concurrently running mojo executions. To prevent race conditions, an aggregating execution will block
+ * all other executions until finished.
+ * We also lock on a given project to forbid a forked lifecycle to be executed concurrently with the project.
+ * TODO: ideally, the builder should take care of the ordering in a smarter way
+ * TODO: and concurrency issues fixed with MNG-7157
+ */
+ private static class ProjectLock implements AutoCloseable
+ {
+ final Lock acquiredAggregatorLock;
+ final Lock acquiredProjectLock;
+
+ ProjectLock( MavenSession session, MojoDescriptor mojoDescriptor, ReadWriteLock aggregatorLock )
+ {
+ if ( session.getRequest().getDegreeOfConcurrency() > 1 )
+ {
+ boolean aggregator = mojoDescriptor.isAggregator();
+ acquiredAggregatorLock = aggregator ? aggregatorLock.writeLock() : aggregatorLock.readLock();
+ acquiredProjectLock = getProjectLock( session );
+ acquiredAggregatorLock.lock();
+ acquiredProjectLock.lock();
+ }
+ else
+ {
+ acquiredAggregatorLock = null;
+ acquiredProjectLock = null;
+ }
+ }
+
+ @Override
+ public void close()
+ {
+ // release the lock in the reverse order of the acquisition
+ if ( acquiredProjectLock != null )
+ {
+ acquiredProjectLock.unlock();
+ }
+ if ( acquiredAggregatorLock != null )
+ {
+ acquiredAggregatorLock.unlock();
+ }
+ }
+
+ @SuppressWarnings( { "unchecked", "rawtypes" } )
+ private Lock getProjectLock( MavenSession session )
+ {
+ SessionData data = session.getRepositorySession().getData();
+ ConcurrentMap locks = ( ConcurrentMap ) data.get( ProjectLock.class );
+ // initialize the value if not already done (in case of a concurrent access) to the method
+ if ( locks == null )
+ {
+ // the call to data.set(k, null, v) is effectively a call to data.putIfAbsent(k, v)
+ data.set( ProjectLock.class, null, new ConcurrentHashMap<>() );
+ locks = ( ConcurrentMap ) data.get( ProjectLock.class );
+ }
+ Lock acquiredProjectLock = locks.get( session.getCurrentProject() );
+ if ( acquiredProjectLock == null )
+ {
+ acquiredProjectLock = new ReentrantLock();
+ Lock prev = locks.putIfAbsent( session.getCurrentProject(), acquiredProjectLock );
+ if ( prev != null )
+ {
+ acquiredProjectLock = prev;
+ }
+ }
+ return acquiredProjectLock;
+ }
+ }
+
+ private void doExecute( MavenSession session, MojoExecution mojoExecution, ProjectIndex projectIndex,
+ DependencyContext dependencyContext )
+ throws LifecycleExecutionException
+ {
+ MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
+
List forkedProjects = executeForkedExecutions( mojoExecution, session, projectIndex );
ensureDependenciesAreResolved( mojoDescriptor, session, dependencyContext );
diff --git a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
index 6adb10e8f4e2..40ba60dadfeb 100644
--- a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
@@ -32,6 +32,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Properties;
+import java.util.concurrent.atomic.AtomicInteger;
import org.apache.maven.AbstractCoreMavenComponentTestCase;
import org.apache.maven.artifact.InvalidArtifactRTException;
@@ -119,6 +120,18 @@ public void testResolveDependencies()
assertEquals( 1, results.size() );
MavenProject mavenProject = results.get( 0 ).getProject();
assertEquals( 1, mavenProject.getArtifacts().size() );
+
+ final MavenProject project = mavenProject;
+ final AtomicInteger artifactsResultInAnotherThead = new AtomicInteger();
+ Thread t = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ artifactsResultInAnotherThead.set(project.getArtifacts().size());
+ }
+ });
+ t.start();
+ t.join();
+ assertEquals( project.getArtifacts().size(), artifactsResultInAnotherThead.get() );
}
public void testDontResolveDependencies()
From 4ff27db4f9111fbd4268d66b8f18dd44b61df0ee Mon Sep 17 00:00:00 2001
From: Guillaume Nodet
Date: Fri, 17 Dec 2021 08:57:42 +0100
Subject: [PATCH 103/183] [MNG-7156][MNG-7285] Fix typo in test
---
.../java/org/apache/maven/project/ProjectBuilderTest.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
index 40ba60dadfeb..aae5f24baa6f 100644
--- a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
@@ -122,16 +122,16 @@ public void testResolveDependencies()
assertEquals( 1, mavenProject.getArtifacts().size() );
final MavenProject project = mavenProject;
- final AtomicInteger artifactsResultInAnotherThead = new AtomicInteger();
+ final AtomicInteger artifactsResultInAnotherThread = new AtomicInteger();
Thread t = new Thread(new Runnable() {
@Override
public void run() {
- artifactsResultInAnotherThead.set(project.getArtifacts().size());
+ artifactsResultInAnotherThread.set(project.getArtifacts().size());
}
});
t.start();
t.join();
- assertEquals( project.getArtifacts().size(), artifactsResultInAnotherThead.get() );
+ assertEquals( project.getArtifacts().size(), artifactsResultInAnotherThread.get() );
}
public void testDontResolveDependencies()
From 6ae4f7e2c54113192fdd4b7efe8404088f21539f Mon Sep 17 00:00:00 2001
From: Sylwester Lachiewicz
Date: Fri, 17 Dec 2021 11:01:47 +0100
Subject: [PATCH 104/183] Bump Java to 17
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 5d5d998c0398..4d411dbbde7c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -23,7 +23,7 @@ def buildOs = 'linux'
def buildJdk = '8'
def buildMvn = '3.6.0'
def runITsOses = ['linux', 'windows']
-def runITsJdks = ['7', '8', '11','12']
+def runITsJdks = ['7', '8', '11','17']
def runITsMvn = '3.6.0'
def runITscommand = "mvn clean install -Prun-its,embedded -B -U -V" // -DmavenDistro=... -Dmaven.test.failure.ignore=true
def tests
From 8348d2bd0a22bf50bbbe7401ec4e848ff0f32da3 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sun, 26 Dec 2021 22:11:40 +0100
Subject: [PATCH 105/183] Fix SLF4J license link
---
.../main/appended-resources/licenses/MIT-slf4j-api-1.7.32.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.32.txt b/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.32.txt
index ec8e1107be01..712cd8c141d0 100644
--- a/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.32.txt
+++ b/apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.32.txt
@@ -1,4 +1,4 @@
-https://raw.githubusercontent.com/qos-ch/slf4j/v_1.7.30/LICENSE.txt
+https://raw.githubusercontent.com/qos-ch/slf4j/v_1.7.32/LICENSE.txt
Copyright (c) 2004-2017 QOS.ch
All rights reserved.
From 100b17e1d7163cd263b7ee6e372ab76b3f87dd08 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sun, 26 Dec 2021 19:55:01 +0100
Subject: [PATCH 106/183] [MNG-7370] Upgrade Maven Wagon to 3.5.1
This closes #644
---
apache-maven/pom.xml | 8 -------
.../licenses/MIT-jsoup-1.12.1.txt | 23 -------------------
apache-maven/src/main/assembly/component.xml | 1 -
pom.xml | 11 +--------
4 files changed, 1 insertion(+), 42 deletions(-)
delete mode 100644 apache-maven/src/main/appended-resources/licenses/MIT-jsoup-1.12.1.txt
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index 6e12bb0e4d4c..f8be416504c6 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -79,14 +79,6 @@ under the License.
-
-
- org.jsoup
- jsoup
- runtime
- org.slf4jjcl-over-slf4j
diff --git a/apache-maven/src/main/appended-resources/licenses/MIT-jsoup-1.12.1.txt b/apache-maven/src/main/appended-resources/licenses/MIT-jsoup-1.12.1.txt
deleted file mode 100644
index fa8a44e09e62..000000000000
--- a/apache-maven/src/main/appended-resources/licenses/MIT-jsoup-1.12.1.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-https://raw.githubusercontent.com/jhy/jsoup/jsoup-1.12.1/LICENSE
-
-The MIT License
-
-Copyright (c) 2009-2019 Jonathan Hedley
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/apache-maven/src/main/assembly/component.xml b/apache-maven/src/main/assembly/component.xml
index ad16c25fb843..c3014bd06859 100644
--- a/apache-maven/src/main/assembly/component.xml
+++ b/apache-maven/src/main/assembly/component.xml
@@ -31,7 +31,6 @@ under the License.
liborg.codehaus.plexus:plexus-classworlds
- org.jsoup:jsoup
diff --git a/pom.xml b/pom.xml
index 5704043efefe..102419305b62 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,8 +59,7 @@ under the License.
3.3.04.2.20.3.5
- 3.4.3
- 1.12.1
+ 3.5.12.02.01.11
@@ -342,14 +341,6 @@ under the License.
-
-
- org.jsoup
- jsoup
- ${jsoupVersion}
- org.apache.maven.resolver
From e09baa8ac4fcef82baacba4a66386f7479c753d9 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Thu, 30 Dec 2021 14:52:36 +0100
Subject: [PATCH 107/183] Improve PR template
---
.github/pull_request_template.md | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 2208cd74948c..b4a4f833345b 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,17 +1,16 @@
-Following this checklist to help us incorporate your
+Following this checklist to help us incorporate your
contribution quickly and easily:
- - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed
- for the change (usually before you start working on it). Trivial changes like typos do not
- require a JIRA issue. Your pull request should address just this issue, without
+ - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed
+ for the change (usually before you start working on it). Trivial changes like typos do not
+ require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- - [ ] Format the pull request title like `[MNG-XXX] - Fixes bug in ApproximateQuantiles`,
- where you replace `MNG-XXX` with the appropriate JIRA issue. Best practice
- is to use the JIRA issue title in the pull request title and in the first line of the
- commit message.
+ - [ ] Format the pull request title like `[MNG-XXX] SUMMARY`, where you replace `MNG-XXX`
+ and `SUMMARY` with the appropriate JIRA issue. Best practice is to use the JIRA issue
+ title in the pull request title and in the first line of the commit message.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
+ - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
be performed on your pull request automatically.
- [ ] You have run the [Core IT][core-its] successfully.
@@ -19,7 +18,7 @@ If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
-To make clear that you license your contribution under
+To make clear that you license your contribution under
the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
From d173bf9cc5e6a4f550a9b50f99eca3561b1ca40e Mon Sep 17 00:00:00 2001
From: Jeff Hodges
Date: Wed, 29 Dec 2021 01:19:03 -0800
Subject: [PATCH 108/183] [MNG-7377] Add .vscode/ to .gitignore
VS Code creates directories with configurations in project directories. This
is usually fine, but triggers the `apache-rat` license alarms and future
VS Code users might accidentally commit the directory.
To solve the alarm and avoid future issues, we add it to .gitignore.
This closes #646
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index f85dc5684299..28aa49bdc335 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@ out/
.java-version
.factorypath
.checkstyle
+.vscode/
From ef74a62451684c8c60cc9db4b6720c8edb89a165 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sat, 25 Dec 2021 12:28:18 +0100
Subject: [PATCH 109/183] [MNG-7374] Mutating RelocatedArtifact does not retain
type
This closes #641
---
.../internal/RelocatedArtifact.java | 34 +++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
index 2e277f0e4c1d..4614ccfe5c5c 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
@@ -86,6 +86,40 @@ public String getVersion()
}
}
+ // Revise these three methods when MRESOLVER-233 is delivered
+ @Override
+ public Artifact setVersion( String version )
+ {
+ String current = getVersion();
+ if ( current.equals( version ) || ( version == null && current.length() <= 0 ) )
+ {
+ return this;
+ }
+ return new RelocatedArtifact( artifact, groupId, artifactId, version );
+ }
+
+ @Override
+ public Artifact setFile( File file )
+ {
+ File current = getFile();
+ if ( Objects.equals( current, file ) )
+ {
+ return this;
+ }
+ return new RelocatedArtifact( artifact.setFile( file ), groupId, artifactId, version );
+ }
+
+ @Override
+ public Artifact setProperties( Map properties )
+ {
+ Map current = getProperties();
+ if ( current.equals( properties ) || ( properties == null && current.isEmpty() ) )
+ {
+ return this;
+ }
+ return new RelocatedArtifact( artifact.setProperties( properties ), groupId, artifactId, version );
+ }
+
public String getClassifier()
{
return artifact.getClassifier();
From 05b748ff6aa15aa63a9c9d5f9f5679f47bf9e83d Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sat, 25 Dec 2021 12:28:47 +0100
Subject: [PATCH 110/183] [MNG-5561] Plugin relocation loses configuration
Previously, to locate plugin configuration in the project the plugin descriptor
was read and the GA were extracted. This always worked because the GA from the
model and the GA from plugin descriptor (plugin.xml) were identical. When a
plugin is relocated the target artifact is read, thus its plugin descriptor as
well. Naturally, the GA of new (relocated) does not correspond to the old
(static) one in the model. Therefore, the configuration is not found.
New approach is to use the original plugin GA to locate the configuration in
the model regardless of relocation.
---
.../internal/DefaultMojoExecutionConfigurator.java | 4 ++--
.../lifecycle/internal/stub/BuildPluginManagerStub.java | 2 +-
.../maven/lifecycle/internal/stub/MojoExecutorStub.java | 9 ++++++---
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
index 176ba320a71a..8c809de82de3 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
@@ -41,9 +41,9 @@ public class DefaultMojoExecutionConfigurator
@Override
public void configure( MavenProject project, MojoExecution mojoExecution, boolean allowPluginLevelConfig )
{
- String g = mojoExecution.getGroupId();
+ String g = mojoExecution.getPlugin().getGroupId();
- String a = mojoExecution.getArtifactId();
+ String a = mojoExecution.getPlugin().getArtifactId();
Plugin plugin = findPlugin( g, a, project.getBuildPlugins() );
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java
index 133bcb3a2137..cdb00fc02adf 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java
@@ -42,7 +42,7 @@ public PluginDescriptor loadPlugin( Plugin plugin, List reposi
public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, List repositories,
RepositorySystemSession session )
{
- return MojoExecutorStub.createMojoDescriptor( plugin.getKey() );
+ return MojoExecutorStub.createMojoDescriptor( plugin );
}
public ClassRealm getPluginRealm( MavenSession session, PluginDescriptor pluginDescriptor )
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
index 8a6580b699af..763893e6ce9a 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
@@ -21,6 +21,7 @@
import org.apache.maven.lifecycle.internal.MojoExecutor;
import org.apache.maven.lifecycle.internal.PhaseRecorder;
import org.apache.maven.lifecycle.internal.ProjectIndex;
+import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
@@ -54,12 +55,14 @@ public void execute( MavenSession session, List mojoExecutions, P
}
- public static MojoDescriptor createMojoDescriptor( String mojoDescription )
+ public static MojoDescriptor createMojoDescriptor( Plugin plugin )
{
final PluginDescriptor descriptor = new PluginDescriptor();
- descriptor.setArtifactId( mojoDescription );
+ descriptor.setGroupId( plugin.getGroupId() );
+ descriptor.setArtifactId( plugin.getArtifactId() );
+ descriptor.setPlugin( plugin );
+ descriptor.setVersion( plugin.getVersion() );
final MojoDescriptor mojoDescriptor = new MojoDescriptor();
- mojoDescriptor.setDescription( mojoDescription );
mojoDescriptor.setPluginDescriptor( descriptor );
return mojoDescriptor;
}
From 0f3c39b8ed1a875ec58ebe91b2b18ca8b64b2fd3 Mon Sep 17 00:00:00 2001
From: Ravil Galeyev
Date: Sat, 15 May 2021 13:51:15 +0200
Subject: [PATCH 111/183] [MNG-6802] FileProfileActivator changes
FileProfileActivator.exists which lets flattened resolveCiFriendliesOnly
depending fail activating profile
Cherry picked from 3fabb639a31d6076b1649c1a08828febabddf44a
This closes #649
---
.../model/building/DefaultModelBuilder.java | 66 ++++++++-
.../building/DefaultModelBuilderFactory.java | 10 +-
...ProfileActivationFilePathInterpolator.java | 103 ++++++++++++++
.../activation/FileProfileActivator.java | 66 ++-------
.../DefaultModelBuilderFactoryTest.java | 36 ++++-
.../activation/FileProfileActivatorTest.java | 131 ++++++++++++++++++
6 files changed, 354 insertions(+), 58 deletions(-)
create mode 100644 maven-model-builder/src/main/java/org/apache/maven/model/path/ProfileActivationFilePathInterpolator.java
create mode 100644 maven-model-builder/src/test/java/org/apache/maven/model/profile/activation/FileProfileActivatorTest.java
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
index 70c9ed529cd2..94de1d18e5a1 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
@@ -24,6 +24,7 @@
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.model.Activation;
+import org.apache.maven.model.ActivationFile;
import org.apache.maven.model.Build;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.DependencyManagement;
@@ -46,11 +47,13 @@
import org.apache.maven.model.normalization.ModelNormalizer;
import org.apache.maven.model.path.ModelPathTranslator;
import org.apache.maven.model.path.ModelUrlNormalizer;
+import org.apache.maven.model.path.ProfileActivationFilePathInterpolator;
import org.apache.maven.model.plugin.LifecycleBindingsInjector;
import org.apache.maven.model.plugin.PluginConfigurationExpander;
import org.apache.maven.model.plugin.ReportConfigurationExpander;
import org.apache.maven.model.plugin.ReportingConverter;
import org.apache.maven.model.profile.DefaultProfileActivationContext;
+import org.apache.maven.model.profile.ProfileActivationContext;
import org.apache.maven.model.profile.ProfileInjector;
import org.apache.maven.model.profile.ProfileSelector;
import org.apache.maven.model.resolution.InvalidRepositoryException;
@@ -59,8 +62,10 @@
import org.apache.maven.model.resolution.WorkspaceModelResolver;
import org.apache.maven.model.superpom.SuperPomProvider;
import org.apache.maven.model.validation.ModelValidator;
+import org.codehaus.plexus.interpolation.InterpolationException;
import org.codehaus.plexus.interpolation.MapBasedValueSource;
import org.codehaus.plexus.interpolation.StringSearchInterpolator;
+import org.codehaus.plexus.util.StringUtils;
import org.eclipse.sisu.Nullable;
import java.io.File;
@@ -142,6 +147,9 @@ public class DefaultModelBuilder
@Inject
private ReportingConverter reportingConverter;
+ @Inject
+ private ProfileActivationFilePathInterpolator profileActivationFilePathInterpolator;
+
public DefaultModelBuilder setModelProcessor( ModelProcessor modelProcessor )
{
this.modelProcessor = modelProcessor;
@@ -244,6 +252,13 @@ public DefaultModelBuilder setReportingConverter( ReportingConverter reportingCo
return this;
}
+ public DefaultModelBuilder setProfileActivationFilePathInterpolator(
+ ProfileActivationFilePathInterpolator profileActivationFilePathInterpolator )
+ {
+ this.profileActivationFilePathInterpolator = profileActivationFilePathInterpolator;
+ return this;
+ }
+
@SuppressWarnings( "checkstyle:methodlength" )
@Override
public ModelBuildingResult build( ModelBuildingRequest request )
@@ -317,7 +332,9 @@ protected ModelBuildingResult build( ModelBuildingRequest request, Collection interpolatedActivations = getProfileActivations( rawModel, false );
+ Map interpolatedActivations = getInterpolatedActivations( rawModel,
+ profileActivationContext,
+ problems );
injectProfileActivations( tmpModel, interpolatedActivations );
// profile injection
@@ -440,6 +457,51 @@ else if ( !parentIds.add( parentData.getId() ) )
return result;
}
+ private Map getInterpolatedActivations( Model rawModel,
+ DefaultProfileActivationContext context,
+ DefaultModelProblemCollector problems )
+ {
+ Map interpolatedActivations = getProfileActivations( rawModel, true );
+ for ( Activation activation : interpolatedActivations.values() )
+ {
+ if ( activation.getFile() != null )
+ {
+ replaceWithInterpolatedValue( activation.getFile(), context, problems );
+ }
+ }
+ return interpolatedActivations;
+ }
+
+ private void replaceWithInterpolatedValue( ActivationFile activationFile, ProfileActivationContext context,
+ DefaultModelProblemCollector problems )
+ {
+ try
+ {
+ if ( StringUtils.isNotEmpty( activationFile.getExists() ) )
+ {
+ String path = activationFile.getExists();
+ String absolutePath = profileActivationFilePathInterpolator.interpolate( path, context );
+ activationFile.setExists( absolutePath );
+ }
+ else if ( StringUtils.isNotEmpty( activationFile.getMissing() ) )
+ {
+ String path = activationFile.getMissing();
+ String absolutePath = profileActivationFilePathInterpolator.interpolate( path, context );
+ activationFile.setMissing( absolutePath );
+ }
+ }
+ catch ( InterpolationException e )
+ {
+ String path = StringUtils.isNotEmpty(
+ activationFile.getExists() ) ? activationFile.getExists() : activationFile.getMissing();
+
+ problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ).setMessage(
+ "Failed to interpolate file location " + path + ": " + e.getMessage() ).setLocation(
+ activationFile.getLocation( StringUtils.isNotEmpty( activationFile.getExists() ) ? "exists" : "missing" ) )
+ .setException( e ) );
+ }
+ }
+
@Override
public ModelBuildingResult build( ModelBuildingRequest request, ModelBuildingResult result )
throws ModelBuildingException
@@ -818,7 +880,7 @@ private Model interpolateModel( Model model, ModelBuildingRequest request, Model
problems.add( mpcr );
}
-
+
}
interpolatedModel.setPomFile( model.getPomFile() );
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilderFactory.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilderFactory.java
index 4240574ff214..730c5a29fee7 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilderFactory.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilderFactory.java
@@ -43,6 +43,7 @@
import org.apache.maven.model.path.ModelPathTranslator;
import org.apache.maven.model.path.ModelUrlNormalizer;
import org.apache.maven.model.path.PathTranslator;
+import org.apache.maven.model.path.ProfileActivationFilePathInterpolator;
import org.apache.maven.model.path.UrlNormalizer;
import org.apache.maven.model.plugin.DefaultPluginConfigurationExpander;
import org.apache.maven.model.plugin.DefaultReportConfigurationExpander;
@@ -109,7 +110,13 @@ protected ProfileSelector newProfileSelector()
protected ProfileActivator[] newProfileActivators()
{
return new ProfileActivator[] { new JdkVersionProfileActivator(), new OperatingSystemProfileActivator(),
- new PropertyProfileActivator(), new FileProfileActivator().setPathTranslator( newPathTranslator() ) };
+ new PropertyProfileActivator(), new FileProfileActivator()
+ .setProfileActivationFilePathInterpolator( newProfileActivationFilePathInterpolator() ) };
+ }
+
+ protected ProfileActivationFilePathInterpolator newProfileActivationFilePathInterpolator()
+ {
+ return new ProfileActivationFilePathInterpolator().setPathTranslator( newPathTranslator() );
}
protected UrlNormalizer newUrlNormalizer()
@@ -225,6 +232,7 @@ public DefaultModelBuilder newInstance()
modelBuilder.setPluginConfigurationExpander( newPluginConfigurationExpander() );
modelBuilder.setReportConfigurationExpander( newReportConfigurationExpander() );
modelBuilder.setReportingConverter( newReportingConverter() );
+ modelBuilder.setProfileActivationFilePathInterpolator( newProfileActivationFilePathInterpolator() );
return modelBuilder;
}
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/path/ProfileActivationFilePathInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/path/ProfileActivationFilePathInterpolator.java
new file mode 100644
index 000000000000..c2f815b7f7ba
--- /dev/null
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/path/ProfileActivationFilePathInterpolator.java
@@ -0,0 +1,103 @@
+package org.apache.maven.model.path;
+
+/*
+ * 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 org.apache.maven.model.ActivationFile;
+import org.apache.maven.model.profile.ProfileActivationContext;
+import org.codehaus.plexus.interpolation.AbstractValueSource;
+import org.codehaus.plexus.interpolation.InterpolationException;
+import org.codehaus.plexus.interpolation.MapBasedValueSource;
+import org.codehaus.plexus.interpolation.RegexBasedInterpolator;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+import java.io.File;
+
+/**
+ * Finds an absolute path for {@link ActivationFile#getExists()} or {@link ActivationFile#getMissing()}
+ *
+ * @author Ravil Galeyev
+ */
+@Named
+@Singleton
+public class ProfileActivationFilePathInterpolator
+{
+
+ @Inject
+ private PathTranslator pathTranslator;
+
+ public ProfileActivationFilePathInterpolator setPathTranslator( PathTranslator pathTranslator )
+ {
+ this.pathTranslator = pathTranslator;
+ return this;
+ }
+
+ /**
+ * Interpolates given {@code path}.
+ *
+ * @return absolute path or {@code null} if the input was {@code null}
+ */
+ public String interpolate( String path, ProfileActivationContext context ) throws InterpolationException
+ {
+ if ( path == null )
+ {
+ return null;
+ }
+
+ RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
+
+ final File basedir = context.getProjectDirectory();
+
+ if ( basedir != null )
+ {
+ interpolator.addValueSource( new AbstractValueSource( false )
+ {
+ @Override
+ public Object getValue( String expression )
+ {
+ /*
+ * We intentionally only support ${basedir} and not ${project.basedir} as the latter form
+ * would suggest that other project.* expressions can be used which is beyond the design.
+ */
+ if ( "basedir".equals( expression ) )
+ {
+ return basedir.getAbsolutePath();
+ }
+ return null;
+ }
+ } );
+ }
+ else if ( path.contains( "${basedir}" ) )
+ {
+ return null;
+ }
+
+ interpolator.addValueSource( new MapBasedValueSource( context.getProjectProperties() ) );
+
+ interpolator.addValueSource( new MapBasedValueSource( context.getUserProperties() ) );
+
+ interpolator.addValueSource( new MapBasedValueSource( context.getSystemProperties() ) );
+
+ String absolutePath = interpolator.interpolate( path, "" );
+
+ return pathTranslator.alignToBaseDirectory( absolutePath, basedir );
+ }
+}
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
index abfa57edfc03..923ffd2eb3cf 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
@@ -28,15 +28,13 @@
import org.apache.maven.model.Activation;
import org.apache.maven.model.ActivationFile;
import org.apache.maven.model.Profile;
-import org.apache.maven.model.building.ModelProblemCollector;
import org.apache.maven.model.building.ModelProblem.Severity;
import org.apache.maven.model.building.ModelProblem.Version;
+import org.apache.maven.model.building.ModelProblemCollector;
import org.apache.maven.model.building.ModelProblemCollectorRequest;
-import org.apache.maven.model.path.PathTranslator;
+import org.apache.maven.model.path.ProfileActivationFilePathInterpolator;
import org.apache.maven.model.profile.ProfileActivationContext;
-import org.codehaus.plexus.interpolation.AbstractValueSource;
-import org.codehaus.plexus.interpolation.MapBasedValueSource;
-import org.codehaus.plexus.interpolation.RegexBasedInterpolator;
+import org.codehaus.plexus.interpolation.InterpolationException;
import org.codehaus.plexus.util.StringUtils;
/**
@@ -58,11 +56,12 @@ public class FileProfileActivator
{
@Inject
- private PathTranslator pathTranslator;
+ private ProfileActivationFilePathInterpolator profileActivationFilePathInterpolator;
- public FileProfileActivator setPathTranslator( PathTranslator pathTranslator )
+ public FileProfileActivator setProfileActivationFilePathInterpolator(
+ ProfileActivationFilePathInterpolator profileActivationFilePathInterpolator )
{
- this.pathTranslator = pathTranslator;
+ this.profileActivationFilePathInterpolator = profileActivationFilePathInterpolator;
return this;
}
@@ -101,64 +100,23 @@ else if ( StringUtils.isNotEmpty( file.getMissing() ) )
return false;
}
- RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
-
- final File basedir = context.getProjectDirectory();
-
- if ( basedir != null )
- {
- interpolator.addValueSource( new AbstractValueSource( false )
- {
- @Override
- public Object getValue( String expression )
- {
- /*
- * NOTE: We intentionally only support ${basedir} and not ${project.basedir} as the latter form
- * would suggest that other project.* expressions can be used which is however beyond the design.
- */
- if ( "basedir".equals( expression ) )
- {
- return basedir.getAbsolutePath();
- }
- return null;
- }
- } );
- }
- else if ( path.contains( "${basedir}" ) )
- {
- return false;
- }
-
- interpolator.addValueSource( new MapBasedValueSource( context.getProjectProperties() ) );
-
- interpolator.addValueSource( new MapBasedValueSource( context.getUserProperties() ) );
-
- interpolator.addValueSource( new MapBasedValueSource( context.getSystemProperties() ) );
-
try
{
- path = interpolator.interpolate( path, "" );
+ path = profileActivationFilePathInterpolator.interpolate( path, context );
}
- catch ( Exception e )
+ catch ( InterpolationException e )
{
problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Failed to interpolate file location " + path + " for profile " + profile.getId()
- + ": " + e.getMessage() )
+ + ": " + e.getMessage() )
.setLocation( file.getLocation( missing ? "missing" : "exists" ) )
.setException( e ) );
return false;
}
- path = pathTranslator.alignToBaseDirectory( path, basedir );
-
- // replace activation value with interpolated value
- if ( missing )
+ if ( path == null )
{
- file.setMissing( path );
- }
- else
- {
- file.setExists( path );
+ return false;
}
File f = new File( path );
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderFactoryTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderFactoryTest.java
index 90b65a4c921a..32c7d268d5cf 100644
--- a/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderFactoryTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderFactoryTest.java
@@ -20,11 +20,17 @@
*/
import java.io.File;
+import java.io.FileInputStream;
+import java.nio.file.Paths;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import junit.framework.TestCase;
+import org.junit.Test;
+
/**
* @author Benjamin Bentmann
*/
@@ -32,9 +38,11 @@ public class DefaultModelBuilderFactoryTest
extends TestCase
{
+ private static final String BASE_DIR = Paths.get( "src", "test", "resources", "poms", "factory" ).toString();
+
private File getPom( String name )
{
- return new File( "src/test/resources/poms/factory/" + name + ".xml" ).getAbsoluteFile();
+ return new File( Paths.get( BASE_DIR, name + ".xml" ).toString() ).getAbsoluteFile();
}
public void testCompleteWiring()
@@ -56,4 +64,30 @@ public void testCompleteWiring()
assertEquals( " 1.5 ", conf.getChild( "target" ).getValue() );
}
+ @Test
+ public void testPomChanges() throws Exception
+ {
+ ModelBuilder builder = new DefaultModelBuilderFactory().newInstance();
+ assertNotNull( builder );
+ File pom = getPom( "simple" );
+
+ String originalExists = readPom( pom ).getProfiles().get( 1 ).getActivation().getFile().getExists();
+
+ DefaultModelBuildingRequest request = new DefaultModelBuildingRequest();
+ request.setProcessPlugins( true );
+ request.setPomFile( pom );
+ ModelBuildingResult result = builder.build( request );
+ String resultExists = result.getRawModel().getProfiles().get( 1 ).getActivation().getFile().getExists();
+
+ assertEquals( originalExists, resultExists );
+ assertTrue( result.getEffectiveModel().getProfiles().get( 1 ).getActivation().getFile().getExists()
+ .contains( BASE_DIR ) );
+ }
+
+ private static Model readPom( File file ) throws Exception
+ {
+ MavenXpp3Reader reader = new MavenXpp3Reader();
+
+ return reader.read( new FileInputStream( file ) );
+ }
}
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/profile/activation/FileProfileActivatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/profile/activation/FileProfileActivatorTest.java
new file mode 100644
index 000000000000..c8b5c93b8d17
--- /dev/null
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/profile/activation/FileProfileActivatorTest.java
@@ -0,0 +1,131 @@
+package org.apache.maven.model.profile.activation;
+
+/*
+ * 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 org.apache.maven.model.Activation;
+import org.apache.maven.model.ActivationFile;
+import org.apache.maven.model.Profile;
+import org.apache.maven.model.path.DefaultPathTranslator;
+import org.apache.maven.model.path.ProfileActivationFilePathInterpolator;
+import org.apache.maven.model.profile.DefaultProfileActivationContext;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.nio.file.Files;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Path;
+
+/**
+ * Tests {@link FileProfileActivator}.
+ *
+ * @author Ravil Galeyev
+ */
+public class FileProfileActivatorTest extends AbstractProfileActivatorTest
+{
+ Path tempDir;
+
+ private final DefaultProfileActivationContext context = new DefaultProfileActivationContext();
+
+ public FileProfileActivatorTest()
+ {
+ super( FileProfileActivator.class );
+ }
+
+ @Before
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ tempDir = Files.createTempDirectory( null );
+
+ activator.setProfileActivationFilePathInterpolator(
+ new ProfileActivationFilePathInterpolator().setPathTranslator( new DefaultPathTranslator() ) );
+
+ context.setProjectDirectory( new File( tempDir.toString() ) );
+
+ File file = new File( tempDir.resolve( "file.txt" ).toString() );
+ if ( !file.createNewFile() )
+ {
+ throw new IOException( "Can't create " + file );
+ }
+ }
+
+ @Test
+ public void testIsActiveNoFile()
+ {
+ assertActivation( false, newExistsProfile( null ), context );
+ assertActivation( false, newExistsProfile( "someFile.txt" ), context );
+ assertActivation( false, newExistsProfile( "${basedir}/someFile.txt" ), context );
+
+ assertActivation( false, newMissingProfile( null ), context );
+ assertActivation( true, newMissingProfile( "someFile.txt" ), context );
+ assertActivation( true, newMissingProfile( "${basedir}/someFile.txt" ), context );
+ }
+
+ @Test
+ public void testIsActiveExistsFileExists()
+ {
+ assertActivation( true, newExistsProfile( "file.txt" ), context );
+ assertActivation( true, newExistsProfile( "${basedir}" ), context );
+ assertActivation( true, newExistsProfile( "${basedir}/" + "file.txt" ), context );
+
+ assertActivation( false, newMissingProfile( "file.txt" ), context );
+ assertActivation( false, newMissingProfile( "${basedir}" ), context );
+ assertActivation( false, newMissingProfile( "${basedir}/" + "file.txt" ), context );
+ }
+
+ @Test
+ public void testIsActiveExistsLeavesFileUnchanged()
+ {
+ Profile profile = newExistsProfile( "file.txt" );
+ assertEquals( "file.txt", profile.getActivation().getFile().getExists() );
+
+ assertActivation( true, profile, context );
+
+ assertEquals( "file.txt", profile.getActivation().getFile().getExists() );
+ }
+
+ private Profile newExistsProfile( String filePath )
+ {
+ ActivationFile activationFile = new ActivationFile();
+ activationFile.setExists( filePath );
+ return newProfile( activationFile );
+ }
+
+ private Profile newMissingProfile( String filePath )
+ {
+ ActivationFile activationFile = new ActivationFile();
+ activationFile.setMissing( filePath );
+ return newProfile( activationFile );
+ }
+
+ private Profile newProfile( ActivationFile activationFile )
+ {
+ Activation activation = new Activation();
+ activation.setFile( activationFile );
+
+ Profile profile = new Profile();
+ profile.setActivation( activation );
+
+ return profile;
+ }
+}
From f4fd031828c3cd6a6b8184d4ee0e914cd86009a0 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Thu, 6 Jan 2022 22:26:58 +0100
Subject: [PATCH 112/183] Fix checkstyle issue
---
.../org/apache/maven/model/building/DefaultModelBuilder.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
index 94de1d18e5a1..813b76297fe6 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
@@ -497,7 +497,8 @@ else if ( StringUtils.isNotEmpty( activationFile.getMissing() ) )
problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ).setMessage(
"Failed to interpolate file location " + path + ": " + e.getMessage() ).setLocation(
- activationFile.getLocation( StringUtils.isNotEmpty( activationFile.getExists() ) ? "exists" : "missing" ) )
+ activationFile.getLocation( StringUtils.isNotEmpty( activationFile.getExists() )
+ ? "exists" : "missing" ) )
.setException( e ) );
}
}
From 8456294977b40660ce37db853de344f0d26ee46d Mon Sep 17 00:00:00 2001
From: Guillaume Nodet
Date: Fri, 7 Jan 2022 09:51:21 +0100
Subject: [PATCH 113/183] [MNG-6326] Make the build fail if core extensions can
not be loaded (#648)
---
.../java/org/apache/maven/cli/MavenCli.java | 86 ++++++++-----------
.../BootstrapCoreExtensionManager.java | 37 +++++---
.../ExtensionResolutionException.java | 47 ++++++++++
.../src/main/mdo/core-extensions.mdo | 26 ++++++
4 files changed, 134 insertions(+), 62 deletions(-)
create mode 100644 maven-embedder/src/main/java/org/apache/maven/cli/internal/ExtensionResolutionException.java
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index fbcb05f91371..ed695ebbf20c 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -705,6 +705,7 @@ protected void configure()
private List loadCoreExtensions( CliRequest cliRequest, ClassRealm containerRealm,
Set providedArtifacts )
+ throws Exception
{
if ( cliRequest.multiModuleProjectDirectory == null )
{
@@ -717,75 +718,62 @@ private List loadCoreExtensions( CliRequest cliRequest, Clas
return Collections.emptyList();
}
- try
+ List extensions = readCoreExtensionsDescriptor( extensionsFile );
+ if ( extensions.isEmpty() )
{
- List extensions = readCoreExtensionsDescriptor( extensionsFile );
- if ( extensions.isEmpty() )
- {
- return Collections.emptyList();
- }
+ return Collections.emptyList();
+ }
- ContainerConfiguration cc = new DefaultContainerConfiguration() //
- .setClassWorld( cliRequest.classWorld ) //
- .setRealm( containerRealm ) //
- .setClassPathScanning( PlexusConstants.SCANNING_INDEX ) //
- .setAutoWiring( true ) //
- .setJSR250Lifecycle( true ) //
- .setName( "maven" );
+ ContainerConfiguration cc = new DefaultContainerConfiguration() //
+ .setClassWorld( cliRequest.classWorld ) //
+ .setRealm( containerRealm ) //
+ .setClassPathScanning( PlexusConstants.SCANNING_INDEX ) //
+ .setAutoWiring( true ) //
+ .setJSR250Lifecycle( true ) //
+ .setName( "maven" );
- DefaultPlexusContainer container = new DefaultPlexusContainer( cc, new AbstractModule()
+ DefaultPlexusContainer container = new DefaultPlexusContainer( cc, new AbstractModule()
+ {
+ @Override
+ protected void configure()
{
- @Override
- protected void configure()
- {
- bind( ILoggerFactory.class ).toInstance( slf4jLoggerFactory );
- }
- } );
+ bind( ILoggerFactory.class ).toInstance( slf4jLoggerFactory );
+ }
+ } );
- try
- {
- container.setLookupRealm( null );
+ try
+ {
+ container.setLookupRealm( null );
- container.setLoggerManager( plexusLoggerManager );
+ container.setLoggerManager( plexusLoggerManager );
- container.getLoggerManager().setThresholds( cliRequest.request.getLoggingLevel() );
+ container.getLoggerManager().setThresholds( cliRequest.request.getLoggingLevel() );
- Thread.currentThread().setContextClassLoader( container.getContainerRealm() );
+ Thread.currentThread().setContextClassLoader( container.getContainerRealm() );
- executionRequestPopulator = container.lookup( MavenExecutionRequestPopulator.class );
+ executionRequestPopulator = container.lookup( MavenExecutionRequestPopulator.class );
- configurationProcessors = container.lookupMap( ConfigurationProcessor.class );
+ configurationProcessors = container.lookupMap( ConfigurationProcessor.class );
- configure( cliRequest );
+ configure( cliRequest );
- MavenExecutionRequest request = DefaultMavenExecutionRequest.copy( cliRequest.request );
+ MavenExecutionRequest request = DefaultMavenExecutionRequest.copy( cliRequest.request );
- request = populateRequest( cliRequest, request );
+ request = populateRequest( cliRequest, request );
- request = executionRequestPopulator.populateDefaults( request );
+ request = executionRequestPopulator.populateDefaults( request );
- BootstrapCoreExtensionManager resolver = container.lookup( BootstrapCoreExtensionManager.class );
+ BootstrapCoreExtensionManager resolver = container.lookup( BootstrapCoreExtensionManager.class );
- return Collections.unmodifiableList( resolver.loadCoreExtensions( request, providedArtifacts,
- extensions ) );
+ return Collections.unmodifiableList( resolver.loadCoreExtensions( request, providedArtifacts,
+ extensions ) );
- }
- finally
- {
- executionRequestPopulator = null;
- container.dispose();
- }
- }
- catch ( RuntimeException e )
- {
- // runtime exceptions are most likely bugs in maven, let them bubble up to the user
- throw e;
}
- catch ( Exception e )
+ finally
{
- slf4jLogger.warn( "Failed to read extensions descriptor {}: {}", extensionsFile, e.getMessage() );
+ executionRequestPopulator = null;
+ container.dispose();
}
- return Collections.emptyList();
}
private List readCoreExtensionsDescriptor( File extensionsFile )
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java b/maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java
index 9fada05db83b..a47326977d0e 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java
@@ -128,19 +128,30 @@ private CoreExtensionEntry createExtension( CoreExtension extension, List resolveExtension( CoreExtension extension, RepositorySystemSession repoSession,
List repositories, DependencyFilter dependencyFilter )
- throws PluginResolutionException
+ throws ExtensionResolutionException
{
- Plugin plugin = new Plugin();
- plugin.setGroupId( extension.getGroupId() );
- plugin.setArtifactId( extension.getArtifactId() );
- plugin.setVersion( extension.getVersion() );
-
- DependencyNode root =
- pluginDependenciesResolver.resolveCoreExtension( plugin, dependencyFilter, repositories, repoSession );
- PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
- root.accept( nlg );
- List artifacts = nlg.getArtifacts( false );
-
- return artifacts;
+ try
+ {
+ // TODO: enhance the PluginDependenciesResolver to provide a
+ // TODO: resolveCoreExtension method which uses a CoreExtension
+ // TODO: object instead of a Plugin as this makes no sense
+ Plugin plugin = new Plugin();
+ plugin.setGroupId( extension.getGroupId() );
+ plugin.setArtifactId( extension.getArtifactId() );
+ plugin.setVersion( extension.getVersion() );
+
+ DependencyNode root = pluginDependenciesResolver
+ .resolveCoreExtension( plugin, dependencyFilter, repositories, repoSession );
+ PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
+ root.accept( nlg );
+ List artifacts = nlg.getArtifacts( false );
+
+ return artifacts;
+ }
+ catch ( PluginResolutionException e )
+ {
+ throw new ExtensionResolutionException( extension, e.getCause() );
+ }
}
+
}
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/internal/ExtensionResolutionException.java b/maven-embedder/src/main/java/org/apache/maven/cli/internal/ExtensionResolutionException.java
new file mode 100644
index 000000000000..4f8cff9cb346
--- /dev/null
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/internal/ExtensionResolutionException.java
@@ -0,0 +1,47 @@
+package org.apache.maven.cli.internal;
+
+/*
+ * 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 org.apache.maven.cli.internal.extension.model.CoreExtension;
+
+/**
+ * Exception occurring trying to resolve a plugin.
+ *
+ * @author Brett Porter
+ */
+public class ExtensionResolutionException
+ extends Exception
+{
+
+ private final CoreExtension extension;
+
+ public ExtensionResolutionException( CoreExtension extension, Throwable cause )
+ {
+ super( "Extension " + extension.getId() + " or one of its dependencies could not be resolved: "
+ + cause.getMessage(), cause );
+ this.extension = extension;
+ }
+
+ public CoreExtension getExtension()
+ {
+ return extension;
+ }
+
+}
diff --git a/maven-embedder/src/main/mdo/core-extensions.mdo b/maven-embedder/src/main/mdo/core-extensions.mdo
index e523d5abf325..8a74aabb5856 100644
--- a/maven-embedder/src/main/mdo/core-extensions.mdo
+++ b/maven-embedder/src/main/mdo/core-extensions.mdo
@@ -83,6 +83,32 @@
String
+
+
+ 1.0.0+
+
+ ::}, never {@code null}.
+ */
+ public String getId()
+ {
+ StringBuilder id = new StringBuilder( 128 );
+
+ id.append( ( getGroupId() == null ) ? "[unknown-group-id]" : getGroupId() );
+ id.append( ":" );
+ id.append( ( getArtifactId() == null ) ? "[unknown-artifact-id]" : getArtifactId() );
+ id.append( ":" );
+ id.append( ( getVersion() == null ) ? "[unknown-version]" : getVersion() );
+
+ return id.toString();
+ }
+ ]]>
+
+
+
From b4518b5fe416a552a59e5201b4569a9bc0af3153 Mon Sep 17 00:00:00 2001
From: Guillaume Nodet
Date: Mon, 10 Jan 2022 08:19:41 +0100
Subject: [PATCH 114/183] [MNG-7347] SessionScoped beans should be singletons
for a given session (#653)
---
.../internal/LifecycleModuleBuilder.java | 13 +-
.../lifecycle/internal/LifecycleStarter.java | 3 +-
.../lifecycle/internal/ReactorContext.java | 14 +-
.../session/scope/internal/SessionScope.java | 159 +++++++++---------
.../scope/internal/SessionScopeTest.java | 132 +++++++++++++++
5 files changed, 226 insertions(+), 95 deletions(-)
create mode 100644 maven-core/src/test/java/org/apache/maven/session/scope/internal/SessionScopeTest.java
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
index 548fe6c8ffd6..1cbaf5334606 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
@@ -90,8 +90,12 @@ public void buildProject( MavenSession session, MavenSession rootSession, Reacto
// session may be different from rootSession seeded in DefaultMaven
// explicitly seed the right session here to make sure it is used by Guice
- sessionScope.enter( reactorContext.getSessionScopeMemento() );
- sessionScope.seed( MavenSession.class, session );
+ final boolean scoped = session != rootSession;
+ if ( scoped )
+ {
+ sessionScope.enter();
+ sessionScope.seed( MavenSession.class, session );
+ }
try
{
@@ -145,7 +149,10 @@ public void buildProject( MavenSession session, MavenSession rootSession, Reacto
}
finally
{
- sessionScope.exit();
+ if ( scoped )
+ {
+ sessionScope.exit();
+ }
session.setCurrentProject( null );
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java
index cee80739234d..834498126080 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java
@@ -107,8 +107,7 @@ public void execute( MavenSession session )
ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
ReactorBuildStatus reactorBuildStatus = new ReactorBuildStatus( session.getProjectDependencyGraph() );
reactorContext =
- new ReactorContext( result, projectIndex, oldContextClassLoader, reactorBuildStatus,
- sessionScope.memento() );
+ new ReactorContext( result, projectIndex, oldContextClassLoader, reactorBuildStatus );
String builderId = session.getRequest().getBuilderId();
Builder builder = builders.get( builderId );
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorContext.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorContext.java
index 7df531404520..076c6229f8ef 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorContext.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorContext.java
@@ -20,7 +20,6 @@
*/
import org.apache.maven.execution.MavenExecutionResult;
-import org.apache.maven.session.scope.internal.SessionScope;
/**
* Context that is fixed for the entire reactor build.
@@ -40,17 +39,13 @@ public class ReactorContext
private final ReactorBuildStatus reactorBuildStatus;
- private final SessionScope.Memento sessionScope;
-
public ReactorContext( MavenExecutionResult result, ProjectIndex projectIndex,
- ClassLoader originalContextClassLoader, ReactorBuildStatus reactorBuildStatus,
- SessionScope.Memento sessionScope )
+ ClassLoader originalContextClassLoader, ReactorBuildStatus reactorBuildStatus )
{
this.result = result;
this.projectIndex = projectIndex;
this.originalContextClassLoader = originalContextClassLoader;
this.reactorBuildStatus = reactorBuildStatus;
- this.sessionScope = sessionScope;
}
public ReactorBuildStatus getReactorBuildStatus()
@@ -73,11 +68,4 @@ public ClassLoader getOriginalContextClassLoader()
return originalContextClassLoader;
}
- /**
- * @since 3.3.0
- */
- public SessionScope.Memento getSessionScopeMemento()
- {
- return sessionScope;
- }
}
diff --git a/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java b/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java
index ac423bc6c92c..41187fd80cbb 100644
--- a/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java
+++ b/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java
@@ -19,16 +19,16 @@
* under the License.
*/
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CopyOnWriteArrayList;
import com.google.inject.Key;
import com.google.inject.OutOfScopeException;
import com.google.inject.Provider;
import com.google.inject.Scope;
-import com.google.inject.util.Providers;
/**
* SessionScope
@@ -36,18 +36,6 @@
public class SessionScope
implements Scope
{
- /**
- * @since 3.3.0
- */
- public static class Memento
- {
- final Map, Provider>> seeded;
-
- Memento( final Map, Provider>> seeded )
- {
- this.seeded = Collections.unmodifiableMap( new HashMap<>( seeded ) );
- }
- }
private static final Provider SEEDED_KEY_PROVIDER = new Provider()
{
@@ -60,110 +48,127 @@ public Object get()
/**
* ScopeState
*/
- private static final class ScopeState
+ protected static final class ScopeState
{
- private final Map, Provider>> seeded = new HashMap<>();
+ private final ConcurrentMap, CachingProvider>> provided = new ConcurrentHashMap<>();
- private final Map, Object> provided = new HashMap<>();
- }
+ public void seed( Class clazz, Provider value )
+ {
+ provided.put( Key.get( clazz ), new CachingProvider<>( value ) );
+ }
- private final ThreadLocal> values = new ThreadLocal<>();
+ @SuppressWarnings( "unchecked" )
+ public Provider scope( Key key, final Provider unscoped )
+ {
+ Provider> provider = provided.get( key );
+ if ( provider == null )
+ {
+ CachingProvider> newValue = new CachingProvider<>( unscoped );
+ provider = provided.putIfAbsent( key, newValue );
+ if ( provider == null )
+ {
+ provider = newValue;
+ }
+ }
+ return ( Provider ) provider;
+ }
- public void enter()
- {
- LinkedList stack = values.get();
- if ( stack == null )
+ public Collection> providers()
{
- stack = new LinkedList<>();
- values.set( stack );
+ return provided.values();
}
- stack.addFirst( new ScopeState() );
+
}
- /**
- * @since 3.3.0
- */
- public void enter( Memento memento )
+ private final List values = new CopyOnWriteArrayList<>();
+
+ public void enter()
{
- enter();
- getScopeState().seeded.putAll( memento.seeded );
+ values.add( 0, new ScopeState() );
}
- private ScopeState getScopeState()
+ protected ScopeState getScopeState()
{
- LinkedList stack = values.get();
- if ( stack == null || stack.isEmpty() )
+ if ( values.isEmpty() )
{
- throw new IllegalStateException();
+ throw new OutOfScopeException( "Cannot access session scope outside of a scoping block" );
}
- return stack.getFirst();
+ return values.get( 0 );
}
public void exit()
{
- final LinkedList stack = values.get();
- if ( stack == null || stack.isEmpty() )
+ if ( values.isEmpty() )
{
throw new IllegalStateException();
}
- stack.removeFirst();
- if ( stack.isEmpty() )
- {
- values.remove();
- }
- }
-
- /**
- * @since 3.3.0
- */
- public Memento memento()
- {
- LinkedList stack = values.get();
- return new Memento( stack != null ? stack.getFirst().seeded : Collections., Provider>>emptyMap() );
+ values.remove( 0 );
}
public void seed( Class clazz, Provider value )
{
- getScopeState().seeded.put( Key.get( clazz ), value );
+ getScopeState().seed( clazz, value );
}
public void seed( Class clazz, final T value )
{
- getScopeState().seeded.put( Key.get( clazz ), Providers.of( value ) );
+ seed( clazz, new Provider()
+ {
+ @Override
+ public T get()
+ {
+ return value;
+ }
+ } );
}
public Provider scope( final Key key, final Provider unscoped )
{
+ // Lazy evaluating provider
return new Provider()
{
- @SuppressWarnings( "unchecked" )
+ @Override
public T get()
{
- LinkedList stack = values.get();
- if ( stack == null || stack.isEmpty() )
- {
- throw new OutOfScopeException( "Cannot access " + key + " outside of a scoping block" );
- }
+ return getScopeState().scope( key, unscoped ).get();
+ }
+ };
+ }
- ScopeState state = stack.getFirst();
+ /**
+ * CachingProvider
+ * @param
+ */
+ protected static class CachingProvider implements Provider
+ {
+ private final Provider provider;
+ private volatile T value;
- Provider> seeded = state.seeded.get( key );
+ CachingProvider( Provider provider )
+ {
+ this.provider = provider;
+ }
- if ( seeded != null )
- {
- return (T) seeded.get();
- }
+ public T value()
+ {
+ return value;
+ }
- T provided = (T) state.provided.get( key );
- if ( provided == null && unscoped != null )
+ @Override
+ public T get()
+ {
+ if ( value == null )
+ {
+ synchronized ( this )
{
- provided = unscoped.get();
- state.provided.put( key, provided );
+ if ( value == null )
+ {
+ value = provider.get();
+ }
}
-
- return provided;
}
- };
+ return value;
+ }
}
@SuppressWarnings( { "unchecked" } )
diff --git a/maven-core/src/test/java/org/apache/maven/session/scope/internal/SessionScopeTest.java b/maven-core/src/test/java/org/apache/maven/session/scope/internal/SessionScopeTest.java
new file mode 100644
index 000000000000..099e4dddb8f5
--- /dev/null
+++ b/maven-core/src/test/java/org/apache/maven/session/scope/internal/SessionScopeTest.java
@@ -0,0 +1,132 @@
+package org.apache.maven.session.scope.internal;
+
+/*
+ * 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 javax.inject.Provider;
+
+import com.google.inject.Key;
+import com.google.inject.OutOfScopeException;
+import org.apache.maven.model.locator.DefaultModelLocator;
+import org.apache.maven.model.locator.ModelLocator;
+import org.apache.maven.plugin.DefaultPluginRealmCache;
+import org.apache.maven.plugin.PluginRealmCache;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.fail;
+
+public class SessionScopeTest {
+
+ @Test
+ public void testScope() throws Exception
+ {
+ SessionScope scope = new SessionScope();
+
+ try
+ {
+ scope.seed( ModelLocator.class, new DefaultModelLocator() );
+ fail( "Expected a " + OutOfScopeException.class.getName() + " exception to be thrown" );
+ }
+ catch ( OutOfScopeException e )
+ {
+ // expected
+ }
+
+ Provider pml = scope.scope( Key.get( ModelLocator.class), new DefaultModelLocatorProvider() );
+ assertNotNull( pml );
+ try
+ {
+ pml.get();
+ fail( "Expected a " + OutOfScopeException.class.getName() + " exception to be thrown" );
+ }
+ catch ( OutOfScopeException e )
+ {
+ // expected
+ }
+
+ Provider pmst = scope.scope( Key.get( PluginRealmCache.class ), new DefaultPluginRealmCacheProvider() );
+ assertNotNull( pmst );
+
+ scope.enter();
+
+ final DefaultModelLocator dml1 = new DefaultModelLocator();
+ scope.seed( ModelLocator.class, dml1 );
+
+ assertSame( dml1, pml.get() );
+
+ PluginRealmCache mst1 = pmst.get();
+ assertSame( mst1, pmst.get() );
+ Provider pmst1 = scope.scope( Key.get( PluginRealmCache.class ), new DefaultPluginRealmCacheProvider() );
+ assertNotNull( pmst1 );
+ assertSame( mst1, pmst1.get() );
+
+ scope.enter();
+
+ pmst1 = scope.scope( Key.get( PluginRealmCache.class ), new DefaultPluginRealmCacheProvider() );
+ assertNotNull( pmst1 );
+ assertNotSame( mst1, pmst1.get() );
+
+ scope.exit();
+
+ assertSame( mst1, pmst.get() );
+
+ scope.exit();
+
+ try
+ {
+ pmst.get();
+ fail( "Expected a " + OutOfScopeException.class.getName() + " exception to be thrown" );
+ }
+ catch ( OutOfScopeException e )
+ {
+ // expected
+ }
+ try
+ {
+ scope.seed( ModelLocator.class, new DefaultModelLocator() );
+ fail( "Expected a " + OutOfScopeException.class.getName() + " exception to be thrown" );
+ }
+ catch ( OutOfScopeException e )
+ {
+ // expected
+ }
+ }
+
+ private static class DefaultPluginRealmCacheProvider implements com.google.inject.Provider
+ {
+ @Override
+ public PluginRealmCache get()
+ {
+ return new DefaultPluginRealmCache();
+ }
+ }
+
+ private static class DefaultModelLocatorProvider implements com.google.inject.Provider
+ {
+ @Override
+ public ModelLocator get()
+ {
+ return new DefaultModelLocator();
+ }
+ }
+
+}
From 84cbe1ab2e22a12c2c108d1a0e5233f875475fff Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Tue, 11 Jan 2022 15:23:52 +0100
Subject: [PATCH 115/183] [MNG-7362] DefaultArtifactResolver has spurious
"Failure detected" INFO log
---
.../apache/maven/artifact/resolver/DefaultArtifactResolver.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
index 2d1d8d9492d4..1968c1db41ae 100644
--- a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
+++ b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
@@ -511,7 +511,6 @@ public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
if ( result.hasMetadataResolutionExceptions() || result.hasVersionRangeViolations()
|| result.hasCircularDependencyExceptions() )
{
- logger.info( "Failure detected." );
return result;
}
From 99de6b49ee066c102737e4cb99af4be3edb257df Mon Sep 17 00:00:00 2001
From: Falko Modler
Date: Sun, 9 Jan 2022 23:58:40 +0100
Subject: [PATCH 116/183] [MNG-7380] Don't log non-threadsafe warning if only
building a single module
This closes #655
---
.../apache/maven/lifecycle/internal/builder/BuilderCommon.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
index f5c8e3ea4802..25ab6a46a6e2 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
@@ -98,7 +98,7 @@ public MavenExecutionPlan resolveBuildPlan( MavenSession session, MavenProject p
lifecycleDebugLogger.debugProjectPlan( project, executionPlan );
- if ( session.getRequest().getDegreeOfConcurrency() > 1 )
+ if ( session.getRequest().getDegreeOfConcurrency() > 1 && session.getProjects().size() > 1 )
{
final Set unsafePlugins = executionPlan.getNonThreadSafePlugins();
if ( !unsafePlugins.isEmpty() )
From 72c483b52702687f5a4160e1fd317b01c03988d3 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sat, 8 Jan 2022 21:32:28 +0100
Subject: [PATCH 117/183] [MNG-7384] Upgrade Maven JAR Plugin to 3.2.2
---
pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pom.xml b/pom.xml
index 102419305b62..3583a87e197f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -487,6 +487,12 @@ under the License.
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.2.2
+ org.apache.maven.pluginsmaven-release-plugin
From 67ff80544866aa9256624d34a6e4178c3b913996 Mon Sep 17 00:00:00 2001
From: Falko Modler
Date: Mon, 17 Jan 2022 22:07:09 +0100
Subject: [PATCH 118/183] [MNG-7381] Shorten parallel builder thread name to
artifactId, conditionally with groupId
This closes #663
---
.../multithreaded/MultiThreadedBuilder.java | 38 ++++++++++++++++---
1 file changed, 33 insertions(+), 5 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
index 2688a6b4357c..1be0e42ead6b 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
@@ -19,8 +19,10 @@
* under the License.
*/
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutionException;
@@ -127,13 +129,17 @@ private void multiThreadedProjectTaskSegmentBuild( ConcurrencyDependencyGraph an
ThreadOutputMuxer muxer )
{
+ // gather artifactIds which are not unique so that the respective thread names can be extended with the groupId
+ Set duplicateArtifactIds = gatherDuplicateArtifactIds( projectBuildList.keySet() );
+
// schedule independent projects
for ( MavenProject mavenProject : analyzer.getRootSchedulableBuilds() )
{
ProjectSegment projectSegment = projectBuildList.get( mavenProject );
logger.debug( "Scheduling: " + projectSegment.getProject() );
Callable cb =
- createBuildCallable( rootSession, projectSegment, reactorContext, taskSegment, muxer );
+ createBuildCallable( rootSession, projectSegment, reactorContext, taskSegment, muxer,
+ duplicateArtifactIds );
service.submit( cb );
}
@@ -158,7 +164,8 @@ private void multiThreadedProjectTaskSegmentBuild( ConcurrencyDependencyGraph an
ProjectSegment scheduledDependent = projectBuildList.get( mavenProject );
logger.debug( "Scheduling: " + scheduledDependent );
Callable cb =
- createBuildCallable( rootSession, scheduledDependent, reactorContext, taskSegment, muxer );
+ createBuildCallable( rootSession, scheduledDependent, reactorContext, taskSegment, muxer,
+ duplicateArtifactIds );
service.submit( cb );
}
}
@@ -180,7 +187,9 @@ private void multiThreadedProjectTaskSegmentBuild( ConcurrencyDependencyGraph an
private Callable createBuildCallable( final MavenSession rootSession,
final ProjectSegment projectBuild,
final ReactorContext reactorContext,
- final TaskSegment taskSegment, final ThreadOutputMuxer muxer )
+ final TaskSegment taskSegment,
+ final ThreadOutputMuxer muxer,
+ final Set duplicateArtifactIds )
{
return new Callable()
{
@@ -188,13 +197,18 @@ public ProjectSegment call()
{
final Thread currentThread = Thread.currentThread();
final String originalThreadName = currentThread.getName();
- currentThread.setName( "mvn-builder-" + projectBuild.getProject().getId() );
+ final MavenProject project = projectBuild.getProject();
+
+ final String threadNameSuffix = duplicateArtifactIds.contains( project.getArtifactId() )
+ ? project.getGroupId() + ":" + project.getArtifactId()
+ : project.getArtifactId();
+ currentThread.setName( "mvn-builder-" + threadNameSuffix );
try
{
// muxer.associateThreadWithProjectSegment( projectBuild );
lifecycleModuleBuilder.buildProject( projectBuild.getSession(), rootSession, reactorContext,
- projectBuild.getProject(), taskSegment );
+ project, taskSegment );
// muxer.setThisModuleComplete( projectBuild );
return projectBuild;
@@ -206,4 +220,18 @@ public ProjectSegment call()
}
};
}
+
+ private Set gatherDuplicateArtifactIds( Set projects )
+ {
+ Set artifactIds = new HashSet<>( projects.size() );
+ Set duplicateArtifactIds = new HashSet<>();
+ for ( MavenProject project : projects )
+ {
+ if ( !artifactIds.add( project.getArtifactId() ) )
+ {
+ duplicateArtifactIds.add( project.getArtifactId() );
+ }
+ }
+ return duplicateArtifactIds;
+ }
}
From 27755123e30d46a73ede29cef5b4c340fcdc3fab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Boutemy?=
Date: Sun, 9 Jan 2022 19:22:55 +0100
Subject: [PATCH 119/183] [MNG-7385] improve repository metadata documentation
---
.../legacy/metadata/ArtifactMetadata.java | 9 +--
.../src/main/mdo/metadata.mdo | 69 ++++++++++---------
.../src/site/apt/index.apt | 32 ++++++---
3 files changed, 64 insertions(+), 46 deletions(-)
diff --git a/maven-artifact/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadata.java b/maven-artifact/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadata.java
index 7abdfbbe8a07..c97b4e77aefb 100644
--- a/maven-artifact/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadata.java
+++ b/maven-artifact/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadata.java
@@ -24,10 +24,10 @@
/**
* Contains metadata about an artifact, and methods to retrieve/store it from an artifact repository.
- *
- * @author Brett Porter
* TODO merge with artifactmetadatasource
* TODO retrieval exception not appropriate for store
+ *
+ * @author Brett Porter
*/
public interface ArtifactMetadata
{
@@ -62,18 +62,19 @@ public interface ArtifactMetadata
/**
* Merge a new metadata set into this piece of metadata.
+ * TODO this should only be needed on the repository metadata {@link org.apache.maven.artifact.metadata.ArtifactMetadata}
*
* @param metadata the new metadata
- * TODO this should only be needed on the repository metadata
*/
void merge( ArtifactMetadata metadata );
/**
* Store the metadata in the local repository.
+ * TODO this should only be needed on the repository metadata {@link org.apache.maven.artifact.metadata.ArtifactMetadata}
*
* @param localRepository the local repository
* @param remoteRepository the remote repository it came from
- * TODO this should only be needed on the repository metadata
+ * @throws RepositoryMetadataStoreException in case of issue
*/
void storeInLocalRepository( ArtifactRepository localRepository,
ArtifactRepository remoteRepository )
diff --git a/maven-repository-metadata/src/main/mdo/metadata.mdo b/maven-repository-metadata/src/main/mdo/metadata.mdo
index a6f5299fa6e1..ddaeb0a56c26 100644
--- a/maven-repository-metadata/src/main/mdo/metadata.mdo
+++ b/maven-repository-metadata/src/main/mdo/metadata.mdo
@@ -24,11 +24,9 @@ under the License.
repository-metadataMetadataPer-directory repository metadata, for directories representing un-versioned artifact, snapshot artifact
- or a group containing Maven plugins.
-
Notice that most metadata content has a meaning when the directory represents
- an artifact (groupId, artifactId, versioning), but
- plugins is used when the directory represents a group.