this is mostly just a workaround for 669034. Seems like
plexus-container-default has some quirks that cause it to lose
version so it's set to null. Needs more looking into to fix it
properly.
This commit is contained in:
Stanislav Ochotnicky 2011-01-12 16:57:07 +01:00
parent 680881b48d
commit 0f96b0570c
2 changed files with 27 additions and 3 deletions

View File

@ -1,4 +1,4 @@
From 731d9fb5b28edb2e966ef6d6bb93a70607d7d722 Mon Sep 17 00:00:00 2001 From 0ef392488f676a6b64d408bb98d21eefaa1d3d10 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com> From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Tue, 2 Nov 2010 14:47:05 +0100 Date: Tue, 2 Nov 2010 14:47:05 +0100
Subject: [PATCH 2/2] Use custom resolver Subject: [PATCH 2/2] Use custom resolver
@ -14,8 +14,9 @@ project when WorkspaceReader is not available yet.
.../apache/maven/plugin/MavenPluginValidator.java | 5 ++++- .../apache/maven/plugin/MavenPluginValidator.java | 5 ++++-
.../internal/DefaultPluginVersionResolver.java | 9 +++++++++ .../internal/DefaultPluginVersionResolver.java | 9 +++++++++
.../apache/maven/project/ProjectModelResolver.java | 9 +++++++++ .../apache/maven/project/ProjectModelResolver.java | 9 +++++++++
.../project/artifact/MavenMetadataSource.java | 9 +++++++++
.../model/validation/DefaultModelValidator.java | 16 +++++++++++++--- .../model/validation/DefaultModelValidator.java | 16 +++++++++++++---
7 files changed, 59 insertions(+), 6 deletions(-) 8 files changed, 68 insertions(+), 6 deletions(-)
diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java
index cae3735..2d11d64 100644 index cae3735..2d11d64 100644
@ -157,6 +158,26 @@ index 403351a..2351620 100644
try try
{ {
diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
index 066fbf3..a7cbf40 100644
--- a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
+++ b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
@@ -326,6 +326,15 @@ public class MavenMetadataSource
return null;
}
+ // this is a workaround for 669034
+ // Seems like plexus-container-default has some quirks that
+ // cause it to lose version. Needs more looking into and fix it
+ // properly
+ if (dependency.getVersion() == null && System.getProperty("maven.jpp.mode") != null)
+ {
+ System.out.println("FIXING NULL VERSION:" + dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + dependency.getVersion());
+ dependency.setVersion("1.0.0");
+ }
VersionRange versionRange = VersionRange.createFromVersionSpec( dependency.getVersion() );
Artifact dependencyArtifact =
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
index 033211a..eec6caf 100644 index 033211a..eec6caf 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java --- a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java

View File

@ -1,7 +1,7 @@
Name: maven Name: maven
Version: 3.0 Version: 3.0
Release: 5%{?dist} Release: 6%{?dist}
Summary: Java project management and project comprehension tool Summary: Java project management and project comprehension tool
Group: Development/Tools Group: Development/Tools
@ -308,6 +308,9 @@ cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%changelog %changelog
* Wed Jan 12 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-6
- Fix bug #669034
* Tue Jan 11 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-5 * Tue Jan 11 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-5
- Fix bugs #667625 #667614 and #667636 - Fix bugs #667625 #667614 and #667636
- Install maven metadata so they are not downloaded when mvn is run - Install maven metadata so they are not downloaded when mvn is run