Update to latest upstream version
This commit is contained in:
parent
c6a6cf4321
commit
cbb4efd11d
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
/apache-maven-3.0.2-src.tar.gz
|
||||
/apache-maven-3.0.3-RC1-src.tar.gz
|
||||
/apache-maven-3.0.3-src.tar.gz
|
||||
/apache-maven-3.0.4-src.tar.gz
|
||||
|
@ -1,28 +1,28 @@
|
||||
From 97ddab6cd1a948294176f851e37a48b5bc036c73 Mon Sep 17 00:00:00 2001
|
||||
From d0dbdcde31414336340a5089fecf4f93cb5125ad Mon Sep 17 00:00:00 2001
|
||||
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
|
||||
Date: Tue, 30 Aug 2011 11:41:39 +0200
|
||||
Subject: [PATCH 1/4] Add plugin-api deps
|
||||
Date: Tue, 12 Oct 2010 16:56:50 +0200
|
||||
Subject: [PATCH 1/5] Add plugin-api deps
|
||||
|
||||
---
|
||||
maven-plugin-api/pom.xml | 5 +++++
|
||||
1 files changed, 5 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
|
||||
index 8967754..0f72aa5 100644
|
||||
index abc2065..efea352 100644
|
||||
--- a/maven-plugin-api/pom.xml
|
||||
+++ b/maven-plugin-api/pom.xml
|
||||
@@ -51,6 +51,11 @@ under the License.
|
||||
<groupId>org.sonatype.sisu</groupId>
|
||||
<artifactId>sisu-inject-plexus</artifactId>
|
||||
</dependency>
|
||||
@@ -52,6 +52,11 @@ under the License.
|
||||
<groupId>org.sonatype.sisu</groupId>
|
||||
<artifactId>sisu-inject-plexus</artifactId>
|
||||
</dependency>
|
||||
+ <dependency>
|
||||
+ <groupId>org.codehaus.plexus</groupId>
|
||||
+ <artifactId>plexus-container-default</artifactId>
|
||||
+ <version>latest</version>
|
||||
+ <version>1.0.0</version>
|
||||
+ </dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
--
|
||||
1.7.6
|
||||
1.7.7.6
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From e1b80440159b03b397cba740a7949f8be412fef5 Mon Sep 17 00:00:00 2001
|
||||
From 46e6dbc205065a670fa3b6e7c41e02e30b2fdb7a Mon Sep 17 00:00:00 2001
|
||||
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
|
||||
Date: Tue, 30 Aug 2011 11:42:32 +0200
|
||||
Subject: [PATCH 2/4] Use custom resolver
|
||||
Date: Tue, 18 Jan 2011 11:09:32 +0100
|
||||
Subject: [PATCH 2/5] Use custom resolver
|
||||
|
||||
WorkspaceReader is used to resolve main dependencies, but we had to
|
||||
add this resolve to ProjectModelResolver and DefaultModelResolver as
|
||||
@ -19,21 +19,21 @@ project when WorkspaceReader is not available yet.
|
||||
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
|
||||
index 746f852..4232fd7 100644
|
||||
index 96b9fc3..f30bf94 100644
|
||||
--- 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
|
||||
@@ -40,6 +40,7 @@ import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResolutionException;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResolutionException;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
+import org.apache.maven.artifact.resolver.JavadirWorkspaceReader;
|
||||
|
||||
/**
|
||||
* A model resolver to assist building of dependency POMs. This resolver gives priority to those repositories that have
|
||||
|
||||
/**
|
||||
* A model resolver to assist building of dependency POMs. This resolver gives priority to those repositories that have
|
||||
@@ -114,6 +115,14 @@ class DefaultModelResolver
|
||||
throws UnresolvableModelException
|
||||
{
|
||||
Artifact pomArtifact = new DefaultArtifact( groupId, artifactId, "", "pom", version );
|
||||
throws UnresolvableModelException
|
||||
{
|
||||
Artifact pomArtifact = new DefaultArtifact( groupId, artifactId, "", "pom", version );
|
||||
+ if ( System.getProperty("maven.local.mode") != null) {
|
||||
+ JavadirWorkspaceReader wReader = new JavadirWorkspaceReader();
|
||||
+ File pomFile = wReader.findArtifact(pomArtifact);
|
||||
@ -42,83 +42,83 @@ index 746f852..4232fd7 100644
|
||||
+ if ( pomFile != null )
|
||||
+ return new FileModelSource( pomFile );
|
||||
+ }
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java b/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java
|
||||
index 1f37d4f..05b7df6 100644
|
||||
index 8efc45c..df7d4e9 100644
|
||||
--- a/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java
|
||||
+++ b/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java
|
||||
@@ -99,12 +99,18 @@ public final class ArtifactUtils
|
||||
{
|
||||
throw new NullPointerException( "artifactId is null" );
|
||||
}
|
||||
- if ( version == null )
|
||||
{
|
||||
throw new NullPointerException( "artifactId is null" );
|
||||
}
|
||||
- if ( version == null )
|
||||
+ // in local mode we ignore versions because these would only cause
|
||||
+ // problems
|
||||
+ if ( version == null && System.getProperty("maven.local.mode") == null )
|
||||
{
|
||||
throw new NullPointerException( "version is null" );
|
||||
}
|
||||
|
||||
- return groupId + ":" + artifactId + ":" + version;
|
||||
{
|
||||
throw new NullPointerException( "version is null" );
|
||||
}
|
||||
|
||||
- return groupId + ":" + artifactId + ":" + version;
|
||||
+ if( System.getProperty("maven.local.mode") == null ) {
|
||||
+ return groupId + ":" + artifactId + ":" + version;
|
||||
+ } else {
|
||||
+ return versionlessKey(groupId, artifactId);
|
||||
+ }
|
||||
}
|
||||
|
||||
public static Map<String, Artifact> artifactMapByVersionlessId( Collection<Artifact> artifacts )
|
||||
}
|
||||
|
||||
public static Map<String, Artifact> artifactMapByVersionlessId( Collection<Artifact> artifacts )
|
||||
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 a7c1a2b..8fdb6ed 100644
|
||||
index cd944a8..7bff4a0 100644
|
||||
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
|
||||
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
|
||||
@@ -56,6 +56,7 @@ import org.apache.maven.project.ProjectBuildingException;
|
||||
import org.apache.maven.project.ProjectBuildingRequest;
|
||||
import org.apache.maven.project.ProjectBuildingResult;
|
||||
import org.apache.maven.project.ProjectSorter;
|
||||
import org.apache.maven.project.ProjectBuildingRequest;
|
||||
import org.apache.maven.project.ProjectBuildingResult;
|
||||
import org.apache.maven.project.ProjectSorter;
|
||||
+import org.apache.maven.artifact.resolver.JavadirWorkspaceReader;
|
||||
import org.apache.maven.repository.DelegatingLocalArtifactRepository;
|
||||
import org.apache.maven.repository.LocalRepositoryNotAccessibleException;
|
||||
import org.apache.maven.settings.Mirror;
|
||||
@@ -363,6 +364,12 @@ public class DefaultMaven
|
||||
session.setWorkspaceReader( workspaceRepository );
|
||||
}
|
||||
|
||||
import org.apache.maven.repository.DelegatingLocalArtifactRepository;
|
||||
import org.apache.maven.repository.LocalRepositoryNotAccessibleException;
|
||||
import org.apache.maven.settings.Mirror;
|
||||
@@ -375,6 +376,12 @@ public class DefaultMaven
|
||||
session.setWorkspaceReader( workspaceRepository );
|
||||
}
|
||||
|
||||
+ // Set our own workspace reader to resolve from /usr/share/java
|
||||
+ if ( System.getProperty("maven.local.mode") != null)
|
||||
+ {
|
||||
+ session.setWorkspaceReader(new JavadirWorkspaceReader());
|
||||
+ }
|
||||
+
|
||||
DefaultSettingsDecryptionRequest decrypt = new DefaultSettingsDecryptionRequest();
|
||||
decrypt.setProxies( request.getProxies() );
|
||||
decrypt.setServers( request.getServers() );
|
||||
DefaultSettingsDecryptionRequest decrypt = new DefaultSettingsDecryptionRequest();
|
||||
decrypt.setProxies( request.getProxies() );
|
||||
decrypt.setServers( request.getServers() );
|
||||
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java
|
||||
index 009635b..93b86d0 100644
|
||||
index 2eb2738..28fcdd9 100644
|
||||
--- a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java
|
||||
+++ b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java
|
||||
@@ -60,7 +60,10 @@ public class MavenPluginValidator
|
||||
errors.add( "Plugin's descriptor contains the wrong artifact ID: " + pluginDescriptor.getArtifactId() );
|
||||
}
|
||||
|
||||
- if ( !pluginArtifact.getBaseVersion().equals( pluginDescriptor.getVersion() ) )
|
||||
errors.add( "Plugin's descriptor contains the wrong artifact ID: " + pluginDescriptor.getArtifactId() );
|
||||
}
|
||||
|
||||
- if ( !pluginArtifact.getBaseVersion().equals( pluginDescriptor.getVersion() ) )
|
||||
+ // ignore incorrect version in local mode (we can have different
|
||||
+ // versions in /usr/share/java
|
||||
+ if ( !pluginArtifact.getBaseVersion().equals( pluginDescriptor.getVersion() )
|
||||
+ && System.getProperty("maven.local.mode") == null)
|
||||
{
|
||||
errors.add( "Plugin's descriptor contains the wrong version: " + pluginDescriptor.getVersion() );
|
||||
}
|
||||
{
|
||||
errors.add( "Plugin's descriptor contains the wrong version: " + pluginDescriptor.getVersion() );
|
||||
}
|
||||
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 c5f5604..cac7fc8 100644
|
||||
index a215d28..754406a 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
|
||||
@@ -89,6 +89,15 @@ public class DefaultPluginVersionResolver
|
||||
throws PluginVersionResolutionException
|
||||
{
|
||||
logger.debug( "Resolving plugin version for " + request.getGroupId() + ":" + request.getArtifactId() );
|
||||
throws PluginVersionResolutionException
|
||||
{
|
||||
logger.debug( "Resolving plugin version for " + request.getGroupId() + ":" + request.getArtifactId() );
|
||||
+ if (System.getProperty("maven.local.mode") != null) {
|
||||
+ // in local mode we always use "latest" as a resolved version
|
||||
+ // (we ignore it anyway)
|
||||
@ -128,25 +128,25 @@ index c5f5604..cac7fc8 100644
|
||||
+ + " to latest from repository " + result.getRepository());
|
||||
+ return result;
|
||||
+ }
|
||||
|
||||
PluginVersionResult result = resolveFromProject( request );
|
||||
|
||||
|
||||
PluginVersionResult result = resolveFromProject( request );
|
||||
|
||||
diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java
|
||||
index e788cea..430960c 100644
|
||||
index e6cc411..bab7885 100644
|
||||
--- a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java
|
||||
+++ b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java
|
||||
@@ -42,6 +42,7 @@ import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResolutionException;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResolutionException;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
+import org.apache.maven.artifact.resolver.JavadirWorkspaceReader;
|
||||
|
||||
/**
|
||||
* A model resolver to assist building of projects. This resolver gives priority to those repositories that have been
|
||||
|
||||
/**
|
||||
* A model resolver to assist building of projects. This resolver gives priority to those repositories that have been
|
||||
@@ -147,6 +148,14 @@ class ProjectModelResolver
|
||||
if ( pomFile == null )
|
||||
{
|
||||
Artifact pomArtifact = new DefaultArtifact( groupId, artifactId, "", "pom", version );
|
||||
if ( pomFile == null )
|
||||
{
|
||||
Artifact pomArtifact = new DefaultArtifact( groupId, artifactId, "", "pom", version );
|
||||
+ if ( System.getProperty("maven.local.mode") != null) {
|
||||
+ JavadirWorkspaceReader wReader = new JavadirWorkspaceReader();
|
||||
+ pomFile = wReader.findArtifact(pomArtifact);
|
||||
@ -155,17 +155,17 @@ index e788cea..430960c 100644
|
||||
+ if ( pomFile != null)
|
||||
+ return new FileModelSource( pomFile );
|
||||
+ }
|
||||
|
||||
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 44a6879..7209b49 100644
|
||||
index 919f0ee..68a509d 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
|
||||
@@ -325,6 +325,15 @@ public class MavenMetadataSource
|
||||
return null;
|
||||
}
|
||||
|
||||
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
|
||||
@ -175,50 +175,50 @@ index 44a6879..7209b49 100644
|
||||
+ 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 =
|
||||
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
|
||||
index c97095f..ef0edc2 100644
|
||||
index d7a6ac9..6c76173 100644
|
||||
--- 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
|
||||
@@ -434,7 +434,11 @@ public class DefaultModelValidator
|
||||
|
||||
if ( !management )
|
||||
{
|
||||
- validateVersion( prefix + "version", problems, errOn30, d.getVersion(), d.getManagementKey(), d );
|
||||
@@ -433,7 +433,11 @@ public class DefaultModelValidator
|
||||
|
||||
if ( !management )
|
||||
{
|
||||
- validateVersion( prefix + "version", problems, errOn30, d.getVersion(), d.getManagementKey(), d );
|
||||
+ // in local mode set version to "latest" and validate
|
||||
+ if(System.getProperty("maven.local.mode") != null && d.getVersion() == null)
|
||||
+ d.setVersion("latest");
|
||||
+ else
|
||||
+ validateVersion( prefix + "version", problems, errOn30, d.getVersion(), d.getManagementKey(), d );
|
||||
|
||||
/*
|
||||
* TODO: Extensions like Flex Mojos use custom scopes like "merged", "internal", "external", etc.
|
||||
@@ -462,7 +466,11 @@ public class DefaultModelValidator
|
||||
{
|
||||
validateEffectiveDependency( problems, d, false, prefix, request );
|
||||
|
||||
- validateVersion( prefix + "version", problems, errOn30, d.getVersion(), d.getManagementKey(), d );
|
||||
|
||||
/*
|
||||
* TODO: Extensions like Flex Mojos use custom scopes like "merged", "internal", "external", etc.
|
||||
@@ -461,7 +465,11 @@ public class DefaultModelValidator
|
||||
{
|
||||
validateEffectiveDependency( problems, d, false, prefix, request );
|
||||
|
||||
- validateVersion( prefix + "version", problems, errOn30, d.getVersion(), d.getManagementKey(), d );
|
||||
+ // in local mode set version to "latest" and validate
|
||||
+ if(System.getProperty("maven.local.mode") != null && d.getVersion() == null)
|
||||
+ d.setVersion("latest");
|
||||
+ else
|
||||
+ validateVersion( prefix + "version", problems, errOn30, d.getVersion(), d.getManagementKey(), d );
|
||||
|
||||
validateEnum( prefix + "scope", problems, errOn30, d.getScope(), d.getManagementKey(), d, "compile",
|
||||
"runtime", "system" );
|
||||
@@ -481,7 +489,9 @@ public class DefaultModelValidator
|
||||
{
|
||||
validateStringNotEmpty( prefix + "type", problems, Severity.ERROR, d.getType(), d.getManagementKey(), d );
|
||||
|
||||
- validateStringNotEmpty( prefix + "version", problems, Severity.ERROR, d.getVersion(), d.getManagementKey(),
|
||||
|
||||
validateEnum( prefix + "scope", problems, errOn30, d.getScope(), d.getManagementKey(), d, "compile",
|
||||
"runtime", "system" );
|
||||
@@ -480,7 +488,9 @@ public class DefaultModelValidator
|
||||
{
|
||||
validateStringNotEmpty( prefix + "type", problems, Severity.ERROR, d.getType(), d.getManagementKey(), d );
|
||||
|
||||
- validateStringNotEmpty( prefix + "version", problems, Severity.ERROR, d.getVersion(), d.getManagementKey(),
|
||||
+ // in local mode ignore missing version completely
|
||||
+ if(System.getProperty("maven.local.mode") == null)
|
||||
+ validateStringNotEmpty( prefix + "version", problems, Severity.ERROR, d.getVersion(), d.getManagementKey(),
|
||||
d );
|
||||
}
|
||||
|
||||
d );
|
||||
}
|
||||
|
||||
--
|
||||
1.7.6
|
||||
1.7.7.6
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
From 053974e55c21a372e544ba23f5eca6c864cc283c Mon Sep 17 00:00:00 2001
|
||||
From b38e59d0512fed8f376fcbdea71204b04cdee1cb Mon Sep 17 00:00:00 2001
|
||||
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
|
||||
Date: Tue, 30 Aug 2011 11:43:01 +0200
|
||||
Subject: [PATCH 3/4] Use utf-8 source encoding
|
||||
Date: Mon, 22 Aug 2011 15:59:53 +0200
|
||||
Subject: [PATCH 3/5] Use utf-8 source encoding
|
||||
|
||||
---
|
||||
pom.xml | 1 +
|
||||
1 files changed, 1 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index e2f2cd0..6bb27f3 100644
|
||||
index 3aacefc..8cba9cc 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -52,6 +52,7 @@
|
||||
<jxpathVersion>1.3</jxpathVersion>
|
||||
<aetherVersion>1.11</aetherVersion>
|
||||
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
|
||||
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<mailingLists>
|
||||
@@ -65,6 +65,7 @@
|
||||
<siteDeployUrl>scp://people.apache.org/www/maven.apache.org/ref/${project.version}/</siteDeployUrl>
|
||||
<siteUrl>http://maven.apache.org/ref/${project.version}/</siteUrl>
|
||||
|
||||
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<mailingLists>
|
||||
--
|
||||
1.7.6
|
||||
1.7.7.6
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From d3c8d75d197ac8494c87f26ea63733d4f5163c7f Mon Sep 17 00:00:00 2001
|
||||
From c626f99ce509b9a505d2ced39efd7ae7c748d71e Mon Sep 17 00:00:00 2001
|
||||
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
|
||||
Date: Tue, 30 Aug 2011 11:44:42 +0200
|
||||
Subject: [PATCH 4/4] Fix text scope skipping with maven.test.skip
|
||||
Subject: [PATCH 4/5] Fix text scope skipping with maven.test.skip
|
||||
|
||||
Previously maven put test dependencies into dependency graph even when
|
||||
"maven.test.skip" was true, therefore. This patch fixes that with few
|
||||
@ -25,54 +25,54 @@ literally referencing "test" scope is probably not 100% clean.
|
||||
create mode 100644 maven-core/src/main/java/org/apache/maven/SkipTestScopeDependencySelector.java
|
||||
|
||||
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 2e65979..601ace7 100644
|
||||
index 9c8364d..6b3af89 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
|
||||
@@ -460,6 +460,23 @@ public class DefaultArtifactResolver
|
||||
return result;
|
||||
}
|
||||
|
||||
+ // When we find maven.test.skip property we remove dependencies
|
||||
+ // with scope "test" from artifact set. Current implementation
|
||||
+ // of artifacts doesn't implement "remove" method so create a
|
||||
+ // new object and copy non-test artifacts there
|
||||
+ if (System.getProperty("maven.test.skip") != null) {
|
||||
+ Set<Artifact> newArtifacts = new LinkedHashSet<Artifact>();
|
||||
+ for (Artifact artifact: artifacts)
|
||||
+ {
|
||||
+ String scope = artifact.getScope();
|
||||
+ if (scope == null || !scope.equals("test"))
|
||||
+ {
|
||||
+ newArtifacts.add(artifact);
|
||||
+ }
|
||||
+ }
|
||||
+ artifacts = newArtifacts;
|
||||
+ }
|
||||
+
|
||||
// After the collection we will have the artifact object in the result but they will not be resolved yet.
|
||||
result =
|
||||
artifactCollector.collect( artifacts, rootArtifact, managedVersions, collectionRequest, source,
|
||||
return result;
|
||||
}
|
||||
|
||||
+ // When we find maven.test.skip property we remove dependencies
|
||||
+ // with scope "test" from artifact set. Current implementation
|
||||
+ // of artifacts doesn't implement "remove" method so create a
|
||||
+ // new object and copy non-test artifacts there
|
||||
+ if (System.getProperty("maven.test.skip") != null) {
|
||||
+ Set<Artifact> newArtifacts = new LinkedHashSet<Artifact>();
|
||||
+ for (Artifact artifact: artifacts)
|
||||
+ {
|
||||
+ String scope = artifact.getScope();
|
||||
+ if (scope == null || !scope.equals("test"))
|
||||
+ {
|
||||
+ newArtifacts.add(artifact);
|
||||
+ }
|
||||
+ }
|
||||
+ artifacts = newArtifacts;
|
||||
+ }
|
||||
+
|
||||
// After the collection we will have the artifact object in the result but they will not be resolved yet.
|
||||
result =
|
||||
artifactCollector.collect( artifacts, rootArtifact, managedVersions, collectionRequest, source,
|
||||
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 8fdb6ed..75d1e37 100644
|
||||
index 7bff4a0..9b0da93 100644
|
||||
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
|
||||
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
|
||||
@@ -31,6 +31,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
+import org.apache.maven.SkipTestScopeDependencySelector;
|
||||
import org.apache.maven.artifact.ArtifactUtils;
|
||||
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
|
||||
import org.apache.maven.eventspy.internal.EventSpyDispatcher;
|
||||
@@ -437,7 +438,7 @@ public class DefaultMaven
|
||||
|
||||
DependencySelector depFilter =
|
||||
new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ), new OptionalDependencySelector(),
|
||||
- new ExclusionDependencySelector() );
|
||||
+ new ExclusionDependencySelector(), new SkipTestScopeDependencySelector() );
|
||||
session.setDependencySelector( depFilter );
|
||||
|
||||
DependencyGraphTransformer transformer =
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
+import org.apache.maven.SkipTestScopeDependencySelector;
|
||||
import org.apache.maven.artifact.ArtifactUtils;
|
||||
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
|
||||
import org.apache.maven.eventspy.internal.EventSpyDispatcher;
|
||||
@@ -449,7 +450,7 @@ public class DefaultMaven
|
||||
|
||||
DependencySelector depFilter =
|
||||
new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ), new OptionalDependencySelector(),
|
||||
- new ExclusionDependencySelector() );
|
||||
+ new ExclusionDependencySelector(), new SkipTestScopeDependencySelector() );
|
||||
session.setDependencySelector( depFilter );
|
||||
|
||||
DependencyGraphTransformer transformer =
|
||||
diff --git a/maven-core/src/main/java/org/apache/maven/SkipTestScopeDependencySelector.java b/maven-core/src/main/java/org/apache/maven/SkipTestScopeDependencySelector.java
|
||||
new file mode 100644
|
||||
index 0000000..60be724
|
||||
@ -152,5 +152,5 @@ index 0000000..60be724
|
||||
+
|
||||
+}
|
||||
--
|
||||
1.7.6
|
||||
1.7.7.6
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class JavadirWorkspaceReader implements WorkspaceReader {
|
||||
|
||||
public List<String> findVersions(Artifact artifact) {
|
||||
List<String> ret = new LinkedList<String>();
|
||||
ret.add("latest");
|
||||
ret.add("LATEST");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
16
maven.spec
16
maven.spec
@ -1,8 +1,8 @@
|
||||
%global debug_package %{nil}
|
||||
|
||||
Name: maven
|
||||
Version: 3.0.3
|
||||
Release: 17%{?dist}
|
||||
Version: 3.0.4
|
||||
Release: 1%{?dist}
|
||||
Summary: Java project management and project comprehension tool
|
||||
|
||||
Group: Development/Tools
|
||||
@ -10,7 +10,7 @@ License: ASL 2.0 and MIT and BSD
|
||||
URL: http://maven.apache.org/
|
||||
# Source URL is for testing only, final version will be in different place:
|
||||
# http://www.apache.org/dyn/closer.cgi/maven/source/apache-%{name}-%{version}-src.tar.gz
|
||||
Source0: http://www.apache.org/dyn/closer.cgi/maven/source/apache-%{name}-%{version}-src.tar.gz
|
||||
Source0: http://www.apache.org/dist//maven/source/apache-%{name}-%{version}-src.tar.gz
|
||||
Source1: maven-bash-completion
|
||||
|
||||
# custom resolver java files
|
||||
@ -31,6 +31,7 @@ Source202: %{name}-script-rpmbuild
|
||||
Source250: repo-metadata.tar.xz
|
||||
|
||||
# Patch1XX could be upstreamed probably
|
||||
Patch100: 0005-Use-generics-in-modello-generated-code.patch
|
||||
# Patch15X are already upstream
|
||||
Patch150: 0001-Add-plugin-api-deps.patch
|
||||
Patch151: 0003-Use-utf-8-source-encoding.patch
|
||||
@ -38,6 +39,7 @@ Patch151: 0003-Use-utf-8-source-encoding.patch
|
||||
Patch200: 0002-Use-custom-resolver.patch
|
||||
Patch201: 0004-Fix-text-scope-skipping-with-maven.test.skip.patch
|
||||
|
||||
|
||||
BuildRequires: maven
|
||||
BuildRequires: maven2-common-poms
|
||||
BuildRequires: maven-parent
|
||||
@ -56,7 +58,7 @@ BuildRequires: plexus-containers-container-default
|
||||
BuildRequires: animal-sniffer >= 1.6-5
|
||||
BuildRequires: mojo-parent
|
||||
BuildRequires: atinject
|
||||
BuildRequires: aether >= 1.11
|
||||
BuildRequires: aether >= 1.13.1
|
||||
BuildRequires: async-http-client
|
||||
BuildRequires: sonatype-oss-parent
|
||||
BuildRequires: sisu >= 2.1.1-2
|
||||
@ -81,7 +83,7 @@ Requires: plexus-utils
|
||||
Requires: xbean
|
||||
Requires: xerces-j2
|
||||
Requires: maven-wagon
|
||||
Requires: aether >= 1.11
|
||||
Requires: aether >= 1.13.1
|
||||
Requires: async-http-client
|
||||
Requires: sonatype-oss-parent
|
||||
Requires: sisu >= 2.1.1-2
|
||||
@ -113,6 +115,7 @@ Requires: jpackage-utils
|
||||
|
||||
%prep
|
||||
%setup -q -n apache-%{name}-%{version}%{?ver_add}
|
||||
%patch100 -p1
|
||||
%patch150 -p1
|
||||
%patch151 -p1
|
||||
%patch200 -p1
|
||||
@ -335,6 +338,9 @@ install -Dm 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/bash_completion.d/%{name}
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Jan 31 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0.4-1
|
||||
- Update to latest upstream version
|
||||
|
||||
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.3-17
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user