From a798258719093e26f63c0422e3f93b5dc09dd4d3 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 2 Jun 2014 06:44:51 +0200 Subject: [PATCH] Clean up patches - Add patch for MNG-5613 --- ...le-hint-for-ReactorReader-to-default.patch | 28 -------- ...e-generics-in-modello-generated-code.patch | 10 +-- ...igrate-from-easymock-1-to-easymock-3.patch | 10 +-- ...ch => 0003-Update-Aether-to-0.9.0.M3.patch | 14 ++-- ...Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch | 22 +++---- ...ctor-hint-for-reactor-WorkspaceReade.patch | 64 +++++++++++++++++++ ...lPointerException-when-error-occur-d.patch | 34 ++++++++++ maven.spec | 40 ++++++------ 8 files changed, 148 insertions(+), 74 deletions(-) delete mode 100644 0001-MNG-5591-Set-role-hint-for-ReactorReader-to-default.patch rename 0005-Use-generics-in-modello-generated-code.patch => 0001-Use-generics-in-modello-generated-code.patch (86%) rename 0001-Migrate-from-easymock-1-to-easymock-3.patch => 0002-Migrate-from-easymock-1-to-easymock-3.patch (96%) rename 0001-Update-Aether-to-0.9.0.M3.patch => 0003-Update-Aether-to-0.9.0.M3.patch (92%) rename 0001-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch => 0004-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch (94%) create mode 100644 0005-MNG-5591-use-reactor-hint-for-reactor-WorkspaceReade.patch create mode 100644 0006-MNG-5613-fix-NullPointerException-when-error-occur-d.patch diff --git a/0001-MNG-5591-Set-role-hint-for-ReactorReader-to-default.patch b/0001-MNG-5591-Set-role-hint-for-ReactorReader-to-default.patch deleted file mode 100644 index 301af41..0000000 --- a/0001-MNG-5591-Set-role-hint-for-ReactorReader-to-default.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a389420bc523cf178dedd8553c33397da448b9ff Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Mon, 24 Feb 2014 13:59:31 +0100 -Subject: [PATCH] [MNG-5591] Set role hint for ReactorReader to "default" - -Sisu uses implicit role hint "default" only for components which class -names are prefixed with "Default". Since ReactorReader is not, hole -hint "default" needs to be explicitly added as argument to @Named. ---- - maven-core/src/main/java/org/apache/maven/ReactorReader.java | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java -index 9aa8385..405d40b 100644 ---- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java -+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java -@@ -46,7 +46,7 @@ - * - * @author Jason van Zyl - */ --@Named -+@Named( "default" ) - @SessionScoped - class ReactorReader - implements WorkspaceReader --- -1.8.4.2 - diff --git a/0005-Use-generics-in-modello-generated-code.patch b/0001-Use-generics-in-modello-generated-code.patch similarity index 86% rename from 0005-Use-generics-in-modello-generated-code.patch rename to 0001-Use-generics-in-modello-generated-code.patch index d0c75e4..18bf467 100644 --- a/0005-Use-generics-in-modello-generated-code.patch +++ b/0001-Use-generics-in-modello-generated-code.patch @@ -1,7 +1,7 @@ -From 6969f54c7a4e1e280ea44b3a82caf8302f8e05f7 Mon Sep 17 00:00:00 2001 +From 351830b1c83b308e554f48c355f252f62afb3c2c Mon Sep 17 00:00:00 2001 From: Stanislav Ochotnicky Date: Tue, 31 Jan 2012 13:12:32 +0100 -Subject: [PATCH 1/4] Use generics in modello generated code +Subject: [PATCH 1/6] Use generics in modello generated code --- maven-model/pom.xml | 2 ++ @@ -9,7 +9,7 @@ Subject: [PATCH 1/4] Use generics in modello generated code 2 files changed, 5 insertions(+) diff --git a/maven-model/pom.xml b/maven-model/pom.xml -index 0e594dd..f4d7402 100644 +index e538c1a..27c92bb 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -56,6 +56,7 @@ under the License. @@ -29,7 +29,7 @@ index 0e594dd..f4d7402 100644 diff --git a/pom.xml b/pom.xml -index 782b3c4..5e16bd6 100644 +index 57ac319..7e0c305 100644 --- a/pom.xml +++ b/pom.xml @@ -389,6 +389,9 @@ @@ -43,5 +43,5 @@ index 782b3c4..5e16bd6 100644 site-docs -- -1.8.4.2 +1.9.0 diff --git a/0001-Migrate-from-easymock-1-to-easymock-3.patch b/0002-Migrate-from-easymock-1-to-easymock-3.patch similarity index 96% rename from 0001-Migrate-from-easymock-1-to-easymock-3.patch rename to 0002-Migrate-from-easymock-1-to-easymock-3.patch index 438e5b6..4dd1ec7 100644 --- a/0001-Migrate-from-easymock-1-to-easymock-3.patch +++ b/0002-Migrate-from-easymock-1-to-easymock-3.patch @@ -1,7 +1,7 @@ -From 466eafe55aef76159d60036130f9c6740bdc803e Mon Sep 17 00:00:00 2001 +From b7282fd199d9ff4169ca62d50606fbe94086f2de Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 29 Aug 2013 10:11:48 +0200 -Subject: [PATCH 2/4] Migrate from easymock 1 to easymock 3 +Subject: [PATCH 2/6] Migrate from easymock 1 to easymock 3 --- maven-compat/pom.xml | 2 +- @@ -12,7 +12,7 @@ Subject: [PATCH 2/4] Migrate from easymock 1 to easymock 3 delete mode 100644 maven-compat/src/test/java/org/apache/maven/artifact/testutils/MockManager.java diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml -index 5f8be50..a296c86 100644 +index ff75433..7ee01a0 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -83,7 +83,7 @@ @@ -120,7 +120,7 @@ index bcda50a..37a281c 100644 private Artifact createTestPomArtifact( String directory ) diff --git a/pom.xml b/pom.xml -index 5e16bd6..808924a 100644 +index 7e0c305..b3f710f 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ @@ -142,5 +142,5 @@ index 5e16bd6..808924a 100644 ${easyMockVersion} test -- -1.8.4.2 +1.9.0 diff --git a/0001-Update-Aether-to-0.9.0.M3.patch b/0003-Update-Aether-to-0.9.0.M3.patch similarity index 92% rename from 0001-Update-Aether-to-0.9.0.M3.patch rename to 0003-Update-Aether-to-0.9.0.M3.patch index 1eb2880..00624c9 100644 --- a/0001-Update-Aether-to-0.9.0.M3.patch +++ b/0003-Update-Aether-to-0.9.0.M3.patch @@ -1,7 +1,7 @@ -From c9859a031e75d41fb8199ab6dc7f3019f510fc83 Mon Sep 17 00:00:00 2001 +From f287858ef2b0a2cc924e902298eea66ed7c6b82e Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 12 Aug 2013 08:49:19 +0200 -Subject: [PATCH 3/4] Update Aether to 0.9.0.M3 +Subject: [PATCH 3/6] Update Aether to 0.9.0.M3 --- apache-maven/pom.xml | 6 +++++- @@ -11,7 +11,7 @@ Subject: [PATCH 3/4] Update Aether to 0.9.0.M3 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml -index e79b5a5..7504e24 100644 +index 0ff2e9a..26c6a82 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -87,7 +87,11 @@ @@ -28,7 +28,7 @@ index e79b5a5..7504e24 100644 org.slf4j diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml -index 8a5fc78..7ae72f2 100644 +index f9f1673..6273e66 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -91,7 +91,12 @@ under the License. @@ -46,7 +46,7 @@ index 8a5fc78..7ae72f2 100644 diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml -index a296c86..a2277b7 100644 +index 7ee01a0..e075387 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -79,7 +79,12 @@ @@ -64,7 +64,7 @@ index a296c86..a2277b7 100644 diff --git a/pom.xml b/pom.xml -index 808924a..366c557 100644 +index b3f710f..04a6e4c 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ @@ -91,5 +91,5 @@ index 808924a..366c557 100644 -- -1.8.4.2 +1.9.0 diff --git a/0001-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch b/0004-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch similarity index 94% rename from 0001-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch rename to 0004-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch index c8c28f9..799f0a6 100644 --- a/0001-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch +++ b/0004-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch @@ -1,7 +1,7 @@ -From 93bf8c4e671da0015de6a7269980d35f4a1c77ea Mon Sep 17 00:00:00 2001 +From 0e95fa0a988f4b910969d1d5cfd2daf0c968f257 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Wed, 13 Nov 2013 14:32:23 +0100 -Subject: [PATCH 4/4] Update to Sisu 0.1.0 and Guice 3.1.6 +Subject: [PATCH 4/6] Update to Sisu 0.1.0 and Guice 3.1.6 Sisu depends on Guice, but dependency scope changed from "compile" to "provided" in Sisu 0.1.0. As a Sisu user, Maven needs to have runtime @@ -18,7 +18,7 @@ dependency on Guice. 8 files changed, 77 insertions(+), 3 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml -index 7504e24..57f75cc 100644 +index 26c6a82..b866692 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -57,6 +57,18 @@ @@ -41,7 +41,7 @@ index 7504e24..57f75cc 100644 commons-cli diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml -index 7ae72f2..c6988ee 100644 +index 6273e66..3ff5929 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -80,7 +80,6 @@ under the License. @@ -65,7 +65,7 @@ index 7ae72f2..c6988ee 100644 org.eclipse.aether diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml -index a2277b7..0c8e9e9 100644 +index e075387..9810fd9 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -64,6 +64,18 @@ @@ -88,7 +88,7 @@ index a2277b7..0c8e9e9 100644 plexus-component-annotations diff --git a/maven-core/pom.xml b/maven-core/pom.xml -index 400ec02..09bfd0a 100644 +index f88ca9f..55cb370 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -82,6 +82,17 @@ @@ -110,7 +110,7 @@ index 400ec02..09bfd0a 100644 plexus-interpolation diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml -index 1264eea..11ae441 100644 +index d4db510..7b85c58 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -65,6 +65,17 @@ @@ -132,7 +132,7 @@ index 1264eea..11ae441 100644 plexus-component-annotations diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml -index d694534..c7111b5 100644 +index 053c86c..ef9df33 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -54,6 +54,18 @@ @@ -155,7 +155,7 @@ index d694534..c7111b5 100644 xmlunit 1.3 diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml -index 24e3101..8096b15 100644 +index 319243e..85f0718 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -58,6 +58,18 @@ under the License. @@ -178,7 +178,7 @@ index 24e3101..8096b15 100644 diff --git a/pom.xml b/pom.xml -index 366c557..5414c23 100644 +index 04a6e4c..bb9a88b 100644 --- a/pom.xml +++ b/pom.xml @@ -51,8 +51,8 @@ @@ -193,5 +193,5 @@ index 366c557..5414c23 100644 1.3 1.7 -- -1.8.4.2 +1.9.0 diff --git a/0005-MNG-5591-use-reactor-hint-for-reactor-WorkspaceReade.patch b/0005-MNG-5591-use-reactor-hint-for-reactor-WorkspaceReade.patch new file mode 100644 index 0000000..007c362 --- /dev/null +++ b/0005-MNG-5591-use-reactor-hint-for-reactor-WorkspaceReade.patch @@ -0,0 +1,64 @@ +From 12946e910f70efbe5f8d44e3f94cf5c59fd653d1 Mon Sep 17 00:00:00 2001 +From: Igor Fedorenko +Date: Fri, 28 Feb 2014 23:54:45 -0500 +Subject: [PATCH 5/6] MNG-5591 use 'reactor' hint for reactor WorkspaceReader + +When maven is invoked from m2e, container.lookup(WorkspaceReader.class) +returns component with role-hint=ide, which I believe is a bug in Susi +or Guice (or at least well misunderstood feature). This masks +ReactorReader workspace reader implementation and breaks reactor +dependency resolution. + +The solution is to use explicit "reactor" role hint for ReactorReader. +This avoids fuzzy default component lookup logic and guarantees reactor +reader is always used regardless of presence of other workspace readers. + +Signed-off-by: Igor Fedorenko +--- + maven-core/src/main/java/org/apache/maven/DefaultMaven.java | 2 +- + maven-core/src/main/java/org/apache/maven/ReactorReader.java | 5 +++-- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +index 58c536c..6328819 100644 +--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java ++++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +@@ -288,7 +288,7 @@ private MavenExecutionResult doExecute( MavenExecutionRequest request ) + sessionScope.seed( MavenSession.class, session ); + try + { +- reactorWorkspace = container.lookup( WorkspaceReader.class ); ++ reactorWorkspace = container.lookup( WorkspaceReader.class, ReactorReader.HINT ); + } + catch ( ComponentLookupException e ) + { +diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java +index 9aa8385..e7b1f42 100644 +--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java ++++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java +@@ -31,7 +31,6 @@ + + import javax.inject.Inject; + import javax.inject.Named; +-import javax.inject.Singleton; + + import org.apache.maven.artifact.ArtifactUtils; + import org.apache.maven.execution.MavenSession; +@@ -46,11 +45,13 @@ + * + * @author Jason van Zyl + */ +-@Named ++@Named( ReactorReader.HINT ) + @SessionScoped + class ReactorReader + implements WorkspaceReader + { ++ public static final String HINT = "reactor"; ++ + private static final Collection COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" ); + + private Map projectsByGAV; +-- +1.9.0 + diff --git a/0006-MNG-5613-fix-NullPointerException-when-error-occur-d.patch b/0006-MNG-5613-fix-NullPointerException-when-error-occur-d.patch new file mode 100644 index 0000000..dce94e2 --- /dev/null +++ b/0006-MNG-5613-fix-NullPointerException-when-error-occur-d.patch @@ -0,0 +1,34 @@ +From 750f5f97fd4d630987e9d4ce32073aad845b3c23 Mon Sep 17 00:00:00 2001 +From: Jason van Zyl +Date: Tue, 20 May 2014 20:26:27 -0400 +Subject: [PATCH 6/6] [MNG-5613] fix NullPointerException when error occur + during project dependency graph creation Submitted by: Sebastian Le Merdy + From: https://github.com/apache/maven/pull/13 + +--- + maven-core/src/main/java/org/apache/maven/DefaultMaven.java | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +index 6328819..ab47efd 100644 +--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java ++++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +@@ -267,13 +267,13 @@ private MavenExecutionResult doExecute( MavenExecutionRequest request ) + // + ProjectDependencyGraph projectDependencyGraph = createProjectDependencyGraph( projects, request, result, true ); + +- session.setProjects( projectDependencyGraph.getSortedProjects() ); +- + if ( result.hasExceptions() ) + { + return result; + } + ++ session.setProjects( projectDependencyGraph.getSortedProjects() ); ++ + try + { + session.setProjectMap( getProjectMap( session.getProjects() ) ); +-- +1.9.0 + diff --git a/maven.spec b/maven.spec index 95615e1..f10f04b 100644 --- a/maven.spec +++ b/maven.spec @@ -1,28 +1,27 @@ Name: maven Version: 3.2.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Java project management and project comprehension tool - -Group: Development/Tools License: ASL 2.0 URL: http://maven.apache.org/ + Source0: http://archive.apache.org/dist/%{name}/%{name}-3/%{version}/source/apache-%{name}-%{version}-src.tar.gz Source1: maven-bash-completion Source2: mvn.1 - -# 2xx for created non-buildable sources Source200: %{name}-script -# Patch1XX could be upstreamed probably -Patch100: 0005-Use-generics-in-modello-generated-code.patch -Patch101: 0001-Migrate-from-easymock-1-to-easymock-3.patch - +# Could be upstreamed probably +Patch0001: 0001-Use-generics-in-modello-generated-code.patch +# Could be upstreamed probably +Patch0002: 0002-Migrate-from-easymock-1-to-easymock-3.patch # Forwarded upstream (MNG-5502) -Patch200: 0001-Update-Aether-to-0.9.0.M3.patch +Patch0003: 0003-Update-Aether-to-0.9.0.M3.patch # Forwarded upstream (MNG-5534) -Patch201: 0001-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch -# Forwarded upstream (MNG-5591) -Patch202: 0001-MNG-5591-Set-role-hint-for-ReactorReader-to-default.patch +Patch0004: 0004-Update-to-Sisu-0.1.0-and-Guice-3.1.6.patch +# Forwarded upstream (MNG-5591, accepted) +Patch0005: 0005-MNG-5591-use-reactor-hint-for-reactor-WorkspaceReade.patch +# Backported from upstream commit bef7fac +Patch0006: 0006-MNG-5613-fix-NullPointerException-when-error-occur-d.patch BuildArch: noarch @@ -150,11 +149,12 @@ Group: Documentation %prep %setup -q -n apache-%{name}-%{version}%{?ver_add} -%patch100 -p1 -%patch101 -p1 -%patch200 -p1 -%patch201 -p1 -%patch202 -p1 +%patch0001 -p1 +%patch0002 -p1 +%patch0003 -p1 +%patch0004 -p1 +%patch0005 -p1 +%patch0006 -p1 # not really used during build, but a precaution rm maven-ant-tasks-*.jar @@ -281,6 +281,10 @@ ln -sf $(build-classpath plexus/classworlds) \ %changelog +* Mon Jun 2 2014 Mikolaj Izdebski - 3.2.1-7 +- Clean up patches +- Add patch for MNG-5613 + * Mon May 26 2014 Mikolaj Izdebski - 3.2.1-6 - Remove BuildRequires on maven-surefire-provider-junit4