From 7f056fa56e287cbe72f10ab188b9909ac06caf50 Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Sun, 18 Sep 2011 18:20:10 +0000 Subject: [PATCH 01/69] [MNG-5134] Improvements to model interpolation docs related to available properties. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1172314 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model-builder/src/site/apt/index.apt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/maven-model-builder/src/site/apt/index.apt b/maven-model-builder/src/site/apt/index.apt index 80ab2233c1..59f630f073 100644 --- a/maven-model-builder/src/site/apt/index.apt +++ b/maven-model-builder/src/site/apt/index.apt @@ -81,17 +81,23 @@ Maven Model Builder *----+------+------+ | <<>>\ <<>>\ -<<>> () | the directory containing the <<>> file | | +<<>> () | the directory containing the <<>> file | <<<$\{project.basedir\}>>> | *----+------+------+ | <<>>\ <<>> () | the directory containing the <<>> file as URI | | *----+------+------+ +| <<>> | Local user settings (see {{{../maven-settings/settings.xml/settings.html}setings reference}}) | <<<$\{settings.localRepository\}>>> | +*----+------+------+ +| <<>> | The version number of the current Maven execution. For example, "3.0.3". | <<<$\{maven.version\}>>> | +*----+------+------+ +| <<>> | The full build version of the current Maven execution. For example, "Apache Maven 3.0.3 (r1075438; 2011-02-28 11:31:09-0600)". | <<<$\{maven.build.version\}>>> | +*----+------+------+ | <<>>\ -<<>> | the timestamp of build start, in <<>> default format, which can be overridden with <<>> POM property | | +<<>> | the timestamp of build start, in <<>> default format, which can be overridden with <<>> POM property | <<<$\{maven.build.timestamp\}>>> | *----+------+------+ -| <<<*>>> | user properties, set from CLI with <<<-Dproperty=value>>> | <<<$\{skip\}>>> | +| <<<*>>> | user properties, set from CLI with <<<-Dproperty=value>>> | <<<$\{skipTests\}>>> | *----+------+------+ -| <<<*>>> | model properties | <<<$\{any.key\}>>> | +| <<<*>>> | model properties, such as project properties set in the pom | <<<$\{any.key\}>>> | *----+------+------+ | <<<*>>> | Java system properties (see {{{http://download.oracle.com/javase/1,5.0/docs/api/java/lang/System.html#getProperties()}JDK reference}}) | <<<$\{user.home\}>>>\ | | <<<$\{java.home\}>>> | From fbc7a8b9ed235a305cd75b1ad79c7f36a62be673 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 18 Sep 2011 19:38:45 +0000 Subject: [PATCH 02/69] |MNG-5134] moved maven.version and maven.build.version just before Java system properties since they are defined (in MavenCli.java) as system property git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1172327 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model-builder/src/site/apt/index.apt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/maven-model-builder/src/site/apt/index.apt b/maven-model-builder/src/site/apt/index.apt index 59f630f073..58c90e496f 100644 --- a/maven-model-builder/src/site/apt/index.apt +++ b/maven-model-builder/src/site/apt/index.apt @@ -84,13 +84,9 @@ Maven Model Builder <<>> () | the directory containing the <<>> file | <<<$\{project.basedir\}>>> | *----+------+------+ | <<>>\ -<<>> () | the directory containing the <<>> file as URI | | +<<>> () | the directory containing the <<>> file as URI | <<<$\{project.baseUri\}>>> | *----+------+------+ -| <<>> | Local user settings (see {{{../maven-settings/settings.xml/settings.html}setings reference}}) | <<<$\{settings.localRepository\}>>> | -*----+------+------+ -| <<>> | The version number of the current Maven execution. For example, "3.0.3". | <<<$\{maven.version\}>>> | -*----+------+------+ -| <<>> | The full build version of the current Maven execution. For example, "Apache Maven 3.0.3 (r1075438; 2011-02-28 11:31:09-0600)". | <<<$\{maven.build.version\}>>> | +| <<>> | Local user settings (see {{{../maven-settings/settings.xml/settings.html}settings reference}}) | <<<$\{settings.localRepository\}>>> | *----+------+------+ | <<>>\ <<>> | the timestamp of build start, in <<>> default format, which can be overridden with <<>> POM property | <<<$\{maven.build.timestamp\}>>> | @@ -99,6 +95,10 @@ Maven Model Builder *----+------+------+ | <<<*>>> | model properties, such as project properties set in the pom | <<<$\{any.key\}>>> | *----+------+------+ +| <<>> | The version number of the current Maven execution. For example, "<<<3.0.3>>>". | <<<$\{maven.version\}>>> | +*----+------+------+ +| <<>> | The full build version of the current Maven execution. For example, "<<>>". | <<<$\{maven.build.version\}>>> | +*----+------+------+ | <<<*>>> | Java system properties (see {{{http://download.oracle.com/javase/1,5.0/docs/api/java/lang/System.html#getProperties()}JDK reference}}) | <<<$\{user.home\}>>>\ | | <<<$\{java.home\}>>> | *----+------+------+ From 46f194dc02d1edac74df6ab26076d8de4a9ba7f3 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 18 Sep 2011 19:39:21 +0000 Subject: [PATCH 03/69] |MNG-5134] added maven.home property git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1172328 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model-builder/src/site/apt/index.apt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maven-model-builder/src/site/apt/index.apt b/maven-model-builder/src/site/apt/index.apt index 58c90e496f..9312924321 100644 --- a/maven-model-builder/src/site/apt/index.apt +++ b/maven-model-builder/src/site/apt/index.apt @@ -95,6 +95,8 @@ Maven Model Builder *----+------+------+ | <<<*>>> | model properties, such as project properties set in the pom | <<<$\{any.key\}>>> | *----+------+------+ +| <<>> | The path to the current Maven execution. | <<<$\{maven.home\}>>> | +*----+------+------+ | <<>> | The version number of the current Maven execution. For example, "<<<3.0.3>>>". | <<<$\{maven.version\}>>> | *----+------+------+ | <<>> | The full build version of the current Maven execution. For example, "<<>>". | <<<$\{maven.build.version\}>>> | From d935c0ff3fdb7a64edb3fa72903a60dac2380287 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 18 Sep 2011 19:48:52 +0000 Subject: [PATCH 04/69] |MNG-5134] moved settings.* to the end of the list since it is not even evaluated during POM interpolation, but only written here for reference git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1172331 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model-builder/src/site/apt/index.apt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maven-model-builder/src/site/apt/index.apt b/maven-model-builder/src/site/apt/index.apt index 9312924321..c5a2f71d48 100644 --- a/maven-model-builder/src/site/apt/index.apt +++ b/maven-model-builder/src/site/apt/index.apt @@ -86,8 +86,6 @@ Maven Model Builder | <<>>\ <<>> () | the directory containing the <<>> file as URI | <<<$\{project.baseUri\}>>> | *----+------+------+ -| <<>> | Local user settings (see {{{../maven-settings/settings.xml/settings.html}settings reference}}) | <<<$\{settings.localRepository\}>>> | -*----+------+------+ | <<>>\ <<>> | the timestamp of build start, in <<>> default format, which can be overridden with <<>> POM property | <<<$\{maven.build.timestamp\}>>> | *----+------+------+ @@ -95,7 +93,7 @@ Maven Model Builder *----+------+------+ | <<<*>>> | model properties, such as project properties set in the pom | <<<$\{any.key\}>>> | *----+------+------+ -| <<>> | The path to the current Maven execution. | <<<$\{maven.home\}>>> | +| <<>> | The path to the current Maven home. | <<<$\{maven.home\}>>> | *----+------+------+ | <<>> | The version number of the current Maven execution. For example, "<<<3.0.3>>>". | <<<$\{maven.version\}>>> | *----+------+------+ @@ -106,6 +104,8 @@ Maven Model Builder *----+------+------+ | <<>>\ <<<*>>> | environment variables | <<<$\{env.PATH\}>>> | +*----+------+------+ +| <<>> | Local user settings (see {{{../maven-settings/settings.xml/settings.html}settings reference}}) | <<<$\{settings.localRepository\}>>> | *----+------+------+ Notice that after model interpolation, <<<$\{...\}>>> content can remain in the model that will be evaluated later From 64d86e9f82b4c21a337e93dbf5651ea88dd07386 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 19 Sep 2011 08:37:25 +0000 Subject: [PATCH 05/69] [MNG-5175] replace wagon http lightweight with wagon http 2.0 (SNAPSHOT currently) git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1172517 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 9 ++++++++- .../test/resources/org/apache/maven/lifecycle/pom.xml | 2 +- pom.xml | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 9b8d3276e6..cd0b55733a 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -58,7 +58,14 @@ org.apache.maven.wagon - wagon-http-lightweight + wagon-http + shaded + + + org.apache.maven.wagon + wagon-http-shared4 + + org.apache.maven.wagon 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 a01b7cedbd..5a6b9d9534 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 @@ -394,7 +394,7 @@ under the License. org.apache.maven.wagon - wagon-http-lightweight + wagon-http ${wagonVersion} diff --git a/pom.xml b/pom.xml index e003c20440..8a9b256647 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ 1.14 2.0.6 2.1.1 - 1.0 + 2.0-SNAPSHOT 1.3 1.7 1.4.1 @@ -283,8 +283,9 @@ org.apache.maven.wagon - wagon-http-lightweight + wagon-http ${wagonVersion} + shaded commons-logging From fc6aac49cee4d405a8988523478105cf8e4194ed Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Thu, 22 Sep 2011 20:10:22 +0000 Subject: [PATCH 06/69] added default local repository location in description git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1174363 13f79535-47bb-0310-9956-ffa450edef68 --- maven-settings/src/main/mdo/settings.mdo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maven-settings/src/main/mdo/settings.mdo b/maven-settings/src/main/mdo/settings.mdo index 52b6f73e32..cbb0dbac75 100644 --- a/maven-settings/src/main/mdo/settings.mdo +++ b/maven-settings/src/main/mdo/settings.mdo @@ -120,7 +120,7 @@ true Default value is: ${user.home}/.m2/repository ]]> String From aab254c8a28c70fb50d7b4248753e303b1d42c93 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 25 Sep 2011 21:50:00 +0000 Subject: [PATCH 07/69] added "since" information for maven.version and maven.build.version values git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1175591 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model-builder/src/site/apt/index.apt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maven-model-builder/src/site/apt/index.apt b/maven-model-builder/src/site/apt/index.apt index c5a2f71d48..b6dfaca8b4 100644 --- a/maven-model-builder/src/site/apt/index.apt +++ b/maven-model-builder/src/site/apt/index.apt @@ -95,9 +95,9 @@ Maven Model Builder *----+------+------+ | <<>> | The path to the current Maven home. | <<<$\{maven.home\}>>> | *----+------+------+ -| <<>> | The version number of the current Maven execution. For example, "<<<3.0.3>>>". | <<<$\{maven.version\}>>> | +| <<>> | The version number of the current Maven execution <(since 3.0.4)>. For example, "<<<3.0.3>>>". | <<<$\{maven.version\}>>> | *----+------+------+ -| <<>> | The full build version of the current Maven execution. For example, "<<>>". | <<<$\{maven.build.version\}>>> | +| <<>> | The full build version of the current Maven execution <(since 3.0.4)>. For example, "<<>>". | <<<$\{maven.build.version\}>>> | *----+------+------+ | <<<*>>> | Java system properties (see {{{http://download.oracle.com/javase/1,5.0/docs/api/java/lang/System.html#getProperties()}JDK reference}}) | <<<$\{user.home\}>>>\ | | <<<$\{java.home\}>>> | From 56f15402204568654de9d7ac7970e5657d7df85d Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 25 Sep 2011 21:52:34 +0000 Subject: [PATCH 08/69] use java 6 API docs link git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1175592 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model-builder/src/site/apt/index.apt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maven-model-builder/src/site/apt/index.apt b/maven-model-builder/src/site/apt/index.apt index b6dfaca8b4..0b25f9042b 100644 --- a/maven-model-builder/src/site/apt/index.apt +++ b/maven-model-builder/src/site/apt/index.apt @@ -99,7 +99,7 @@ Maven Model Builder *----+------+------+ | <<>> | The full build version of the current Maven execution <(since 3.0.4)>. For example, "<<>>". | <<<$\{maven.build.version\}>>> | *----+------+------+ -| <<<*>>> | Java system properties (see {{{http://download.oracle.com/javase/1,5.0/docs/api/java/lang/System.html#getProperties()}JDK reference}}) | <<<$\{user.home\}>>>\ +| <<<*>>> | Java system properties (see {{{http://download.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties()}JDK reference}}) | <<<$\{user.home\}>>>\ | | <<<$\{java.home\}>>> | *----+------+------+ | <<>>\ From 870a3b3e8040a7ee2727480bc0a43121ac99e59c Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Tue, 27 Sep 2011 14:37:20 +0000 Subject: [PATCH 09/69] [MNG-5157] NPE stemming from DefaultModelBuilder.containsCoordinates o Revised original fix to prevent duplicate emission of error msg git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1176402 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/model/building/DefaultModelBuilder.java | 12 ++++++++++++ .../model/validation/DefaultModelValidator.java | 6 ------ 2 files changed, 12 insertions(+), 6 deletions(-) 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 093305c8d3..86a90d3254 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 @@ -909,6 +909,18 @@ public class DefaultModelBuilder String artifactId = dependency.getArtifactId(); String version = dependency.getVersion(); + if ( groupId == null || groupId.length() <= 0 ) + { + problems.add( Severity.ERROR, "'dependencyManagement.dependencies.dependency.groupId' for " + + dependency.getManagementKey() + " is missing.", dependency.getLocation( "" ), null ); + continue; + } + if ( artifactId == null || artifactId.length() <= 0 ) + { + problems.add( Severity.ERROR, "'dependencyManagement.dependencies.dependency.artifactId' for " + + dependency.getManagementKey() + " is missing.", dependency.getLocation( "" ), null ); + continue; + } if ( version == null || version.length() <= 0 ) { problems.add( Severity.ERROR, "'dependencyManagement.dependencies.dependency.version' for " 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 a17e9c2fc5..d7a6ac9b5a 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 @@ -356,12 +356,6 @@ public class DefaultModelValidator { String key = dependency.getManagementKey(); - validateStringNotEmpty( prefix + ".groupId", problems, Severity.ERROR, dependency.getGroupId(), key, - dependency ); - - validateStringNotEmpty( prefix + ".artifactId", problems, Severity.ERROR, dependency.getArtifactId(), key, - dependency ); - if ( "import".equals( dependency.getScope() ) ) { if ( !"pom".equals( dependency.getType() ) ) From c3bf134f5717019581b7445467738a6142c1078c Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Tue, 27 Sep 2011 14:55:56 +0000 Subject: [PATCH 10/69] [MNG-5073] ProjectBuilder.build(File,ProjectBuildingRequest) returns null project if dependency version info is missing git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1176414 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/project/DefaultProjectBuilder.java | 89 ++++++++++++------- .../DefaultProjectDependenciesResolver.java | 7 ++ .../project/AbstractMavenProjectTestCase.java | 16 ++-- .../DefaultMavenProjectBuilderTest.java | 29 +++++- .../repository/TestRepositoryConnector.java | 10 ++- .../resources/projects/bad-dependency.xml | 27 ++++++ .../model/building/DefaultModelBuilder.java | 30 +++---- .../DefaultModelProblemCollector.java | 25 +++++- .../building/ModelBuildingException.java | 82 +++++++++++++---- 9 files changed, 238 insertions(+), 77 deletions(-) create mode 100644 maven-core/src/test/resources/projects/bad-dependency.xml diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index 0469e2eafe..f4103028fa 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -18,6 +18,7 @@ package org.apache.maven.project; import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashSet; @@ -119,6 +120,7 @@ public class DefaultProjectBuilder MavenProject project = configuration.getProject(); List modelProblems = null; + Throwable error = null; if ( project == null ) { @@ -141,7 +143,13 @@ public class DefaultProjectBuilder } catch ( ModelBuildingException e ) { - throw new ProjectBuildingException( e.getModelId(), e.getMessage(), pomFile, e ); + result = e.getResult(); + if ( result == null || result.getEffectiveModel() == null ) + { + throw new ProjectBuildingException( e.getModelId(), e.getMessage(), pomFile, e ); + } + // validation error, continue project building and delay failing to help IDEs + error = e; } modelProblems = result.getProblems(); @@ -158,39 +166,19 @@ public class DefaultProjectBuilder if ( configuration.isResolveDependencies() ) { - try - { - DefaultDependencyResolutionRequest resolution = - new DefaultDependencyResolutionRequest( project, config.session ); - resolutionResult = dependencyResolver.resolve( resolution ); - } - catch ( DependencyResolutionException e ) - { - resolutionResult = e.getResult(); - } - - Set artifacts = new LinkedHashSet(); - if ( resolutionResult.getDependencyGraph() != null ) - { - RepositoryUtils.toArtifacts( artifacts, resolutionResult.getDependencyGraph().getChildren(), - Collections.singletonList( project.getArtifact().getId() ), null ); - - // Maven 2.x quirk: an artifact always points at the local repo, regardless whether resolved or not - LocalRepositoryManager lrm = config.session.getLocalRepositoryManager(); - for ( Artifact artifact : artifacts ) - { - if ( !artifact.isResolved() ) - { - String path = lrm.getPathForLocalArtifact( RepositoryUtils.toArtifact( artifact ) ); - artifact.setFile( new File( lrm.getRepository().getBasedir(), path ) ); - } - } - } - project.setResolvedArtifacts( artifacts ); - project.setArtifacts( artifacts ); + resolutionResult = resolveDependencies( project, config.session ); } - return new DefaultProjectBuildingResult( project, modelProblems, resolutionResult ); + ProjectBuildingResult result = new DefaultProjectBuildingResult( project, modelProblems, resolutionResult ); + + if ( error != null ) + { + ProjectBuildingException e = new ProjectBuildingException( Arrays.asList( result ) ); + e.initCause( error ); + throw e; + } + + return result; } finally { @@ -198,6 +186,43 @@ public class DefaultProjectBuilder } } + private DependencyResolutionResult resolveDependencies( MavenProject project, RepositorySystemSession session ) + { + DependencyResolutionResult resolutionResult = null; + + try + { + DefaultDependencyResolutionRequest resolution = new DefaultDependencyResolutionRequest( project, session ); + resolutionResult = dependencyResolver.resolve( resolution ); + } + catch ( DependencyResolutionException e ) + { + resolutionResult = e.getResult(); + } + + Set artifacts = new LinkedHashSet(); + if ( resolutionResult.getDependencyGraph() != null ) + { + RepositoryUtils.toArtifacts( artifacts, resolutionResult.getDependencyGraph().getChildren(), + Collections.singletonList( project.getArtifact().getId() ), null ); + + // Maven 2.x quirk: an artifact always points at the local repo, regardless whether resolved or not + LocalRepositoryManager lrm = session.getLocalRepositoryManager(); + for ( Artifact artifact : artifacts ) + { + if ( !artifact.isResolved() ) + { + String path = lrm.getPathForLocalArtifact( RepositoryUtils.toArtifact( artifact ) ); + artifact.setFile( new File( lrm.getRepository().getBasedir(), path ) ); + } + } + } + project.setResolvedArtifacts( artifacts ); + project.setArtifacts( artifacts ); + + return resolutionResult; + } + private List getProfileIds( List profiles ) { List ids = new ArrayList( profiles.size() ); 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 2c3ca3b7e1..2d9b15944e 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 @@ -33,6 +33,7 @@ import org.apache.maven.model.InputSource; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.StringUtils; import org.sonatype.aether.RepositorySystem; import org.sonatype.aether.RepositorySystemSession; import org.sonatype.aether.RequestTrace; @@ -85,6 +86,12 @@ public class DefaultProjectDependenciesResolver { for ( Dependency dependency : project.getDependencies() ) { + if ( StringUtils.isEmpty( dependency.getGroupId() ) || StringUtils.isEmpty( dependency.getArtifactId() ) + || StringUtils.isEmpty( dependency.getVersion() ) ) + { + // guard against case where best-effort resolution for invalid models is requested + continue; + } collect.addDependency( RepositoryUtils.toDependency( dependency, stereotypes ) ); } } diff --git a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java index a5a841c355..aa54f3eae4 100644 --- a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java +++ b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java @@ -124,12 +124,10 @@ public abstract class AbstractMavenProjectTestCase protected MavenProject getProjectWithDependencies( File pom ) throws Exception { - ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); - configuration.setLocalRepository( getLocalRepository() ); + ProjectBuildingRequest configuration = newBuildingRequest(); configuration.setRemoteRepositories( Arrays.asList( new ArtifactRepository[] {} ) ); configuration.setProcessPlugins( false ); configuration.setResolveDependencies( true ); - initRepoSession( configuration ); try { @@ -146,7 +144,6 @@ public abstract class AbstractMavenProjectTestCase message += problem + "\n"; } System.out.println( message ); - fail( message ); } throw e; @@ -155,12 +152,19 @@ public abstract class AbstractMavenProjectTestCase protected MavenProject getProject( File pom ) throws Exception + { + ProjectBuildingRequest configuration = newBuildingRequest(); + + return projectBuilder.build( pom, configuration ).getProject(); + } + + protected ProjectBuildingRequest newBuildingRequest() + throws Exception { ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); configuration.setLocalRepository( getLocalRepository() ); initRepoSession( configuration ); - - return projectBuilder.build( pom, configuration ).getProject(); + return configuration; } protected void initRepoSession( ProjectBuildingRequest request ) diff --git a/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java b/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java index a77755a9c5..15dbed8139 100644 --- a/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java @@ -155,5 +155,32 @@ public class DefaultMavenProjectBuilderTest getProject( f1 ); } } - + + public void testPartialResultUponBadDependencyDeclaration() + throws Exception + { + File pomFile = getTestFile( "src/test/resources/projects/bad-dependency.xml" ); + + try + { + ProjectBuildingRequest request = newBuildingRequest(); + request.setProcessPlugins( false ); + request.setResolveDependencies( true ); + projectBuilder.build( pomFile, request ); + fail( "Project building did not fail despite invalid POM" ); + } + catch ( ProjectBuildingException e ) + { + List results = e.getResults(); + assertNotNull( results ); + assertEquals( 1, results.size() ); + ProjectBuildingResult result = results.get( 0 ); + assertNotNull( result ); + assertNotNull( result.getProject() ); + assertEquals( 1, result.getProblems().size() ); + assertEquals( 1, result.getProject().getArtifacts().size() ); + assertNotNull( result.getDependencyResolutionResult() ); + } + } + } diff --git a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java index d48a3f2610..d2a25b1f13 100644 --- a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java +++ b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java @@ -33,6 +33,7 @@ import org.sonatype.aether.spi.connector.ArtifactUpload; import org.sonatype.aether.spi.connector.MetadataDownload; import org.sonatype.aether.spi.connector.MetadataUpload; import org.sonatype.aether.spi.connector.RepositoryConnector; +import org.sonatype.aether.transfer.ArtifactNotFoundException; import org.sonatype.aether.transfer.ArtifactTransferException; /** @@ -77,7 +78,14 @@ public class TestRepositoryConnector } catch ( IOException e ) { - download.setException( new ArtifactTransferException( download.getArtifact(), repository, e ) ); + if ( !remoteFile.exists() ) + { + download.setException( new ArtifactNotFoundException( download.getArtifact(), repository ) ); + } + else + { + download.setException( new ArtifactTransferException( download.getArtifact(), repository, e ) ); + } } } } diff --git a/maven-core/src/test/resources/projects/bad-dependency.xml b/maven-core/src/test/resources/projects/bad-dependency.xml new file mode 100644 index 0000000000..4b5424ae31 --- /dev/null +++ b/maven-core/src/test/resources/projects/bad-dependency.xml @@ -0,0 +1,27 @@ + + 4.0.0 + + test + invalid + 0.0.1-SNAPSHOT + + + + central + file:src/test/remote-repo + + + + + + + b + 0.1 + + + org.apache.maven.its + a + 0.1 + + + 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 86a90d3254..8f08904d63 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 @@ -237,7 +237,7 @@ public class DefaultModelBuilder { DefaultModelBuildingResult result = new DefaultModelBuildingResult(); - DefaultModelProblemCollector problems = new DefaultModelProblemCollector( null ); + DefaultModelProblemCollector problems = new DefaultModelProblemCollector( result ); DefaultProfileActivationContext profileActivationContext = getProfileActivationContext( request ); @@ -245,6 +245,8 @@ public class DefaultModelBuilder List activeExternalProfiles = profileSelector.getActiveProfiles( request.getProfiles(), profileActivationContext, problems ); + result.setActiveExternalProfiles( activeExternalProfiles ); + if ( !activeExternalProfiles.isEmpty() ) { Properties profileProps = new Properties(); @@ -321,8 +323,7 @@ public class DefaultModelBuilder message += currentData.getId(); problems.add( ModelProblem.Severity.FATAL, message, null, null ); - throw new ModelBuildingException( problems.getRootModel(), problems.getRootModelId(), - problems.getProblems() ); + throw problems.newModelBuildingException(); } } @@ -345,12 +346,8 @@ public class DefaultModelBuilder resultData.setArtifactId( resultModel.getArtifactId() ); resultData.setVersion( resultModel.getVersion() ); - result.setProblems( problems.getProblems() ); - result.setEffectiveModel( resultModel ); - result.setActiveExternalProfiles( activeExternalProfiles ); - for ( ModelData currentData : lineage ) { String modelId = ( currentData != superData ) ? currentData.getId() : ""; @@ -380,7 +377,7 @@ public class DefaultModelBuilder { Model resultModel = result.getEffectiveModel(); - DefaultModelProblemCollector problems = new DefaultModelProblemCollector( result.getProblems() ); + DefaultModelProblemCollector problems = new DefaultModelProblemCollector( result ); problems.setSource( resultModel ); problems.setRootModel( resultModel ); @@ -419,7 +416,7 @@ public class DefaultModelBuilder if ( problems.hasErrors() ) { - throw new ModelBuildingException( resultModel, problems.getRootModelId(), problems.getProblems() ); + throw problems.newModelBuildingException(); } return result; @@ -499,8 +496,7 @@ public class DefaultModelBuilder { problems.add( Severity.FATAL, "Non-parseable POM " + modelSource.getLocation() + ": " + e.getMessage(), null, e ); - throw new ModelBuildingException( problems.getRootModel(), problems.getRootModelId(), - problems.getProblems() ); + throw problems.newModelBuildingException(); } catch ( IOException e ) { @@ -518,8 +514,7 @@ public class DefaultModelBuilder } } problems.add( Severity.FATAL, "Non-readable POM " + modelSource.getLocation() + ": " + msg, null, e ); - throw new ModelBuildingException( problems.getRootModel(), problems.getRootModelId(), - problems.getProblems() ); + throw problems.newModelBuildingException(); } model.setPomFile( pomFile ); @@ -529,8 +524,7 @@ public class DefaultModelBuilder if ( problems.hasFatalErrors() ) { - throw new ModelBuildingException( problems.getRootModel(), problems.getRootModelId(), - problems.getProblems() ); + throw problems.newModelBuildingException(); } return model; @@ -844,8 +838,7 @@ public class DefaultModelBuilder } problems.add( Severity.FATAL, buffer.toString(), parent.getLocation( "" ), e ); - throw new ModelBuildingException( problems.getRootModel(), problems.getRootModelId(), - problems.getProblems() ); + throw problems.newModelBuildingException(); } ModelBuildingRequest lenientRequest = request; @@ -863,8 +856,7 @@ public class DefaultModelBuilder Model parentModel = readModel( modelSource, null, lenientRequest, problems ); - ModelData parentData = - new ModelData( parentModel, parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); + ModelData parentData = new ModelData( parentModel, groupId, artifactId, version ); return parentData; } diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblemCollector.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblemCollector.java index 2c349fad29..4791065671 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblemCollector.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblemCollector.java @@ -19,7 +19,6 @@ package org.apache.maven.model.building; * under the License. */ -import java.util.ArrayList; import java.util.EnumSet; import java.util.List; import java.util.Set; @@ -42,6 +41,8 @@ class DefaultModelProblemCollector implements ModelProblemCollector { + private final ModelBuildingResult result; + private List problems; private String source; @@ -52,9 +53,10 @@ class DefaultModelProblemCollector private Set severities = EnumSet.noneOf( ModelProblem.Severity.class ); - public DefaultModelProblemCollector( List problems ) + public DefaultModelProblemCollector( ModelBuildingResult result ) { - this.problems = ( problems != null ) ? problems : new ArrayList(); + this.result = result; + this.problems = result.getProblems(); for ( ModelProblem problem : this.problems ) { @@ -176,4 +178,21 @@ class DefaultModelProblemCollector add( problem ); } + public ModelBuildingException newModelBuildingException() + { + ModelBuildingResult result = this.result; + if ( result.getModelIds().isEmpty() ) + { + DefaultModelBuildingResult tmp = new DefaultModelBuildingResult(); + tmp.setEffectiveModel( result.getEffectiveModel() ); + tmp.setProblems( getProblems() ); + tmp.setActiveExternalProfiles( result.getActiveExternalProfiles() ); + String id = getRootModelId(); + tmp.addModelId( id ); + tmp.setRawModel( id, getRootModel() ); + result = tmp; + } + return new ModelBuildingException( result ); + } + } diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelBuildingException.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelBuildingException.java index c216c92d69..193a6b4f49 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelBuildingException.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelBuildingException.java @@ -21,7 +21,7 @@ package org.apache.maven.model.building; import java.io.PrintWriter; import java.io.StringWriter; -import java.util.ArrayList; +import java.util.Collections; import java.util.List; import org.apache.maven.model.Model; @@ -37,11 +37,7 @@ public class ModelBuildingException extends Exception { - private final Model model; - - private final String modelId; - - private final List problems; + private final ModelBuildingResult result; /** * Creates a new exception with the specified problems. @@ -49,19 +45,50 @@ public class ModelBuildingException * @param model The model that could not be built, may be {@code null}. * @param modelId The identifier of the model that could not be built, may be {@code null}. * @param problems The problems that causes this exception, may be {@code null}. + * @deprecated Use {@link #ModelBuildingException(ModelBuildingResult)} instead. */ + @Deprecated public ModelBuildingException( Model model, String modelId, List problems ) { super( toMessage( modelId, problems ) ); - this.model = model; - this.modelId = ( modelId != null ) ? modelId : ""; - - this.problems = new ArrayList(); - if ( problems != null ) + if ( model != null ) { - this.problems.addAll( problems ); + DefaultModelBuildingResult tmp = new DefaultModelBuildingResult(); + if ( modelId == null ) + { + modelId = ""; + } + tmp.addModelId( modelId ); + tmp.setRawModel( modelId, model ); + tmp.setProblems( problems ); + result = tmp; } + else + { + result = null; + } + } + + /** + * Creates a new exception from the specified interim result and its associated problems. + * + * @param result The interim result, may be {@code null}. + */ + public ModelBuildingException( ModelBuildingResult result ) + { + super( toMessage( result ) ); + this.result = result; + } + + /** + * Gets the interim result of the model building up to the point where it failed. + * + * @return The interim model building result or {@code null} if not available. + */ + public ModelBuildingResult getResult() + { + return result; } /** @@ -71,7 +98,15 @@ public class ModelBuildingException */ public Model getModel() { - return model; + if ( result == null ) + { + return null; + } + if ( result.getEffectiveModel() != null ) + { + return result.getEffectiveModel(); + } + return result.getRawModel(); } /** @@ -83,7 +118,11 @@ public class ModelBuildingException */ public String getModelId() { - return modelId; + if ( result == null || result.getModelIds().isEmpty() ) + { + return ""; + } + return result.getModelIds().get( 0 ); } /** @@ -93,7 +132,20 @@ public class ModelBuildingException */ public List getProblems() { - return problems; + if ( result == null ) + { + return Collections.emptyList(); + } + return result.getProblems(); + } + + private static String toMessage( ModelBuildingResult result ) + { + if ( result != null && !result.getModelIds().isEmpty() ) + { + return toMessage( result.getModelIds().get( 0 ), result.getProblems() ); + } + return null; } private static String toMessage( String modelId, List problems ) From 81e8cc9b5c5f481761055d6a060bb969c5cdaf1f Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 28 Sep 2011 06:46:02 +0000 Subject: [PATCH 11/69] add .DS_Store in .gitignore git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1176750 13f79535-47bb-0310-9956-ffa450edef68 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7efccac1cd..94d217b466 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ bin/ # Intellij *.ipr *.iml + +.DS_Store From f57a97beacf579c9505fcb0a3ab6dd50f9dd8c16 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 29 Sep 2011 20:10:32 +0000 Subject: [PATCH 12/69] [MNG-5175] replace wagon http lightweight with wagon http 2.0 . git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1177416 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8a9b256647..cc37c9c6b0 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ 1.14 2.0.6 2.1.1 - 2.0-SNAPSHOT + 2.0 1.3 1.7 1.4.1 From dd5dc0829af693d9f4f0a54083110149298f86a4 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 9 Oct 2011 18:22:20 +0000 Subject: [PATCH 13/69] o Dispatched repository events via dedicated component git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1180679 13f79535-47bb-0310-9956-ffa450edef68 --- .../DefaultArtifactDescriptorReader.java | 46 +++++++++++-------- .../internal/DefaultVersionRangeResolver.java | 31 +++++++++---- .../internal/DefaultVersionResolver.java | 31 +++++++++---- 3 files changed, 69 insertions(+), 39 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java index 2c8fdf8af7..1faee29754 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java @@ -47,7 +47,6 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.sonatype.aether.RepositoryEvent.EventType; import org.sonatype.aether.RepositoryException; -import org.sonatype.aether.RepositoryListener; import org.sonatype.aether.RepositorySystemSession; import org.sonatype.aether.RequestTrace; import org.sonatype.aether.artifact.Artifact; @@ -58,6 +57,7 @@ import org.sonatype.aether.graph.Exclusion; import org.sonatype.aether.impl.ArtifactDescriptorReader; import org.sonatype.aether.impl.ArtifactResolver; import org.sonatype.aether.impl.RemoteRepositoryManager; +import org.sonatype.aether.impl.RepositoryEventDispatcher; import org.sonatype.aether.impl.VersionResolver; import org.sonatype.aether.transfer.ArtifactNotFoundException; import org.sonatype.aether.util.DefaultRequestTrace; @@ -101,6 +101,9 @@ public class DefaultArtifactDescriptorReader @Requirement private ArtifactResolver artifactResolver; + @Requirement + private RepositoryEventDispatcher repositoryEventDispatcher; + @Requirement private ModelBuilder modelBuilder; @@ -110,6 +113,7 @@ public class DefaultArtifactDescriptorReader setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) ); setVersionResolver( locator.getService( VersionResolver.class ) ); setArtifactResolver( locator.getService( ArtifactResolver.class ) ); + setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) ); modelBuilder = locator.getService( ModelBuilder.class ); if ( modelBuilder == null ) { @@ -153,6 +157,16 @@ public class DefaultArtifactDescriptorReader return this; } + public DefaultArtifactDescriptorReader setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ) + { + if ( repositoryEventDispatcher == null ) + { + throw new IllegalArgumentException( "repository event dispatcher has not been specified" ); + } + this.repositoryEventDispatcher = repositoryEventDispatcher; + return this; + } + public DefaultArtifactDescriptorReader setModelBuilder( ModelBuilder modelBuilder ) { if ( modelBuilder == null ) @@ -407,29 +421,23 @@ public class DefaultArtifactDescriptorReader private void missingDescriptor( RepositorySystemSession session, RequestTrace trace, Artifact artifact, Exception exception ) { - RepositoryListener listener = session.getRepositoryListener(); - if ( listener != null ) - { - DefaultRepositoryEvent event = - new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_MISSING, session, trace ); - event.setArtifact( artifact ); - event.setException( exception ); - listener.artifactDescriptorMissing( event ); - } + DefaultRepositoryEvent event = + new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_MISSING, session, trace ); + event.setArtifact( artifact ); + event.setException( exception ); + + repositoryEventDispatcher.dispatch( event ); } private void invalidDescriptor( RepositorySystemSession session, RequestTrace trace, Artifact artifact, Exception exception ) { - RepositoryListener listener = session.getRepositoryListener(); - if ( listener != null ) - { - DefaultRepositoryEvent event = - new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_INVALID, session, trace ); - event.setArtifact( artifact ); - event.setException( exception ); - listener.artifactDescriptorInvalid( event ); - } + DefaultRepositoryEvent event = + new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_INVALID, session, trace ); + event.setArtifact( artifact ); + event.setException( exception ); + + repositoryEventDispatcher.dispatch( event ); } } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java index d7ff1f885c..c5b85f709a 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java @@ -32,7 +32,6 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.IOUtil; import org.sonatype.aether.RepositoryEvent.EventType; -import org.sonatype.aether.RepositoryListener; import org.sonatype.aether.RepositorySystemSession; import org.sonatype.aether.RequestTrace; import org.sonatype.aether.SyncContext; @@ -45,6 +44,7 @@ import org.sonatype.aether.version.Version; import org.sonatype.aether.version.VersionConstraint; import org.sonatype.aether.version.VersionScheme; import org.sonatype.aether.impl.MetadataResolver; +import org.sonatype.aether.impl.RepositoryEventDispatcher; import org.sonatype.aether.impl.SyncContextFactory; import org.sonatype.aether.impl.VersionRangeResolver; import org.sonatype.aether.metadata.Metadata; @@ -81,11 +81,15 @@ public class DefaultVersionRangeResolver @Requirement private SyncContextFactory syncContextFactory; + @Requirement + private RepositoryEventDispatcher repositoryEventDispatcher; + public void initService( ServiceLocator locator ) { setLogger( locator.getService( Logger.class ) ); setMetadataResolver( locator.getService( MetadataResolver.class ) ); setSyncContextFactory( locator.getService( SyncContextFactory.class ) ); + setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) ); } public DefaultVersionRangeResolver setLogger( Logger logger ) @@ -114,6 +118,16 @@ public class DefaultVersionRangeResolver return this; } + public DefaultVersionRangeResolver setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ) + { + if ( repositoryEventDispatcher == null ) + { + throw new IllegalArgumentException( "repository event dispatcher has not been specified" ); + } + this.repositoryEventDispatcher = repositoryEventDispatcher; + return this; + } + public VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request ) throws VersionRangeResolutionException { @@ -271,15 +285,12 @@ public class DefaultVersionRangeResolver private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, Metadata metadata, ArtifactRepository repository, Exception exception ) { - RepositoryListener listener = session.getRepositoryListener(); - if ( listener != null ) - { - DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace ); - event.setMetadata( metadata ); - event.setException( exception ); - event.setRepository( repository ); - listener.metadataInvalid( event ); - } + DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace ); + event.setMetadata( metadata ); + event.setException( exception ); + event.setRepository( repository ); + + repositoryEventDispatcher.dispatch( event ); } } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java index f36d7f59db..7c0f85f422 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java @@ -40,7 +40,6 @@ import org.sonatype.aether.ConfigurationProperties; import org.sonatype.aether.RepositoryCache; import org.sonatype.aether.RequestTrace; import org.sonatype.aether.RepositoryEvent.EventType; -import org.sonatype.aether.RepositoryListener; import org.sonatype.aether.RepositorySystemSession; import org.sonatype.aether.SyncContext; import org.sonatype.aether.util.DefaultRequestTrace; @@ -48,6 +47,7 @@ import org.sonatype.aether.util.listener.DefaultRepositoryEvent; import org.sonatype.aether.util.metadata.DefaultMetadata; import org.sonatype.aether.artifact.Artifact; import org.sonatype.aether.impl.MetadataResolver; +import org.sonatype.aether.impl.RepositoryEventDispatcher; import org.sonatype.aether.impl.SyncContextFactory; import org.sonatype.aether.impl.VersionResolver; import org.sonatype.aether.impl.internal.CacheUtils; @@ -93,11 +93,15 @@ public class DefaultVersionResolver @Requirement private SyncContextFactory syncContextFactory; + @Requirement + private RepositoryEventDispatcher repositoryEventDispatcher; + public void initService( ServiceLocator locator ) { setLogger( locator.getService( Logger.class ) ); setMetadataResolver( locator.getService( MetadataResolver.class ) ); setSyncContextFactory( locator.getService( SyncContextFactory.class ) ); + setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) ); } public DefaultVersionResolver setLogger( Logger logger ) @@ -126,6 +130,16 @@ public class DefaultVersionResolver return this; } + public DefaultVersionResolver setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ) + { + if ( repositoryEventDispatcher == null ) + { + throw new IllegalArgumentException( "repository event dispatcher has not been specified" ); + } + this.repositoryEventDispatcher = repositoryEventDispatcher; + return this; + } + public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { @@ -361,15 +375,12 @@ public class DefaultVersionResolver private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, Metadata metadata, ArtifactRepository repository, Exception exception ) { - RepositoryListener listener = session.getRepositoryListener(); - if ( listener != null ) - { - DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace ); - event.setMetadata( metadata ); - event.setException( exception ); - event.setRepository( repository ); - listener.metadataInvalid( event ); - } + DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace ); + event.setMetadata( metadata ); + event.setException( exception ); + event.setRepository( repository ); + + repositoryEventDispatcher.dispatch( event ); } private void merge( Artifact artifact, Map infos, Versioning versioning, From b448adb77891a12ea50b7063e364ca70e989ab55 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 16 Oct 2011 19:17:36 +0000 Subject: [PATCH 14/69] added an introduction with links to relevant existing documentation git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1184902 13f79535-47bb-0310-9956-ffa450edef68 --- maven-plugin-api/src/site/apt/index.apt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 maven-plugin-api/src/site/apt/index.apt diff --git a/maven-plugin-api/src/site/apt/index.apt b/maven-plugin-api/src/site/apt/index.apt new file mode 100644 index 0000000000..2f20a04547 --- /dev/null +++ b/maven-plugin-api/src/site/apt/index.apt @@ -0,0 +1,17 @@ + ----- + Introduction + ----- + Hervé Boutemy + ----- + 2011-10-16 + ----- + +Maven Plugin API + + The API for plugins - Mojos - development. + +* See Also + + * {{{/developers/mojo-api-specification.html}Mojo API Specification}} + + * {{{/plugin-tools/}plugin-tools}}, containing {{{/plugins/maven-plugin-plugin/}maven-plugin-plugin}} From b70a461fa4120c765b534b1554e4f7c51366cc37 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Tue, 18 Oct 2011 20:45:35 +0000 Subject: [PATCH 15/69] fixed wrong UT for implementation configuration git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1185847 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/descriptor/PluginDescriptorBuilderTest.java | 2 +- maven-plugin-api/src/test/resources/plugin.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilderTest.java b/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilderTest.java index ce85776eaa..89b48907b8 100644 --- a/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilderTest.java +++ b/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilderTest.java @@ -94,13 +94,13 @@ public class PluginDescriptorBuilderTest assertEquals( "${jar.finalName}", pc.getValue() ); assertEquals( "${project.build.finalName}", pc.getAttribute( "default-value" ) ); - assertEquals( "java.lang.String", pc.getAttribute( "implementation" ) ); Parameter mp = md.getParameters().get( 0 ); assertEquals( "finalName", mp.getName() ); assertEquals( "jarName", mp.getAlias() ); assertEquals( "java.lang.String", mp.getType() ); + assertEquals( "java.lang.String", mp.getImplementation() ); assertEquals( true, mp.isEditable() ); assertEquals( false, mp.isRequired() ); assertEquals( "parameter-description", mp.getDescription() ); diff --git a/maven-plugin-api/src/test/resources/plugin.xml b/maven-plugin-api/src/test/resources/plugin.xml index d6835bad85..40840b0ba1 100644 --- a/maven-plugin-api/src/test/resources/plugin.xml +++ b/maven-plugin-api/src/test/resources/plugin.xml @@ -35,6 +35,7 @@ finalName jarName java.lang.String + java.lang.String false true parameter-description @@ -42,7 +43,7 @@ - ${jar.finalName} + ${jar.finalName} From 003f6f0737494c7a6581010757bbb7fec5fc7789 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Tue, 18 Oct 2011 21:29:52 +0000 Subject: [PATCH 16/69] added plugin.xml plugin descriptor basic documentation git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1185875 13f79535-47bb-0310-9956-ffa450edef68 --- maven-plugin-api/pom.xml | 10 + maven-plugin-api/src/main/mdo/plugin.mdo | 425 +++++++++++++++++++++++ maven-plugin-api/src/site/apt/index.apt | 3 + maven-plugin-api/src/site/site.xml | 1 + 4 files changed, 439 insertions(+) create mode 100644 maven-plugin-api/src/main/mdo/plugin.mdo diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index ff42e1165f..0fe8e8a421 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -62,10 +62,20 @@ under the License. src/main/mdo/lifecycle.mdo + src/main/mdo/plugin.mdo 1.0.0 + + maven-jar-plugin + + + org/apache/maven/plugin/descriptor/model + org/apache/maven/plugin/descriptor/model/**/* + + + diff --git a/maven-plugin-api/src/main/mdo/plugin.mdo b/maven-plugin-api/src/main/mdo/plugin.mdo new file mode 100644 index 0000000000..a6bf84f51d --- /dev/null +++ b/maven-plugin-api/src/main/mdo/plugin.mdo @@ -0,0 +1,425 @@ + + + + plugin + PluginDescriptor + META-INF/maven/plugin.xml in a plugin's jar artifact. + This descriptor is generally generated from plugin sources, using + maven-plugin-plugin. + ]]> + + + package + org.apache.maven.plugin.descriptor.model + + + + + PluginDescriptor + 1.0.0 + plugin.xml file.]]> + + + description + 1.0.0 + Description of the plugin. + String + + + groupId + 1.0.0 + + String + + + artifactId + 1.0.0 + + String + + + version + 1.0.0 + + String + + + goalPrefix + 1.0.0 + + String + + + isolatedRealm + 1.0.0 + + boolean + false + + + inheritedByDefault + 1.0.0 + + boolean + true + + + mojos + 1.0.0 + + MojoDescriptor + * + + + + + + + MojoDescriptor + 1.0.0 + + + + goal + true + 1.0.0 + String + + + + description + 1.0.0 + String + + + + implementation + 1.0.0 + String + + + + language + 1.0.0 + String + java + + + + phase + 1.0.0 + String + + + + executePhase + 1.0.0 + String + + + + executeGoal + 1.0.0 + String + + + + executeLifecycle + 1.0.0 + String + + + + requiresDependencyResolution + 1.0.0 + String + compile, runtime, test, provided + ]]> + + + requiresDependencyCollection + 1.0.0 + String + compile, runtime, test, provided. + ]]> + + + requiresDirectInvocation + 1.0.0 + boolean + + + + requiresProject + 1.0.0 + boolean + + true + + + requiresReports + 1.0.0 + boolean + + + + requiresOnline + 1.0.0 + boolean + + + + aggregator + 1.0.0 + boolean + + + + inheritedByDefault + 1.0.0 + boolean + + true + + + threadSafe + 1.0.0 + boolean + + + + instantiationStrategy + 1.0.0 + String + per-lookup + per-lookup + + + executionStrategy + 1.0.0 + String + once-per-session, always + + + since + 1.0.0 + String + the version when the Mojo was added to the API. Similar to Javadoc since. + + + deprecated + 1.0.0 + String + the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated. + + + configurator + 1.0.0 + String + + + + composer + 1.0.0 + String + + + + parameters + 1.0.0 + + + Parameter + * + + + + configuration + 1.0.0 + + + Configuration + * + + + + requirements + 1.0.0 + + + Requirement + * + + + + + + + Parameter + 1.0.0 + A phase mapping definition. + + + name + true + 1.0.0 + String + + + + alias + 1.0.0 + String + + + + type + 1.0.0 + String + + + + required + 1.0.0 + boolean + + + + editable + 1.0.0 + boolean + true + + + + implementation + 1.0.0 + String + + + + description + 1.0.0 + String + + + + deprecated + 1.0.0 + String + + + + + + + Configuration + 1.0.0 + A parameter configuration. + + + expression + true + 1.0.0 + String + Parameter expression. + + + defaultValue + 1.0.0 + String + + + + + + + Requirement + 1.0.0 + + + + role + true + 1.0.0 + String + + + + roleHint + 1.0.0 + String + + + + fieldName + true + 1.0.0 + String + + + + + + + Dependency + 1.0.0 + + + + groupId + true + 1.0.0 + String + + + + artifactId + true + 1.0.0 + String + + + + type + 1.0.0 + String + + + + version + 1.0.0 + String + + + + + + diff --git a/maven-plugin-api/src/site/apt/index.apt b/maven-plugin-api/src/site/apt/index.apt index 2f20a04547..6c04123b6c 100644 --- a/maven-plugin-api/src/site/apt/index.apt +++ b/maven-plugin-api/src/site/apt/index.apt @@ -10,6 +10,9 @@ Maven Plugin API The API for plugins - Mojos - development. + A plugin is described in a {{{./plugin.html}<<>> plugin descriptor}}, + generally generated from plugin sources using {{{/plugins/maven-plugin-plugin/}maven-plugin-plugin}}. + * See Also * {{{/developers/mojo-api-specification.html}Mojo API Specification}} diff --git a/maven-plugin-api/src/site/site.xml b/maven-plugin-api/src/site/site.xml index 157190add9..9594af1bfd 100644 --- a/maven-plugin-api/src/site/site.xml +++ b/maven-plugin-api/src/site/site.xml @@ -31,6 +31,7 @@ + From e022632f63170ae28bb40b338690f475c0bb6d11 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Tue, 18 Oct 2011 21:39:15 +0000 Subject: [PATCH 17/69] added dependency management import step git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1185882 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model-builder/src/site/apt/index.apt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maven-model-builder/src/site/apt/index.apt b/maven-model-builder/src/site/apt/index.apt index 0b25f9042b..f3ee70a34b 100644 --- a/maven-model-builder/src/site/apt/index.apt +++ b/maven-model-builder/src/site/apt/index.apt @@ -46,6 +46,8 @@ Maven Model Builder ** <(optional)> lifecycle bindings injection + ** dependency management import (for dependencies of type <<>> in the <<<\>>> section) + ** dependency management injection ** <(optional)> reports configuration From 42aa645f968adcbb95015affa056f92b97002700 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Tue, 18 Oct 2011 22:06:36 +0000 Subject: [PATCH 18/69] updated jxr report plugin git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1185901 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index cc37c9c6b0..6ce0491432 100644 --- a/pom.xml +++ b/pom.xml @@ -528,6 +528,7 @@ org.apache.maven.plugins maven-jxr-plugin + 2.3 non-aggregate From cab9714c2c91be785bcc5020f40ad0e4cd8fc21c Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sat, 22 Oct 2011 20:53:40 +0000 Subject: [PATCH 19/69] fixed elements order of parent: groupId, artifactId, version git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1187777 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model/src/main/mdo/maven.mdo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maven-model/src/main/mdo/maven.mdo b/maven-model/src/main/mdo/maven.mdo index 65d4643252..2f7d2832fb 100644 --- a/maven-model/src/main/mdo/maven.mdo +++ b/maven-model/src/main/mdo/maven.mdo @@ -1961,16 +1961,16 @@ - artifactId + groupId 4.0.0 - The artifact id of the parent project to inherit from. + The group id of the parent project to inherit from. true String - groupId + artifactId 4.0.0 - The group id of the parent project to inherit from. + The artifact id of the parent project to inherit from. true String From bf130b1bfa37be33f033dcf14814778d4b01cf41 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sat, 22 Oct 2011 20:56:39 +0000 Subject: [PATCH 20/69] added forgotten "dependencies" element git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1187779 13f79535-47bb-0310-9956-ffa450edef68 --- maven-plugin-api/src/main/mdo/plugin.mdo | 33 +++++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/maven-plugin-api/src/main/mdo/plugin.mdo b/maven-plugin-api/src/main/mdo/plugin.mdo index a6bf84f51d..bf295feadc 100644 --- a/maven-plugin-api/src/main/mdo/plugin.mdo +++ b/maven-plugin-api/src/main/mdo/plugin.mdo @@ -92,6 +92,18 @@ under the License. * + + dependencies + 1.0.0 + + Dependency + * + + + A set of dependencies which the plugin requires in order to function. This enables the plugin to function + independently of its POM (or at least to declare the libraries it needs to run). + + @@ -391,33 +403,34 @@ under the License. Dependency 1.0.0 - + Definition of a dependency, needed by the plugin at runtime. groupId true 1.0.0 String - + The group id of the dependency. artifactId true 1.0.0 String - - - - type - 1.0.0 - String - + The artifact id of the dependency. version 1.0.0 String - + The version of the dependency. + + + type + 1.0.0 + String + jar + The type of dependency. From 4e7aef6de851d3c1865cd31588e3dd9e378e5f33 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sat, 22 Oct 2011 21:32:02 +0000 Subject: [PATCH 21/69] added documentation to fields, copied from http://maven.apache.org/developers/mojo-api-specification.html git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1187814 13f79535-47bb-0310-9956-ffa450edef68 --- maven-plugin-api/src/main/mdo/plugin.mdo | 131 +++++++++++++++++------ 1 file changed, 99 insertions(+), 32 deletions(-) diff --git a/maven-plugin-api/src/main/mdo/plugin.mdo b/maven-plugin-api/src/main/mdo/plugin.mdo index bf295feadc..8eae096efb 100644 --- a/maven-plugin-api/src/main/mdo/plugin.mdo +++ b/maven-plugin-api/src/main/mdo/plugin.mdo @@ -49,19 +49,19 @@ under the License. groupId 1.0.0 - + The group id of the plugin. String artifactId 1.0.0 - + The artifact id of the plugin. String version 1.0.0 - + The version of the plugin. String @@ -91,6 +91,7 @@ under the License. MojoDescriptor * + Description of each Mojo provided by the plugin. dependencies @@ -119,32 +120,42 @@ under the License. true 1.0.0 String - + + The name for the Mojo that users will reference from the command line to execute the Mojo directly, + or inside a POM in order to provide Mojo-specific configuration. + description 1.0.0 String - + The description of this Mojo's functionality. implementation 1.0.0 String - + + The Mojo's fully-qualified class name (or script path in the case of non-Java Mojos). + language 1.0.0 String java - + The implementation language for this Mojo (Java, beanshell, etc.). phase 1.0.0 String - + Note: This annotation will not automagically make a mojo run when the plugin declaration is added + to the POM. It merely enables the user to omit the <phase> element from the + surrounding <execution> element. + ]]> executePhase @@ -168,9 +179,11 @@ under the License. requiresDependencyResolution 1.0.0 String + runtime compile, runtime, test, provided + Flags this Mojo as requiring the dependencies in the specified class path to be resolved before it can + execute: compile, runtime, test, + compile+runtime (since Maven 3.0) ]]> @@ -178,84 +191,107 @@ under the License. 1.0.0 String compile, runtime, test, provided. + Flags this mojo as requiring information about the dependencies that would make up the specified class + path. As the name suggests, this is similar to requiresDependencyResolution and supports the same values. + The important difference is this will not resolve the files for the dependencies, i.e. the artifacts + associated with a Maven project can lack a file. As such, this annotation is meant for mojos that only + want to analyze the set of transitive dependencies, in particular during early lifecycle phases where + full dependency resolution might fail due to projects which haven't been built yet. ]]> requiresDirectInvocation 1.0.0 boolean - + Flags this Mojo to be invoked directly. + false requiresProject 1.0.0 boolean - + Flags this Mojo to run inside of a project. true requiresReports 1.0.0 boolean - + Flags this Mojo to require reports. Unsupported since Maven 3.0. + false requiresOnline 1.0.0 boolean - + Flags this Mojo to require online mode for its operation. + false aggregator 1.0.0 boolean - + + Flags this Mojo to run it in a multi module way, i.e. aggregate the build with the set of projects + listed as modules. + inheritedByDefault 1.0.0 boolean - + Specify that the Mojo is inherited. true threadSafe 1.0.0 boolean - + + Marks this mojo as being thread-safe, i.e. the mojo safely supports concurrent execution during parallel + builds. Mojos without this annotation will make Maven output a warning when used during a parallel build + session. Since Maven 3.0. + instantiationStrategy 1.0.0 String per-lookup - per-lookup + Specify the instantiation strategy. executionStrategy 1.0.0 String - once-per-session, always + once-per-session, always. + ]]> since 1.0.0 String - the version when the Mojo was added to the API. Similar to Javadoc since. + Specify the version when the Mojo was added to the API. Similar to Javadoc since. deprecated 1.0.0 String - the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated. + + Specify the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated. This will + trigger a warning when a user tries to configure a parameter marked as deprecated. + configurator 1.0.0 String - + + The configurator type to use when injecting parameter values into this Mojo. The value is normally deduced + from the Mojo's implementation language, but can be specified to allow a custom ComponentConfigurator + implementation to be used. + composer @@ -300,35 +336,57 @@ under the License. name - true 1.0.0 String - + true + + The name of the parameter, to be used in configuring this parameter from the Mojo's declared defaults + or from the POM. + alias 1.0.0 String - + + Specifies an alias which can be used to configure this parameter from the POM. + This is primarily useful to improve user-friendliness, where Mojo field names are not intuitive to the + user or are otherwise not conducive to configuration via the POM. + type 1.0.0 String - + true + + The Java type for this parameter. This is used to validate the result of any expressions used to calculate + the value which should be injected into the Mojo for this parameter. + required 1.0.0 boolean - + + Whether this parameter is required for the Mojo to function. This is used to validate the configuration + for a Mojo before it is injected, and before the Mojo is executed from some half-state. + editable 1.0.0 boolean true - + <build><finalName/></build> rather + than specifying a value for finalName directly in the plugin configuration section. It is also useful to + ensure that - for example - a List-typed parameter which expects items of type Artifact doesn't get a List + full of Strings. + ]]> implementation @@ -340,13 +398,22 @@ under the License. description 1.0.0 String - + The description of this parameter's use inside the Mojo. + + + since + 1.0.0 + String + Specify the version when the parameter was added to the API. Similar to Javadoc since. deprecated 1.0.0 String - + + Specify the version when the parameter was deprecated to the API. Similar to Javadoc deprecated. + This will trigger a warning when a user tries to configure a parameter marked as deprecated. + From aa23b383ed4f80536ac1fbb9beabeb2cc68f4291 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 23 Oct 2011 19:02:21 +0000 Subject: [PATCH 22/69] restored attribute removed in r1185847 since it is generated by maven-plugin-tools-java git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1187949 13f79535-47bb-0310-9956-ffa450edef68 --- maven-plugin-api/src/main/mdo/plugin.mdo | 6 ++++++ .../plugin/descriptor/PluginDescriptorBuilderTest.java | 1 + maven-plugin-api/src/test/resources/plugin.xml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/maven-plugin-api/src/main/mdo/plugin.mdo b/maven-plugin-api/src/main/mdo/plugin.mdo index 8eae096efb..5af6aca4fc 100644 --- a/maven-plugin-api/src/main/mdo/plugin.mdo +++ b/maven-plugin-api/src/main/mdo/plugin.mdo @@ -430,6 +430,12 @@ under the License. String Parameter expression. + + implementation + 1.0.0 + String + + defaultValue 1.0.0 diff --git a/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilderTest.java b/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilderTest.java index 89b48907b8..5fbf76e001 100644 --- a/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilderTest.java +++ b/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilderTest.java @@ -94,6 +94,7 @@ public class PluginDescriptorBuilderTest assertEquals( "${jar.finalName}", pc.getValue() ); assertEquals( "${project.build.finalName}", pc.getAttribute( "default-value" ) ); + assertEquals( "java.lang.String", pc.getAttribute( "implementation" ) ); Parameter mp = md.getParameters().get( 0 ); diff --git a/maven-plugin-api/src/test/resources/plugin.xml b/maven-plugin-api/src/test/resources/plugin.xml index 40840b0ba1..c5d4e8a467 100644 --- a/maven-plugin-api/src/test/resources/plugin.xml +++ b/maven-plugin-api/src/test/resources/plugin.xml @@ -43,7 +43,7 @@ - ${jar.finalName} + ${jar.finalName} From 2f670115c51d0b497e98c182e217c8ba0e08b069 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Thu, 27 Oct 2011 22:23:24 +0000 Subject: [PATCH 23/69] fixed typo git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1190069 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 6ce0491432..11e25c83af 100644 --- a/pom.xml +++ b/pom.xml @@ -1,13 +1,18 @@ @@ -52,7 +57,7 @@ 1.3 1.11 true - + apache-maven Maven Apache Maven From f561a2b0e120b5cd825c786b586032956bb628c9 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 15 Nov 2011 17:50:50 +0000 Subject: [PATCH 24/69] [MNG-5200] upgrade plugins version in super pom. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1202331 13f79535-47bb-0310-9956-ffa450edef68 --- .../META-INF/plexus/artifact-handlers.xml | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml b/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml index 64b9e6f18b..8d16de321e 100644 --- a/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml +++ b/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml @@ -58,7 +58,7 @@ problem. org.apache.maven.plugins:maven-install-plugin:2.3.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy @@ -91,28 +91,28 @@ problem. - org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources + org.apache.maven.plugins:maven-resources-plugin:2.5:resources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile - org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources + org.apache.maven.plugins:maven-resources-plugin:2.5:testResources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test + org.apache.maven.plugins:maven-surefire-plugin:2.10:test - org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar + org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar org.apache.maven.plugins:maven-install-plugin:2.3.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy @@ -146,19 +146,19 @@ problem. - org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources + org.apache.maven.plugins:maven-resources-plugin:2.5:resources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile - org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources + org.apache.maven.plugins:maven-resources-plugin:2.5:testResources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test + org.apache.maven.plugins:maven-surefire-plugin:2.10:test org.apache.maven.plugins:maven-ejb-plugin:2.3:ejb @@ -167,7 +167,7 @@ problem. org.apache.maven.plugins:maven-install-plugin:2.3.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy @@ -210,19 +210,19 @@ problem. - org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources + org.apache.maven.plugins:maven-resources-plugin:2.5:resources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile - org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources + org.apache.maven.plugins:maven-resources-plugin:2.5:testResources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test + org.apache.maven.plugins:maven-surefire-plugin:2.10:test org.apache.maven.plugins:maven-ejb3-plugin:ejb3 @@ -231,7 +231,7 @@ problem. org.apache.maven.plugins:maven-install-plugin:2.3.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy @@ -282,32 +282,32 @@ problem. - org.apache.maven.plugins:maven-plugin-plugin:2.7:descriptor + org.apache.maven.plugins:maven-plugin-plugin:2.9:descriptor - org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources + org.apache.maven.plugins:maven-resources-plugin:2.5:resources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile - org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources + org.apache.maven.plugins:maven-resources-plugin:2.5:testResources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test + org.apache.maven.plugins:maven-surefire-plugin:2.10:test org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar, - org.apache.maven.plugins:maven-plugin-plugin:2.7:addPluginArtifactMetadata + org.apache.maven.plugins:maven-plugin-plugin:2.9:addPluginArtifactMetadata org.apache.maven.plugins:maven-install-plugin:2.3.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy @@ -373,19 +373,19 @@ problem. - org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources + org.apache.maven.plugins:maven-resources-plugin:2.5:resources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile - org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources + org.apache.maven.plugins:maven-resources-plugin:2.5:testResources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test + org.apache.maven.plugins:maven-surefire-plugin:2.10:test org.apache.maven.plugins:maven-war-plugin:2.1.1:war @@ -394,7 +394,7 @@ problem. org.apache.maven.plugins:maven-install-plugin:2.3.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy @@ -434,13 +434,13 @@ problem. org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources - org.apache.maven.plugins:maven-ear-plugin:2.5:ear + org.apache.maven.plugins:maven-ear-plugin:2.6:ear org.apache.maven.plugins:maven-install-plugin:2.3.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy @@ -474,19 +474,19 @@ problem. - org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources + org.apache.maven.plugins:maven-resources-plugin:2.5:resources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile - org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources + org.apache.maven.plugins:maven-resources-plugin:2.5:testResources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test + org.apache.maven.plugins:maven-surefire-plugin:2.10:test org.apache.maven.plugins:maven-rar-plugin:2.2:rar @@ -495,7 +495,7 @@ problem. org.apache.maven.plugins:maven-install-plugin:2.3.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy @@ -529,19 +529,19 @@ problem. - org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources + org.apache.maven.plugins:maven-resources-plugin:2.5:resources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile - org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources + org.apache.maven.plugins:maven-resources-plugin:2.5:testResources org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test + org.apache.maven.plugins:maven-surefire-plugin:2.10:test org.apache.maven.plugins:maven-par-plugin:par @@ -550,7 +550,7 @@ problem. org.apache.maven.plugins:maven-install-plugin:2.3.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy From 0cc2c9b2279881375f1b8dbdbbe105a6b455c391 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 17 Nov 2011 13:34:33 +0000 Subject: [PATCH 25/69] [MNG-5201] upgrade aether to 1.13 and sisu to 2.3.0 . git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1203182 13f79535-47bb-0310-9956-ffa450edef68 --- .../project/LegacyLocalRepositoryManager.java | 16 ++++++++++++++++ .../project/LegacyLocalRepositoryManager.java | 16 ++++++++++++++++ pom.xml | 4 ++-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java b/maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java index 14b4c26e4c..daab6c4f8e 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java +++ b/maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java @@ -21,8 +21,11 @@ package org.apache.maven.project; import java.io.File; +import org.sonatype.aether.RepositorySystemSession; import org.sonatype.aether.artifact.Artifact; import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; +import org.sonatype.aether.repository.LocalArtifactRequest; +import org.sonatype.aether.repository.LocalArtifactResult; /** * @author Benjamin Bentmann @@ -56,4 +59,17 @@ public class LegacyLocalRepositoryManager return path.toString(); } + public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) + { + String path = getPathForLocalArtifact( request.getArtifact() ); + File file = new File( getRepository().getBasedir(), path ); + LocalArtifactResult result = new LocalArtifactResult( request ); + if ( file.isFile() ) + { + result.setFile( file ); + result.setAvailable( true ); + } + return result; + } + } diff --git a/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java b/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java index 14b4c26e4c..daab6c4f8e 100644 --- a/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java +++ b/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java @@ -21,8 +21,11 @@ package org.apache.maven.project; import java.io.File; +import org.sonatype.aether.RepositorySystemSession; import org.sonatype.aether.artifact.Artifact; import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; +import org.sonatype.aether.repository.LocalArtifactRequest; +import org.sonatype.aether.repository.LocalArtifactResult; /** * @author Benjamin Bentmann @@ -56,4 +59,17 @@ public class LegacyLocalRepositoryManager return path.toString(); } + public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) + { + String path = getPathForLocalArtifact( request.getArtifact() ); + File file = new File( getRepository().getBasedir(), path ); + LocalArtifactResult result = new LocalArtifactResult( request ); + if ( file.isFile() ) + { + result.setFile( file ); + result.setAvailable( true ); + } + return result; + } + } diff --git a/pom.xml b/pom.xml index 11e25c83af..840fcca2a8 100644 --- a/pom.xml +++ b/pom.xml @@ -49,13 +49,13 @@ 1.5.5 1.14 2.0.6 - 2.1.1 + 2.3.0 2.0 1.3 1.7 1.4.1 1.3 - 1.11 + 1.13 true apache-maven From 8d186526ca45d2d413c44cddab404113051a1d87 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 17 Nov 2011 13:34:45 +0000 Subject: [PATCH 26/69] use wagon 2.1-SNAPSHOT for http://jira.codehaus.org/browse/WAGON-353 git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1203183 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 840fcca2a8..31ea88c9d5 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ 1.14 2.0.6 2.3.0 - 2.0 + 2.1-SNAPSHOT 1.3 1.7 1.4.1 From 8800539f436fa525263f1071aabeb358623b699d Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 24 Nov 2011 16:56:55 +0000 Subject: [PATCH 27/69] [MNG-5175] replace wagon http lightweight with wagon http 2.1 . git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1205928 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 31ea88c9d5..e5ce444069 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ 1.14 2.0.6 2.3.0 - 2.1-SNAPSHOT + 2.1 1.3 1.7 1.4.1 From 4b9a53bdf716beb6b921bd30e24c4f7c582652ed Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 24 Nov 2011 18:27:51 +0000 Subject: [PATCH 28/69] exclude org.apache.httpcomponents:* as they are shaded in wagon-http-2.1-shaded.jar git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1205950 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index cd0b55733a..1be1544ebd 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -65,6 +65,14 @@ org.apache.maven.wagon wagon-http-shared4 + + org.apache.httpcomponents + httpclient + + + org.apache.httpcomponents + httpcore + From 878c4febd2343b52cf521f7edf7e7f9928ea992f Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 25 Nov 2011 08:14:04 +0000 Subject: [PATCH 29/69] [maven-release-plugin] prepare release maven-3.0.4 git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1206073 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 2 +- maven-artifact/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-settings-builder/pom.xml | 2 +- maven-settings/pom.xml | 2 +- pom.xml | 8 ++++---- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 1be1544ebd..00efd7bf6d 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -21,7 +21,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 apache-maven diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index aa08f2e114..a25b00bb1e 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-aether-provider diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index 7aefee3915..ab7b033c75 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-artifact diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 07eaf5ff3a..454eeb833a 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-compat diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 080608fb33..e11719290f 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-core diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 8538f7f0d8..d453023c1e 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-embedder diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 81625b3de5..5e683fdcb3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-model-builder diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 82c77686e9..ec37322f8d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-model diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index 0fe8e8a421..485eb19452 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-plugin-api diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index eac5f47416..8e42fae07b 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-repository-metadata diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml index 7de14ec589..f2599b96e5 100644 --- a/maven-settings-builder/pom.xml +++ b/maven-settings-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-settings-builder diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index 5a297f4065..a142f74ce6 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-settings diff --git a/pom.xml b/pom.xml index e5ce444069..7ee9e4a9ed 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ maven - 3.0.4-SNAPSHOT + 3.0.4 pom Apache Maven @@ -155,9 +155,9 @@ - scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/trunk - scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/trunk - http://svn.apache.org/viewvc/maven/maven-3/trunk + scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4 + scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4 + http://svn.apache.org/viewvc/maven/maven-3/tags/maven-3.0.4 jira From ae1e8592632e6770f1247670faaeba6a7a41c840 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 25 Nov 2011 08:15:06 +0000 Subject: [PATCH 30/69] [maven-release-plugin] prepare for next development iteration git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1206076 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 2 +- maven-artifact/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-settings-builder/pom.xml | 2 +- maven-settings/pom.xml | 2 +- pom.xml | 8 ++++---- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 00efd7bf6d..e990866563 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -21,7 +21,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT apache-maven diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index a25b00bb1e..249cd209ca 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-aether-provider diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index ab7b033c75..3c6eee7069 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-artifact diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 454eeb833a..ad6a2a3a12 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-compat diff --git a/maven-core/pom.xml b/maven-core/pom.xml index e11719290f..429d633a17 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-core diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index d453023c1e..4d71019999 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-embedder diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 5e683fdcb3..505a8e271c 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-model-builder diff --git a/maven-model/pom.xml b/maven-model/pom.xml index ec37322f8d..763fdda6a1 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-model diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index 485eb19452..e2c24a2098 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-plugin-api diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index 8e42fae07b..7049d664c6 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-repository-metadata diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml index f2599b96e5..b39126b75d 100644 --- a/maven-settings-builder/pom.xml +++ b/maven-settings-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-settings-builder diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index a142f74ce6..64ab03ea5f 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-settings diff --git a/pom.xml b/pom.xml index 7ee9e4a9ed..f424f14f73 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ maven - 3.0.4 + 3.0.5-SNAPSHOT pom Apache Maven @@ -155,9 +155,9 @@ - scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4 - scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4 - http://svn.apache.org/viewvc/maven/maven-3/tags/maven-3.0.4 + scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/trunk + scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/trunk + http://svn.apache.org/viewvc/maven/maven-3/trunk jira From 13c114df16e2a42842d5bf109eb7b00521402fd1 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 29 Nov 2011 12:09:14 +0000 Subject: [PATCH 31/69] vote cancelled back to 3.0.4-SNAPSHOT git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1207843 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 2 +- maven-artifact/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-settings-builder/pom.xml | 2 +- maven-settings/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index e990866563..1be1544ebd 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -21,7 +21,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT apache-maven diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index 249cd209ca..aa08f2e114 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-aether-provider diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index 3c6eee7069..7aefee3915 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-artifact diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index ad6a2a3a12..07eaf5ff3a 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-compat diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 429d633a17..080608fb33 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-core diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 4d71019999..8538f7f0d8 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-embedder diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 505a8e271c..81625b3de5 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-model-builder diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 763fdda6a1..82c77686e9 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-model diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index e2c24a2098..0fe8e8a421 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-plugin-api diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index 7049d664c6..eac5f47416 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-repository-metadata diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml index b39126b75d..7de14ec589 100644 --- a/maven-settings-builder/pom.xml +++ b/maven-settings-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-settings-builder diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index 64ab03ea5f..5a297f4065 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-settings diff --git a/pom.xml b/pom.xml index f424f14f73..e5ce444069 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT pom Apache Maven From 01d6ddeadab1fcdbaf9c33fdab1bf308e449cc22 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 29 Nov 2011 20:38:45 +0000 Subject: [PATCH 32/69] use aether 1.13.1 which prevent issues for http(s) deploy to http(s) server which doesn't support chuncked transfert (ie ngnix) git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1208057 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e5ce444069..e404bc19eb 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 1.7 1.4.1 1.3 - 1.13 + 1.13.1 true apache-maven @@ -590,4 +590,5 @@ + From 28f106faa38cfd1048414b0b1c4c112a4219fde9 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 1 Dec 2011 08:20:16 +0000 Subject: [PATCH 33/69] add properties to ease site stage deploy git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1208990 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e404bc19eb..b64e6e09db 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ number of other development tools for reporting or the build process. - http://maven.apache.org/ref/${project.version}/ + ${siteUrl} 2001 @@ -61,6 +61,10 @@ apache-maven Maven Apache Maven + + scp://people.apache.org/www/maven.apache.org/ref/${project.version}/ + http://maven.apache.org/ref/${project.version}/ + @@ -170,7 +174,7 @@ apache.website - scp://people.apache.org/www/maven.apache.org/ref/${project.version}/ + ${siteDeployUrl} From 858a7f8113d5602240807a303474074f7f368ff4 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 1 Dec 2011 08:20:32 +0000 Subject: [PATCH 34/69] fix ciMngt url git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1208991 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b64e6e09db..189efcd375 100644 --- a/pom.xml +++ b/pom.xml @@ -169,7 +169,7 @@ Jenkins - https://builds.apache.org/hudson/job/maven-3.0.x/ + https://builds.apache.org/job/maven-3.0.x/ From 85d20442503e6d8b4ac278745cd250c070894a07 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 1 Dec 2011 08:20:57 +0000 Subject: [PATCH 35/69] use new fluido skin for core ref site git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1208992 13f79535-47bb-0310-9956-ffa450edef68 --- src/site/site.xml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/site/site.xml b/src/site/site.xml index c770a3cfc1..ce228659f1 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -20,7 +20,24 @@ under the License. --> + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd" + name="Apache Maven"> + + + ${project.name} + http://maven.apache.org/images/apache-maven-project.png + http://maven.apache.org/ + + + http://maven.apache.org/images/maventxt_logo_200.gif + + + + org.apache.maven.skins + maven-fluido-skin + 1.0 + + From 8abaddfd17a011e58b9b886db7bccaa7081eb17b Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 1 Dec 2011 08:43:14 +0000 Subject: [PATCH 36/69] [maven-release-plugin] prepare release maven-3.0.4 git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1208998 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 2 +- maven-artifact/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-settings-builder/pom.xml | 2 +- maven-settings/pom.xml | 2 +- pom.xml | 8 ++++---- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 1be1544ebd..00efd7bf6d 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -21,7 +21,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 apache-maven diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index aa08f2e114..a25b00bb1e 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-aether-provider diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index 7aefee3915..ab7b033c75 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-artifact diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 07eaf5ff3a..454eeb833a 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-compat diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 080608fb33..e11719290f 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-core diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 8538f7f0d8..d453023c1e 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-embedder diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 81625b3de5..5e683fdcb3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-model-builder diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 82c77686e9..ec37322f8d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-model diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index 0fe8e8a421..485eb19452 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-plugin-api diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index eac5f47416..8e42fae07b 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-repository-metadata diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml index 7de14ec589..f2599b96e5 100644 --- a/maven-settings-builder/pom.xml +++ b/maven-settings-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-settings-builder diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index 5a297f4065..a142f74ce6 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4 maven-settings diff --git a/pom.xml b/pom.xml index 189efcd375..ea4bf95df0 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ maven - 3.0.4-SNAPSHOT + 3.0.4 pom Apache Maven @@ -159,9 +159,9 @@ - scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/trunk - scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/trunk - http://svn.apache.org/viewvc/maven/maven-3/trunk + scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4 + scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4 + http://svn.apache.org/viewvc/maven/maven-3/tags/maven-3.0.4 jira From f154515a413964a1023c1a194a4cb4370e3794e8 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 1 Dec 2011 08:44:24 +0000 Subject: [PATCH 37/69] [maven-release-plugin] prepare for next development iteration git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1209001 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 2 +- maven-artifact/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-settings-builder/pom.xml | 2 +- maven-settings/pom.xml | 2 +- pom.xml | 8 ++++---- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 00efd7bf6d..e990866563 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -21,7 +21,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT apache-maven diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index a25b00bb1e..249cd209ca 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-aether-provider diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index ab7b033c75..3c6eee7069 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-artifact diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 454eeb833a..ad6a2a3a12 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-compat diff --git a/maven-core/pom.xml b/maven-core/pom.xml index e11719290f..429d633a17 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-core diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index d453023c1e..4d71019999 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-embedder diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 5e683fdcb3..505a8e271c 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-model-builder diff --git a/maven-model/pom.xml b/maven-model/pom.xml index ec37322f8d..763fdda6a1 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-model diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index 485eb19452..e2c24a2098 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-plugin-api diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index 8e42fae07b..7049d664c6 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-repository-metadata diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml index f2599b96e5..b39126b75d 100644 --- a/maven-settings-builder/pom.xml +++ b/maven-settings-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-settings-builder diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index a142f74ce6..64ab03ea5f 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4 + 3.0.5-SNAPSHOT maven-settings diff --git a/pom.xml b/pom.xml index ea4bf95df0..30adad6733 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ maven - 3.0.4 + 3.0.5-SNAPSHOT pom Apache Maven @@ -159,9 +159,9 @@ - scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4 - scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4 - http://svn.apache.org/viewvc/maven/maven-3/tags/maven-3.0.4 + scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/trunk + scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/trunk + http://svn.apache.org/viewvc/maven/maven-3/trunk jira From b8e759de02fac79cc0e7bbd26df9c860f2aaba70 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sun, 4 Dec 2011 08:46:27 +0000 Subject: [PATCH 38/69] back to 3.0.4-SNAPSHOT git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1210076 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 2 +- maven-artifact/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-settings-builder/pom.xml | 2 +- maven-settings/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index e990866563..1be1544ebd 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -21,7 +21,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT apache-maven diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index 249cd209ca..aa08f2e114 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-aether-provider diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index 3c6eee7069..7aefee3915 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-artifact diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index ad6a2a3a12..07eaf5ff3a 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-compat diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 429d633a17..080608fb33 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-core diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 4d71019999..8538f7f0d8 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-embedder diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 505a8e271c..81625b3de5 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-model-builder diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 763fdda6a1..82c77686e9 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-model diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index e2c24a2098..0fe8e8a421 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-plugin-api diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index 7049d664c6..eac5f47416 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-repository-metadata diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml index b39126b75d..7de14ec589 100644 --- a/maven-settings-builder/pom.xml +++ b/maven-settings-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-settings-builder diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index 64ab03ea5f..5a297f4065 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT maven-settings diff --git a/pom.xml b/pom.xml index 30adad6733..189efcd375 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ maven - 3.0.5-SNAPSHOT + 3.0.4-SNAPSHOT pom Apache Maven From c9d22025493d3121f3473616dfcbdb14ad75defc Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 4 Dec 2011 21:52:04 +0000 Subject: [PATCH 39/69] o Revised fix from r1151426 which broke the appassembler-maven-plugin git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1210240 13f79535-47bb-0310-9956-ffa450edef68 --- .../LegacyLocalRepositoryManager.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java b/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java index db0ff0eed2..d77f593547 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java +++ b/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java @@ -26,6 +26,7 @@ import java.util.List; import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException; import org.apache.maven.repository.Proxy; import org.sonatype.aether.RepositorySystem; @@ -58,6 +59,8 @@ public class LegacyLocalRepositoryManager private final LocalRepository repo; + private final boolean realLocalRepo; + public static RepositorySystemSession overlay( ArtifactRepository repository, RepositorySystemSession session, RepositorySystem system ) { @@ -103,6 +106,20 @@ public class LegacyLocalRepositoryManager repo = new LocalRepository( new File( delegate.getBasedir() ), ( layout != null ) ? layout.getClass().getSimpleName() : "legacy" ); + + /* + * NOTE: "invoker:install" vs "appassembler:assemble": Both mojos use the artifact installer to put an artifact + * into a repository. In the first case, the result needs to be a proper local repository that one can use for + * local artifact resolution. In the second case, the result needs to precisely obey the path information of the + * repository's layout to allow pointing at artifacts within the repository. Unfortunately, + * DefaultRepositoryLayout does not correctly describe the layout of a local repository which unlike a remote + * repository never uses timestamps in the filename of a snapshot artifact. The discrepancy gets notable when a + * remotely resolved snapshot artifact gets passed into pathOf(). So producing a proper local artifact path + * using DefaultRepositoryLayout requires us to enforce usage of the artifact's base version. This + * transformation however contradicts the other use case of precisely obeying the repository's layout. The below + * flag tries to detect which use case applies to make both plugins happy. + */ + realLocalRepo = ( layout instanceof DefaultRepositoryLayout ) && "local".equals( delegate.getId() ); } public LocalRepository getRepository() @@ -112,7 +129,11 @@ public class LegacyLocalRepositoryManager public String getPathForLocalArtifact( Artifact artifact ) { - return delegate.pathOf( RepositoryUtils.toArtifact( artifact.setVersion( artifact.getBaseVersion() ) ) ); + if ( realLocalRepo ) + { + return delegate.pathOf( RepositoryUtils.toArtifact( artifact.setVersion( artifact.getBaseVersion() ) ) ); + } + return delegate.pathOf( RepositoryUtils.toArtifact( artifact ) ); } public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) From d8f872895ea18ad468c9fcedbb4bc5f907d85a45 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 5 Dec 2011 13:47:24 +0000 Subject: [PATCH 40/69] [maven-release-plugin] prepare release maven-3.0.4-RC3 git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1210460 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 2 +- maven-artifact/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-settings-builder/pom.xml | 2 +- maven-settings/pom.xml | 2 +- pom.xml | 8 ++++---- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 1be1544ebd..8f643615a0 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -21,7 +21,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 apache-maven diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index aa08f2e114..f709c3fd63 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-aether-provider diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index 7aefee3915..e93e8d917c 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-artifact diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 07eaf5ff3a..c5f3ccfb11 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-compat diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 080608fb33..336327ef5c 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-core diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 8538f7f0d8..7e8635ceb4 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-embedder diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 81625b3de5..3c108b66f4 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-model-builder diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 82c77686e9..63b2d23580 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-model diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index 0fe8e8a421..abc2065d6f 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-plugin-api diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index eac5f47416..c11557bdc7 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-repository-metadata diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml index 7de14ec589..0e95b097ca 100644 --- a/maven-settings-builder/pom.xml +++ b/maven-settings-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-settings-builder diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index 5a297f4065..8442feb216 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 maven-settings diff --git a/pom.xml b/pom.xml index 189efcd375..3aacefc615 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ maven - 3.0.4-SNAPSHOT + 3.0.4-RC3 pom Apache Maven @@ -159,9 +159,9 @@ - scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/trunk - scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/trunk - http://svn.apache.org/viewvc/maven/maven-3/trunk + scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4-RC3 + scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4-RC3 + http://svn.apache.org/viewvc/maven/maven-3/tags/maven-3.0.4-RC3 jira From 36abba0fa080d487593d83fe8d07f9a3d981ce5c Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 5 Dec 2011 13:48:51 +0000 Subject: [PATCH 41/69] [maven-release-plugin] prepare for next development iteration git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1210462 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 2 +- maven-artifact/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-settings-builder/pom.xml | 2 +- maven-settings/pom.xml | 2 +- pom.xml | 8 ++++---- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 8f643615a0..1be1544ebd 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -21,7 +21,7 @@ org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT apache-maven diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index f709c3fd63..aa08f2e114 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-aether-provider diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index e93e8d917c..7aefee3915 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-artifact diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index c5f3ccfb11..07eaf5ff3a 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-compat diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 336327ef5c..080608fb33 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-core diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 7e8635ceb4..8538f7f0d8 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-embedder diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 3c108b66f4..81625b3de5 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-model-builder diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 63b2d23580..82c77686e9 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-model diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index abc2065d6f..0fe8e8a421 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-plugin-api diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index c11557bdc7..eac5f47416 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-repository-metadata diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml index 0e95b097ca..7de14ec589 100644 --- a/maven-settings-builder/pom.xml +++ b/maven-settings-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-settings-builder diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index 8442feb216..5a297f4065 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT maven-settings diff --git a/pom.xml b/pom.xml index 3aacefc615..189efcd375 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ maven - 3.0.4-RC3 + 3.0.4-SNAPSHOT pom Apache Maven @@ -159,9 +159,9 @@ - scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4-RC3 - scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/tags/maven-3.0.4-RC3 - http://svn.apache.org/viewvc/maven/maven-3/tags/maven-3.0.4-RC3 + scm:svn:http://svn.apache.org/repos/asf/maven/maven-3/trunk + scm:svn:https://svn.apache.org/repos/asf/maven/maven-3/trunk + http://svn.apache.org/viewvc/maven/maven-3/trunk jira From 712c4fff728eb8513b6be751bfd9c94cd3fcbcfb Mon Sep 17 00:00:00 2001 From: Igor Fedorenko Date: Tue, 6 Dec 2011 14:13:48 +0000 Subject: [PATCH 42/69] MNG-5212 preserve PluginDescriptor dependencies in descriptor cache git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1210924 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/plugin/DefaultPluginDescriptorCache.java | 2 ++ .../test/java/org/apache/maven/plugin/PluginManagerTest.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java index 96b82740be..8bb69095e9 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java @@ -96,6 +96,8 @@ public class DefaultPluginDescriptorCache clone.setId( original.getId() ); clone.setIsolatedRealm( original.isIsolatedRealm() ); clone.setSource( original.getSource() ); + + clone.setDependencies( original.getDependencies() ); } return clone; diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java b/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java index 1625799e4c..e49162923c 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java @@ -292,6 +292,8 @@ public class PluginManagerTest session.getRepositorySession() ); pluginManager.getPluginRealm( session, pluginDescriptor ); + assertEquals( 1, pluginDescriptor.getDependencies().size() ); + for ( ComponentDescriptor descriptor : pluginDescriptor.getComponents() ) { assertNotNull( descriptor.getRealm() ); @@ -308,6 +310,8 @@ public class PluginManagerTest session.getRepositorySession() ); pluginManager.getPluginRealm( session, pluginDescriptor ); + assertEquals( 1, pluginDescriptor.getDependencies().size() ); + for ( ComponentDescriptor descriptor : pluginDescriptor.getComponents() ) { assertNotNull( descriptor.getRealm() ); From 65507bcfde41c9c3c08de59ede2b69add912c3fa Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 7 Dec 2011 16:22:49 +0000 Subject: [PATCH 43/69] bump version to 3.0.5-SNAPSHOT 3.0.4 is on release branch: feel free to hack :-) here git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1211509 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 2 +- maven-artifact/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-settings-builder/pom.xml | 2 +- maven-settings/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 1be1544ebd..e990866563 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -21,7 +21,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT apache-maven diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index aa08f2e114..249cd209ca 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-aether-provider diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index 7aefee3915..3c6eee7069 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-artifact diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 07eaf5ff3a..ad6a2a3a12 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-compat diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 080608fb33..429d633a17 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-core diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 8538f7f0d8..4d71019999 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-embedder diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 81625b3de5..505a8e271c 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -16,7 +16,7 @@ org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-model-builder diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 82c77686e9..763fdda6a1 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-model diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index 0fe8e8a421..e2c24a2098 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-plugin-api diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index eac5f47416..7049d664c6 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-repository-metadata diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml index 7de14ec589..b39126b75d 100644 --- a/maven-settings-builder/pom.xml +++ b/maven-settings-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-settings-builder diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index 5a297f4065..64ab03ea5f 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT maven-settings diff --git a/pom.xml b/pom.xml index 189efcd375..30adad6733 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ maven - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT pom Apache Maven From 50b6e3b621823f4e81f500f5aea9bbfdf3036b9d Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 7 Dec 2011 22:55:08 +0000 Subject: [PATCH 44/69] [MNG-5206] plexus container never disposed Submitted by Stuart McCulloch. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1211692 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/maven/cli/MavenCli.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 5acd54a115..90349d85a2 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 @@ -180,6 +180,7 @@ public class MavenCli // TODO: need to externalize CliRequest public int doMain( CliRequest cliRequest ) { + PlexusContainer localContainer = this.container; try { initialize( cliRequest ); @@ -188,7 +189,7 @@ public class MavenCli logging( cliRequest ); version( cliRequest ); properties( cliRequest ); - container( cliRequest ); + localContainer = container( cliRequest ); commands( cliRequest ); settings( cliRequest ); populateRequest( cliRequest ); @@ -218,6 +219,10 @@ public class MavenCli } finally { + if ( localContainer != this.container ) + { + localContainer.dispose(); + } if ( cliRequest.fileStream != null ) { cliRequest.fileStream.close(); @@ -353,7 +358,7 @@ public class MavenCli populateProperties( cliRequest.commandLine, cliRequest.systemProperties, cliRequest.userProperties ); } - private void container( CliRequest cliRequest ) + private PlexusContainer container( CliRequest cliRequest ) throws Exception { if ( cliRequest.classWorld == null ) @@ -414,6 +419,8 @@ public class MavenCli settingsBuilder = container.lookup( SettingsBuilder.class ); dispatcher = (DefaultSecDispatcher) container.lookup( SecDispatcher.class, "maven" ); + + return container; } private PrintStreamLogger setupLogger( CliRequest cliRequest ) From 2b4e9a9ef7aa33b5537be7b9b39dc5311613addc Mon Sep 17 00:00:00 2001 From: Benson Margulies Date: Fri, 9 Dec 2011 18:30:26 +0000 Subject: [PATCH 45/69] MNG-5214: Dependency resolution substitutes g:a:v:jar for j:a:v:something-else when something-else isn't in the reacto o When Aether asks the ReactorReader for a file for an artifact, remember to match type and classifier. And if all else fails, do not return target/classes if the desired artifact is not of type 'jar'. Arguably, if type or classifier are non-default, then we should never return those default paths at all. o Add 'dir' format to make it quicker to run a quick test. If everyone hates this I'll revert it. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1212564 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/src/main/assembly/bin.xml | 1 + .../main/java/org/apache/maven/ReactorReader.java | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apache-maven/src/main/assembly/bin.xml b/apache-maven/src/main/assembly/bin.xml index dcd6647ad6..10eb7df8da 100644 --- a/apache-maven/src/main/assembly/bin.xml +++ b/apache-maven/src/main/assembly/bin.xml @@ -20,6 +20,7 @@ under the License. bin + dir zip tar.gz 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 16a81e2a9c..e9a36429fb 100644 --- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java +++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java @@ -85,9 +85,10 @@ class ReactorReader { return projectArtifact.getFile(); } - else if ( !hasBeenPackaged( project ) ) + else if ( !hasBeenPackaged( project ) ) { // fallback to loose class files only if artifacts haven't been packaged yet + // and only for plain old jars. Not war files, not ear files, not anything else. if ( isTestArtifact( artifact ) ) { @@ -98,7 +99,7 @@ class ReactorReader } else { - if ( project.hasLifecyclePhase( "compile" ) ) + if ( project.hasLifecyclePhase( "compile" ) && artifact.getProperty( "type", "").equals( "jar" ) ) /* also reject non-"" classifier? */ { return new File( project.getBuild().getOutputDirectory() ); } @@ -143,7 +144,9 @@ class ReactorReader { for ( org.apache.maven.artifact.Artifact attachedArtifact : attachedArtifacts ) { - if ( requestedRepositoryConflictId.equals( getConflictId( attachedArtifact ) ) ) + if ( requestedArtifact.getProperty ( "type", "" ).equals( attachedArtifact.getType() ) + && classifierComparison ( requestedArtifact.getClassifier(), attachedArtifact.getClassifier() ) + && requestedRepositoryConflictId.equals( getConflictId( attachedArtifact ) ) ) { return attachedArtifact; } @@ -152,6 +155,12 @@ class ReactorReader return null; } + + private boolean classifierComparison ( String c1, String c2 ) + { + return c1 == null && c2 == null + || ((c1 != null) && c1.equals(c2)); + } /** * Gets the repository conflict id of the specified artifact. Unlike the dependency conflict id, the repository From 04d269f1da00f806c1c9b26884ef988a726d1973 Mon Sep 17 00:00:00 2001 From: Benson Margulies Date: Sat, 10 Dec 2011 02:22:55 +0000 Subject: [PATCH 46/69] MNG-5214: Dependency resolution substitutes g:a:v:jar for j:a:v:something-else when something-else isn't in the reactor o rework to takine MNG-4065 back on board. We need to allow test-jar and jar to dosi-do even if we can't be having with wsdl and jar changing places. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1212720 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/ReactorReader.java | 62 ++++++++++++++++--- 1 file changed, 55 insertions(+), 7 deletions(-) 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 e9a36429fb..747e1fbb96 100644 --- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java +++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java @@ -128,6 +128,8 @@ class ReactorReader * @param project The project to try to resolve the artifact from, must not be null. * @param requestedArtifact The artifact to resolve, must not be null. * @return The matching artifact from the project or null if not found. + * + * Note that this */ private org.apache.maven.artifact.Artifact findMatchingArtifact( MavenProject project, Artifact requestedArtifact ) { @@ -144,9 +146,10 @@ class ReactorReader { for ( org.apache.maven.artifact.Artifact attachedArtifact : attachedArtifacts ) { - if ( requestedArtifact.getProperty ( "type", "" ).equals( attachedArtifact.getType() ) - && classifierComparison ( requestedArtifact.getClassifier(), attachedArtifact.getClassifier() ) - && requestedRepositoryConflictId.equals( getConflictId( attachedArtifact ) ) ) + /* + * Don't use the conflict ids, use a customized comparison that takes various ideas into account. + */ + if ( attachedArtifactComparison ( requestedArtifact, attachedArtifact ) ) { return attachedArtifact; } @@ -156,12 +159,57 @@ class ReactorReader return null; } - private boolean classifierComparison ( String c1, String c2 ) + /** + * Try to satisfy both MNG-4065 and MNG-5214. Consider jar and test-jar equivalent. + * @param requestedType + * @param artifactType + * @return + */ + private boolean attachedArtifactComparison ( Artifact requestedArtifact, org.apache.maven.artifact.Artifact attachedArtifact ) { - return c1 == null && c2 == null - || ((c1 != null) && c1.equals(c2)); + if ( ! requestedArtifact.getGroupId().equals ( attachedArtifact.getGroupId() ) ) + { + return false; + } + if ( ! requestedArtifact.getArtifactId().equals ( attachedArtifact.getArtifactId() ) ) + { + return false; + } + String requestedExtension = requestedArtifact.getExtension(); + String attachedExtension = null; + if ( attachedArtifact.getArtifactHandler() != null ) + { + attachedExtension = attachedArtifact.getArtifactHandler().getExtension(); + } + String requestedType = requestedArtifact.getProperty ( "type", "" ); + String attachedType = attachedArtifact.getType(); + boolean typeOk = false; + + if ( requestedExtension.equals ( attachedExtension ) ) + { + // the ideal case. + typeOk = true; + } + else if ( requestedType.equals( attachedType ) ) + { + typeOk = true; + } + else if ( "test-jar".equals ( requestedType ) && "jar".equals( attachedType ) ) + { + typeOk = true; + } + else if ( "jar".equals ( requestedType ) && "test-jar".equals( attachedType ) ) + { + typeOk = true; + } + + if ( !typeOk ) + { + return false; + } + return requestedArtifact.getClassifier().equals ( attachedArtifact.getClassifier() ); } - + /** * Gets the repository conflict id of the specified artifact. Unlike the dependency conflict id, the repository * conflict id uses the artifact file extension instead of the artifact type. Hence, the repository conflict id more From 4b637c5a2f7412febd7759b918c7d3222b2b3c31 Mon Sep 17 00:00:00 2001 From: Benson Margulies Date: Sat, 10 Dec 2011 13:54:49 +0000 Subject: [PATCH 47/69] MNG-5214: Dependency resolution substitutes g:a:v:jar for j:a:v:something-else when something-else isn't in the reactor o allow ejb-client types artifacts to dance with jar artifacts to allow reactor resolution to target/classes, thus unbreaking some integration tests. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1212793 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/maven/ReactorReader.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 747e1fbb96..9afe864765 100644 --- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java +++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java @@ -27,6 +27,7 @@ import org.sonatype.aether.repository.WorkspaceRepository; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -42,13 +43,16 @@ import java.util.Map; class ReactorReader implements WorkspaceReader { + private final static Collection JAR_LIKE_TYPES = Arrays.asList( "jar", "test-jar", "ejb-client" ); + + private final static Collection COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" ); private Map projectsByGAV; private Map> projectsByGA; private WorkspaceRepository repository; - + public ReactorReader( Map reactorProjects ) { projectsByGAV = reactorProjects; @@ -99,7 +103,8 @@ class ReactorReader } else { - if ( project.hasLifecyclePhase( "compile" ) && artifact.getProperty( "type", "").equals( "jar" ) ) /* also reject non-"" classifier? */ + String type = artifact.getProperty( "type", ""); + if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) ) { return new File( project.getBuild().getOutputDirectory() ); } @@ -194,11 +199,7 @@ class ReactorReader { typeOk = true; } - else if ( "test-jar".equals ( requestedType ) && "jar".equals( attachedType ) ) - { - typeOk = true; - } - else if ( "jar".equals ( requestedType ) && "test-jar".equals( attachedType ) ) + else if ( JAR_LIKE_TYPES.contains( requestedType ) && JAR_LIKE_TYPES.contains( attachedType ) ) { typeOk = true; } From 87884c7bc1400ea4af3c2157953fe9a120ca1543 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sun, 11 Dec 2011 08:47:50 +0000 Subject: [PATCH 48/69] [MNG-5209] MavenProject.getTestClasspathElements can return null elements Submitted by Jesse Glick. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1212980 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/project/MavenProject.java | 30 +++++++++++++++---- .../maven/project/MavenProjectTest.java | 22 ++++++++++++-- 2 files changed, 45 insertions(+), 7 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 088289dc95..1e235f2477 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 @@ -504,7 +504,11 @@ public class MavenProject { List list = new ArrayList( getArtifacts().size() + 1 ); - list.add( getBuild().getOutputDirectory() ); + String d = getBuild().getOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } for ( Artifact a : getArtifacts() ) { @@ -580,9 +584,17 @@ public class MavenProject { List list = new ArrayList( getArtifacts().size() + 2 ); - list.add( getBuild().getTestOutputDirectory() ); + String d = getBuild().getTestOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } - list.add( getBuild().getOutputDirectory() ); + d = getBuild().getOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } for ( Artifact a : getArtifacts() ) { @@ -644,7 +656,11 @@ public class MavenProject { List list = new ArrayList( getArtifacts().size() + 1 ); - list.add( getBuild().getOutputDirectory() ); + String d = getBuild().getOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } for ( Artifact a : getArtifacts() ) { @@ -717,7 +733,11 @@ public class MavenProject { List list = new ArrayList( getArtifacts().size() ); - list.add( getBuild().getOutputDirectory() ); + String d = getBuild().getOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } for ( Artifact a : getArtifacts() ) { 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 83f664db39..f70153b501 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 @@ -146,7 +146,8 @@ public class MavenProjectTest assertEquals( "..", pathAdjustment ); } - public void testCloneWithDistributionManagement() throws Exception + public void testCloneWithDistributionManagement() + throws Exception { File f = getFileForClasspathResource( "distributionManagement-pom.xml" ); @@ -156,7 +157,8 @@ public class MavenProjectTest assertNotNull( "clonedProject - distributionManagement", clonedProject.getDistributionManagementArtifactRepository() ); } - public void testCloneWithActiveProfile() throws Exception + public void testCloneWithActiveProfile() + throws Exception { File f = getFileForClasspathResource( "withActiveByDefaultProfile-pom.xml" ); @@ -174,4 +176,20 @@ public class MavenProjectTest assertNotSame( "The list of active profiles should have been cloned too but is same", activeProfilesOrig, activeProfilesClone ); } + + public void testUndefinedOutputDirectory() + throws Exception + { + MavenProject p = new MavenProject(); + assertNoNulls( p.getCompileClasspathElements() ); + assertNoNulls( p.getSystemClasspathElements() ); + assertNoNulls( p.getRuntimeClasspathElements() ); + assertNoNulls( p.getTestClasspathElements() ); + } + + private void assertNoNulls( List elements ) + { + assertFalse( elements.contains( null ) ); + } + } From 18de0901980e7380957cc19490dc28147d84d1b6 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sun, 11 Dec 2011 08:48:07 +0000 Subject: [PATCH 49/69] remove redundant cast git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1212981 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/project/MavenProjectTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 f70153b501..60736a384d 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 @@ -96,7 +96,7 @@ public class MavenProjectTest File f = getFileForClasspathResource( "canonical-pom.xml" ); MavenProject projectToClone = getProject( f ); - MavenProject clonedProject = (MavenProject) projectToClone.clone(); + MavenProject clonedProject = projectToClone.clone(); assertEquals( "maven-core", clonedProject.getArtifactId() ); Map clonedMap = clonedProject.getManagedVersionMap(); assertNotNull( "ManagedVersionMap not copied", clonedMap ); @@ -118,7 +118,7 @@ public class MavenProjectTest assertNotNull( "No ManagedVersionMap", map ); assertTrue( "ManagedVersionMap is empty", !map.isEmpty() ); - MavenProject clonedProject = (MavenProject) projectToClone.clone(); + MavenProject clonedProject = projectToClone.clone(); assertEquals( "maven-core", clonedProject.getArtifactId() ); Map clonedMap = clonedProject.getManagedVersionMap(); assertNotNull( "ManagedVersionMap not copied", clonedMap ); @@ -153,7 +153,7 @@ public class MavenProjectTest File f = getFileForClasspathResource( "distributionManagement-pom.xml" ); MavenProject projectToClone = getProject( f ); - MavenProject clonedProject = (MavenProject) projectToClone.clone(); + MavenProject clonedProject = projectToClone.clone(); assertNotNull( "clonedProject - distributionManagement", clonedProject.getDistributionManagementArtifactRepository() ); } @@ -167,7 +167,7 @@ public class MavenProjectTest assertEquals( "Expecting 1 active profile", 1, activeProfilesOrig.size() ); - MavenProject clonedProject = (MavenProject) projectToClone.clone(); + MavenProject clonedProject = projectToClone.clone(); List activeProfilesClone = clonedProject.getActiveProfiles(); From c55985ace987986283875a3e0475460f6413f750 Mon Sep 17 00:00:00 2001 From: Benson Margulies Date: Sun, 11 Dec 2011 12:30:30 +0000 Subject: [PATCH 50/69] Take the dir format away. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1212997 13f79535-47bb-0310-9956-ffa450edef68 --- apache-maven/src/main/assembly/bin.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/apache-maven/src/main/assembly/bin.xml b/apache-maven/src/main/assembly/bin.xml index 10eb7df8da..dcd6647ad6 100644 --- a/apache-maven/src/main/assembly/bin.xml +++ b/apache-maven/src/main/assembly/bin.xml @@ -20,7 +20,6 @@ under the License. bin - dir zip tar.gz From fef00bd1fba02333aed10b857417b4721f817235 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 20 Dec 2011 13:23:02 +0000 Subject: [PATCH 51/69] upgrade to wagon 2.2 git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1221248 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 30adad6733..cbca65b766 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ 1.14 2.0.6 2.3.0 - 2.1 + 2.2 1.3 1.7 1.4.1 From 71c145a0e666916f681e439d25a3dbf4af542c7a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 22 Dec 2011 15:13:10 +0000 Subject: [PATCH 52/69] merge -r1222269:1222270 https://svn.apache.org/repos/asf/maven/maven-3/branches/maven-3.0.4-RCx git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1222272 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/repository/RepositorySystem.java | 2 +- .../src/main/resources/org/apache/maven/model/pom-4.0.0.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java b/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java index 78bfcdaaf3..f8f4f2208e 100644 --- a/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java +++ b/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java @@ -51,7 +51,7 @@ public interface RepositorySystem final String DEFAULT_REMOTE_REPO_ID = "central"; - final String DEFAULT_REMOTE_REPO_URL = "http://repo1.maven.apache.org/maven2"; + final String DEFAULT_REMOTE_REPO_URL = "http://repo.maven.apache.org/maven2"; Artifact createArtifact( String groupId, String artifactId, String version, String packaging ); diff --git a/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml b/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml index 660e76ebba..1e70e8a016 100644 --- a/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml +++ b/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml @@ -27,7 +27,7 @@ under the License. central Central Repository - http://repo1.maven.apache.org/maven2 + http://repo.maven.apache.org/maven2 default false @@ -39,7 +39,7 @@ under the License. central Central Repository - http://repo1.maven.apache.org/maven2 + http://repo.maven.apache.org/maven2 default false From 82b345e0094813b34fcac85e64dde2d5e02b4cc9 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 30 Dec 2011 21:43:28 +0100 Subject: [PATCH 53/69] o Migrated to Eclipse Aether --- apache-maven/pom.xml | 2 +- maven-aether-provider/pom.xml | 21 ++- .../internal/ArtifactDescriptorUtils.java | 8 +- .../DefaultArtifactDescriptorReader.java | 127 ++++++++++----- .../internal/DefaultModelCache.java | 4 +- .../internal/DefaultModelResolver.java | 20 +-- .../internal/DefaultServiceLocator.java | 52 ------ .../internal/DefaultVersionRangeResolver.java | 98 +++++++----- .../internal/DefaultVersionResolver.java | 100 +++++++----- .../internal/LocalSnapshotMetadata.java | 2 +- .../LocalSnapshotMetadataGenerator.java | 14 +- .../internal/MavenAetherModule.java | 55 +++++++ .../repository/internal/MavenMetadata.java | 4 +- .../MavenRepositorySystemSession.java | 106 ------------- .../internal/MavenRepositorySystemUtils.java | 134 ++++++++++++++++ .../internal/MavenServiceLocator.java | 52 ------ .../internal/RelocatedArtifact.java | 4 +- .../internal/RemoteSnapshotMetadata.java | 2 +- .../RemoteSnapshotMetadataGenerator.java | 14 +- .../SnapshotMetadataGeneratorFactory.java | 12 +- .../repository/internal/VersionsMetadata.java | 4 +- .../internal/VersionsMetadataGenerator.java | 12 +- .../VersionsMetadataGeneratorFactory.java | 12 +- ...va => MavenRepositorySystemUtilsTest.java} | 12 +- maven-compat/pom.xml | 2 +- .../deployer/DefaultArtifactDeployer.java | 22 +-- .../installer/DefaultArtifactInstaller.java | 16 +- .../DefaultArtifactRepositoryFactory.java | 2 +- .../repository/metadata/MetadataBridge.java | 4 +- .../resolver/DefaultArtifactResolver.java | 14 +- .../apache/maven/project/ProjectUtils.java | 2 +- .../legacy/LegacyRepositorySystem.java | 14 +- .../AbstractArtifactComponentTestCase.java | 51 +++--- .../project/AbstractMavenProjectTestCase.java | 15 +- .../project/ClasspathArtifactResolver.java | 14 +- .../project/LegacyLocalRepositoryManager.java | 148 ++++++++++++++++-- .../maven/project/ProjectClasspathTest.java | 4 +- .../LegacyRepositorySystemTest.java | 18 ++- .../legacy/LegacyRepositorySystemTest.java | 8 + .../resolver/ArtifactResolverTest.xml | 2 +- maven-core/pom.xml | 6 +- .../java/org/apache/maven/DefaultMaven.java | 56 +++---- .../maven/LoggingRepositoryListener.java | 6 +- .../java/org/apache/maven/ReactorReader.java | 6 +- .../org/apache/maven/RepositoryUtils.java | 28 ++-- .../LegacyLocalRepositoryManager.java | 38 ++--- .../ArtifactClassRealmConstituent.java | 2 +- .../maven/classrealm/ClassRealmManager.java | 2 +- .../classrealm/DefaultClassRealmManager.java | 28 ++-- .../org/apache/maven/eventspy/EventSpy.java | 2 +- .../eventspy/internal/EventSpyDispatcher.java | 2 +- .../internal/EventSpyRepositoryListener.java | 6 +- .../DefaultMavenExecutionRequest.java | 8 +- .../execution/MavenExecutionRequest.java | 6 +- .../apache/maven/execution/MavenSession.java | 2 +- .../internal/LifecycleDependencyResolver.java | 14 +- .../maven/plugin/BuildPluginManager.java | 4 +- .../org/apache/maven/plugin/CacheUtils.java | 10 +- .../plugin/DefaultBuildPluginManager.java | 4 +- .../plugin/DefaultExtensionRealmCache.java | 2 +- .../plugin/DefaultPluginArtifactsCache.java | 12 +- .../plugin/DefaultPluginDescriptorCache.java | 8 +- .../maven/plugin/DefaultPluginRealmCache.java | 10 +- .../maven/plugin/ExtensionRealmCache.java | 2 +- .../apache/maven/plugin/LegacySupport.java | 2 +- .../maven/plugin/MavenPluginManager.java | 6 +- .../maven/plugin/PluginArtifactsCache.java | 8 +- .../maven/plugin/PluginDescriptorCache.java | 4 +- .../apache/maven/plugin/PluginRealmCache.java | 6 +- .../plugin/internal/DefaultLegacySupport.java | 2 +- .../internal/DefaultMavenPluginManager.java | 16 +- .../DefaultPluginDependenciesResolver.java | 75 ++++----- .../plugin/internal/PlexusUtilsInjector.java | 18 +-- .../internal/PluginDependenciesResolver.java | 10 +- .../maven/plugin/internal/WagonExcluder.java | 8 +- .../prefix/DefaultPluginPrefixRequest.java | 4 +- .../NoPluginFoundForPrefixException.java | 4 +- .../plugin/prefix/PluginPrefixRequest.java | 4 +- .../plugin/prefix/PluginPrefixResult.java | 2 +- .../internal/DefaultPluginPrefixResolver.java | 36 ++--- .../internal/DefaultPluginPrefixResult.java | 2 +- .../version/DefaultPluginVersionRequest.java | 4 +- .../plugin/version/PluginVersionRequest.java | 4 +- .../PluginVersionResolutionException.java | 4 +- .../plugin/version/PluginVersionResult.java | 2 +- .../DefaultPluginVersionResolver.java | 38 ++--- .../internal/DefaultPluginVersionResult.java | 2 +- .../DefaultDependencyResolutionRequest.java | 4 +- .../DefaultDependencyResolutionResult.java | 4 +- .../maven/project/DefaultProjectBuilder.java | 24 +-- .../project/DefaultProjectBuildingHelper.java | 12 +- .../DefaultProjectBuildingRequest.java | 2 +- .../DefaultProjectDependenciesResolver.java | 48 +++--- .../project/DefaultProjectRealmCache.java | 2 +- .../project/DependencyResolutionRequest.java | 4 +- .../project/DependencyResolutionResult.java | 4 +- .../apache/maven/project/MavenProject.java | 4 +- .../maven/project/ProjectBuildingRequest.java | 2 +- .../maven/project/ProjectModelResolver.java | 18 +-- .../maven/project/ProjectRealmCache.java | 2 +- .../project/artifact/MavenMetadataSource.java | 10 +- .../maven/repository/RepositorySystem.java | 2 +- .../internal/DefaultRuntimeInformation.java | 12 +- .../AbstractCoreMavenComponentTestCase.java | 17 +- .../internal/stub/BuildPluginManagerStub.java | 4 +- .../stub/PluginPrefixResolverStub.java | 2 +- .../stub/PluginVersionResolverStub.java | 2 +- .../stub/ProjectDependenciesResolverStub.java | 6 +- .../project/AbstractMavenProjectTestCase.java | 15 +- .../project/LegacyLocalRepositoryManager.java | 148 ++++++++++++++++-- .../maven/project/PomConstructionTest.java | 27 ++-- .../repository/TestRepositoryConnector.java | 18 +-- .../TestRepositoryConnectorFactory.java | 12 +- .../repository/TestRepositorySystem.java | 2 +- .../PomConstructionWithSettingsTest.java | 21 ++- .../cli/AbstractMavenTransferListener.java | 8 +- .../cli/ConsoleMavenTransferListener.java | 6 +- .../java/org/apache/maven/cli/MavenCli.java | 3 +- .../maven/cli/QuietMavenTransferListener.java | 2 +- pom.xml | 18 +-- 120 files changed, 1286 insertions(+), 911 deletions(-) delete mode 100644 maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultServiceLocator.java create mode 100644 maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java delete mode 100644 maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemSession.java create mode 100644 maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java delete mode 100644 maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenServiceLocator.java rename maven-aether-provider/src/test/java/org/apache/maven/repository/internal/{DefaultServiceLocatorTest.java => MavenRepositorySystemUtilsTest.java} (77%) diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index e990866563..bc638397f8 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -80,7 +80,7 @@ wagon-file - org.sonatype.aether + org.eclipse.aether aether-connector-wagon diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml index 249cd209ca..4e2e01cd4b 100644 --- a/maven-aether-provider/pom.xml +++ b/maven-aether-provider/pom.xml @@ -50,19 +50,19 @@ under the License. maven-repository-metadata - org.sonatype.aether + org.eclipse.aether aether-api - org.sonatype.aether + org.eclipse.aether aether-spi - org.sonatype.aether + org.eclipse.aether aether-util - org.sonatype.aether + org.eclipse.aether aether-impl @@ -73,6 +73,19 @@ under the License. org.codehaus.plexus plexus-utils + + com.google.inject + guice + 3.0 + no_aop + true + + + aopalliance + aopalliance + + + diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java index b7da0d1a62..7f71dd913f 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java @@ -20,10 +20,10 @@ package org.apache.maven.repository.internal; */ import org.apache.maven.model.Repository; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.RepositoryPolicy; -import org.sonatype.aether.util.artifact.DefaultArtifact; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.util.artifact.DefaultArtifact; /** * Warning: This is an internal utility class that is only public for technical reasons, it is not part diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java index 1faee29754..21daabfb37 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java @@ -21,6 +21,7 @@ package org.apache.maven.repository.internal; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; @@ -28,6 +29,9 @@ import java.util.Map; import java.util.Properties; import java.util.Set; +import javax.inject.Inject; +import javax.inject.Named; + import org.apache.maven.model.DependencyManagement; import org.apache.maven.model.DistributionManagement; import org.apache.maven.model.License; @@ -45,52 +49,54 @@ import org.apache.maven.model.building.ModelProblem; import org.apache.maven.model.resolution.UnresolvableModelException; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import org.sonatype.aether.RepositoryEvent.EventType; -import org.sonatype.aether.RepositoryException; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.artifact.ArtifactType; -import org.sonatype.aether.artifact.ArtifactTypeRegistry; -import org.sonatype.aether.graph.Dependency; -import org.sonatype.aether.graph.Exclusion; -import org.sonatype.aether.impl.ArtifactDescriptorReader; -import org.sonatype.aether.impl.ArtifactResolver; -import org.sonatype.aether.impl.RemoteRepositoryManager; -import org.sonatype.aether.impl.RepositoryEventDispatcher; -import org.sonatype.aether.impl.VersionResolver; -import org.sonatype.aether.transfer.ArtifactNotFoundException; -import org.sonatype.aether.util.DefaultRequestTrace; -import org.sonatype.aether.util.artifact.ArtifactProperties; -import org.sonatype.aether.util.artifact.DefaultArtifact; -import org.sonatype.aether.util.artifact.DefaultArtifactType; -import org.sonatype.aether.util.listener.DefaultRepositoryEvent; -import org.sonatype.aether.repository.WorkspaceRepository; -import org.sonatype.aether.resolution.ArtifactDescriptorException; -import org.sonatype.aether.resolution.ArtifactDescriptorRequest; -import org.sonatype.aether.resolution.ArtifactDescriptorResult; -import org.sonatype.aether.resolution.ArtifactRequest; -import org.sonatype.aether.resolution.ArtifactResolutionException; -import org.sonatype.aether.resolution.ArtifactResult; -import org.sonatype.aether.resolution.VersionRequest; -import org.sonatype.aether.resolution.VersionResolutionException; -import org.sonatype.aether.resolution.VersionResult; -import org.sonatype.aether.spi.locator.Service; -import org.sonatype.aether.spi.locator.ServiceLocator; -import org.sonatype.aether.spi.log.Logger; -import org.sonatype.aether.spi.log.NullLogger; +import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.ArtifactProperties; +import org.eclipse.aether.artifact.ArtifactType; +import org.eclipse.aether.artifact.ArtifactTypeRegistry; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.Exclusion; +import org.eclipse.aether.impl.ArtifactDescriptorReader; +import org.eclipse.aether.impl.ArtifactResolver; +import org.eclipse.aether.impl.RemoteRepositoryManager; +import org.eclipse.aether.impl.RepositoryEventDispatcher; +import org.eclipse.aether.impl.VersionResolver; +import org.eclipse.aether.repository.WorkspaceRepository; +import org.eclipse.aether.resolution.ArtifactDescriptorException; +import org.eclipse.aether.resolution.ArtifactDescriptorRequest; +import org.eclipse.aether.resolution.ArtifactDescriptorResult; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResolutionException; +import org.eclipse.aether.resolution.ArtifactResult; +import org.eclipse.aether.resolution.VersionRequest; +import org.eclipse.aether.resolution.VersionResolutionException; +import org.eclipse.aether.resolution.VersionResult; +import org.eclipse.aether.spi.locator.Service; +import org.eclipse.aether.spi.locator.ServiceLocator; +import org.eclipse.aether.spi.log.Logger; +import org.eclipse.aether.spi.log.LoggerFactory; +import org.eclipse.aether.spi.log.NullLoggerFactory; +import org.eclipse.aether.transfer.ArtifactNotFoundException; +import org.eclipse.aether.util.DefaultRequestTrace; +import org.eclipse.aether.util.artifact.DefaultArtifact; +import org.eclipse.aether.util.artifact.DefaultArtifactType; +import org.eclipse.aether.util.listener.DefaultRepositoryEvent; /** * @author Benjamin Bentmann */ +@Named @Component( role = ArtifactDescriptorReader.class ) public class DefaultArtifactDescriptorReader implements ArtifactDescriptorReader, Service { @SuppressWarnings( "unused" ) - @Requirement - private Logger logger = NullLogger.INSTANCE; + @Requirement( role = LoggerFactory.class ) + private Logger logger = NullLoggerFactory.LOGGER; @Requirement private RemoteRepositoryManager remoteRepositoryManager; @@ -107,9 +113,27 @@ public class DefaultArtifactDescriptorReader @Requirement private ModelBuilder modelBuilder; + public DefaultArtifactDescriptorReader() + { + // enable no-arg constructor + } + + @Inject + DefaultArtifactDescriptorReader( RemoteRepositoryManager remoteRepositoryManager, VersionResolver versionResolver, + ArtifactResolver artifactResolver, ModelBuilder modelBuilder, + RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory ) + { + setRemoteRepositoryManager( remoteRepositoryManager ); + setVersionResolver( versionResolver ); + setArtifactResolver( artifactResolver ); + setModelBuilder( modelBuilder ); + setLoggerFactory( loggerFactory ); + setRepositoryEventDispatcher( repositoryEventDispatcher ); + } + public void initService( ServiceLocator locator ) { - setLogger( locator.getService( Logger.class ) ); + setLoggerFactory( locator.getService( LoggerFactory.class ) ); setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) ); setVersionResolver( locator.getService( VersionResolver.class ) ); setArtifactResolver( locator.getService( ArtifactResolver.class ) ); @@ -121,12 +145,18 @@ public class DefaultArtifactDescriptorReader } } - public DefaultArtifactDescriptorReader setLogger( Logger logger ) + public DefaultArtifactDescriptorReader setLoggerFactory( LoggerFactory loggerFactory ) { - this.logger = ( logger != null ) ? logger : NullLogger.INSTANCE; + this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } + void setLogger( LoggerFactory loggerFactory ) + { + // plexus support + setLoggerFactory( loggerFactory ); + } + public DefaultArtifactDescriptorReader setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ) { if ( remoteRepositoryManager == null ) @@ -228,6 +258,8 @@ public class DefaultArtifactDescriptorReader } result.setProperties( properties ); + + setArtifactProperties( result, model ); } return result; @@ -382,6 +414,23 @@ public class DefaultArtifactDescriptorReader return relocation; } + private void setArtifactProperties( ArtifactDescriptorResult result, Model model ) + { + String downloadUrl = null; + DistributionManagement distMngt = model.getDistributionManagement(); + if ( distMngt != null ) + { + downloadUrl = distMngt.getDownloadUrl(); + } + if ( downloadUrl != null && downloadUrl.length() > 0 ) + { + Artifact artifact = result.getArtifact(); + Map props = new HashMap( artifact.getProperties() ); + props.put( ArtifactProperties.DOWNLOAD_URL, downloadUrl ); + result.setArtifact( artifact.setProperties( props ) ); + } + } + private Dependency convert( org.apache.maven.model.Dependency dependency, ArtifactTypeRegistry stereotypes ) { ArtifactType stereotype = stereotypes.get( dependency.getType() ); diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelCache.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelCache.java index 25b24c2c3f..2d4fa7d673 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelCache.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelCache.java @@ -20,8 +20,8 @@ package org.apache.maven.repository.internal; */ import org.apache.maven.model.building.ModelCache; -import org.sonatype.aether.RepositoryCache; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositoryCache; +import org.eclipse.aether.RepositorySystemSession; /** * A model builder cache backed by the repository system cache. 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 96b9fc3652..387340ca6b 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 @@ -31,15 +31,15 @@ import org.apache.maven.model.building.ModelSource; import org.apache.maven.model.resolution.InvalidRepositoryException; import org.apache.maven.model.resolution.ModelResolver; import org.apache.maven.model.resolution.UnresolvableModelException; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.impl.ArtifactResolver; -import org.sonatype.aether.impl.RemoteRepositoryManager; -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.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.impl.ArtifactResolver; +import org.eclipse.aether.impl.RemoteRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResolutionException; +import org.eclipse.aether.util.artifact.DefaultArtifact; /** * A model resolver to assist building of dependency POMs. This resolver gives priority to those repositories that have @@ -93,7 +93,7 @@ class DefaultModelResolver public void addRepository( Repository repository ) throws InvalidRepositoryException { - if ( !repositoryIds.add( repository.getId() ) ) + if ( session.isIgnoreArtifactDescriptorRepositories() || !repositoryIds.add( repository.getId() ) ) { return; } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultServiceLocator.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultServiceLocator.java deleted file mode 100644 index 032f5461c9..0000000000 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultServiceLocator.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.apache.maven.repository.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.sonatype.aether.impl.ArtifactDescriptorReader; -import org.sonatype.aether.impl.MetadataGeneratorFactory; -import org.sonatype.aether.impl.VersionRangeResolver; -import org.sonatype.aether.impl.VersionResolver; - -/** - * A simple service locator that is already setup with all components from this library. To acquire a complete - * repository system, clients need to add some repository connectors for remote transfers. Note: This component - * is meant to assists those clients that employ the repository systems outside of an IoC container, Maven plugins - * should instead always use regular dependency injection to acquire the repository system. - * - * @author Benjamin Bentmann - * @deprecated use {@link MavenServiceLocator} instead, which is more explicit. - */ -public class DefaultServiceLocator - extends org.sonatype.aether.impl.internal.DefaultServiceLocator -{ - - /** - * Creates a new service locator that already knows about all service implementations included this library. - */ - public DefaultServiceLocator() - { - addService( ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class ); - addService( VersionResolver.class, DefaultVersionResolver.class ); - addService( VersionRangeResolver.class, DefaultVersionRangeResolver.class ); - addService( MetadataGeneratorFactory.class, SnapshotMetadataGeneratorFactory.class ); - addService( MetadataGeneratorFactory.class, VersionsMetadataGeneratorFactory.class ); - } - -} diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java index c5b85f709a..1362557b36 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java @@ -26,44 +26,49 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.inject.Inject; +import javax.inject.Named; + import org.apache.maven.artifact.repository.metadata.Versioning; import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.IOUtil; -import org.sonatype.aether.RepositoryEvent.EventType; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.SyncContext; -import org.sonatype.aether.util.DefaultRequestTrace; -import org.sonatype.aether.util.listener.DefaultRepositoryEvent; -import org.sonatype.aether.util.metadata.DefaultMetadata; -import org.sonatype.aether.util.version.GenericVersionScheme; -import org.sonatype.aether.version.InvalidVersionSpecificationException; -import org.sonatype.aether.version.Version; -import org.sonatype.aether.version.VersionConstraint; -import org.sonatype.aether.version.VersionScheme; -import org.sonatype.aether.impl.MetadataResolver; -import org.sonatype.aether.impl.RepositoryEventDispatcher; -import org.sonatype.aether.impl.SyncContextFactory; -import org.sonatype.aether.impl.VersionRangeResolver; -import org.sonatype.aether.metadata.Metadata; -import org.sonatype.aether.repository.ArtifactRepository; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.WorkspaceReader; -import org.sonatype.aether.resolution.MetadataRequest; -import org.sonatype.aether.resolution.MetadataResult; -import org.sonatype.aether.resolution.VersionRangeRequest; -import org.sonatype.aether.resolution.VersionRangeResolutionException; -import org.sonatype.aether.resolution.VersionRangeResult; -import org.sonatype.aether.spi.locator.Service; -import org.sonatype.aether.spi.locator.ServiceLocator; -import org.sonatype.aether.spi.log.Logger; -import org.sonatype.aether.spi.log.NullLogger; +import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.SyncContext; +import org.eclipse.aether.impl.MetadataResolver; +import org.eclipse.aether.impl.RepositoryEventDispatcher; +import org.eclipse.aether.impl.SyncContextFactory; +import org.eclipse.aether.impl.VersionRangeResolver; +import org.eclipse.aether.metadata.Metadata; +import org.eclipse.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.resolution.MetadataRequest; +import org.eclipse.aether.resolution.MetadataResult; +import org.eclipse.aether.resolution.VersionRangeRequest; +import org.eclipse.aether.resolution.VersionRangeResolutionException; +import org.eclipse.aether.resolution.VersionRangeResult; +import org.eclipse.aether.spi.locator.Service; +import org.eclipse.aether.spi.locator.ServiceLocator; +import org.eclipse.aether.spi.log.Logger; +import org.eclipse.aether.spi.log.LoggerFactory; +import org.eclipse.aether.spi.log.NullLoggerFactory; +import org.eclipse.aether.util.DefaultRequestTrace; +import org.eclipse.aether.util.listener.DefaultRepositoryEvent; +import org.eclipse.aether.util.metadata.DefaultMetadata; +import org.eclipse.aether.util.version.GenericVersionScheme; +import org.eclipse.aether.version.InvalidVersionSpecificationException; +import org.eclipse.aether.version.Version; +import org.eclipse.aether.version.VersionConstraint; +import org.eclipse.aether.version.VersionScheme; /** * @author Benjamin Bentmann */ +@Named @Component( role = VersionRangeResolver.class ) public class DefaultVersionRangeResolver implements VersionRangeResolver, Service @@ -72,8 +77,8 @@ public class DefaultVersionRangeResolver private static final String MAVEN_METADATA_XML = "maven-metadata.xml"; @SuppressWarnings( "unused" ) - @Requirement - private Logger logger = NullLogger.INSTANCE; + @Requirement( role = LoggerFactory.class ) + private Logger logger = NullLoggerFactory.LOGGER; @Requirement private MetadataResolver metadataResolver; @@ -84,20 +89,41 @@ public class DefaultVersionRangeResolver @Requirement private RepositoryEventDispatcher repositoryEventDispatcher; + public DefaultVersionRangeResolver() + { + // enable default constructor + } + + @Inject + DefaultVersionRangeResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory, + RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory ) + { + setMetadataResolver( metadataResolver ); + setSyncContextFactory( syncContextFactory ); + setLoggerFactory( loggerFactory ); + setRepositoryEventDispatcher( repositoryEventDispatcher ); + } + public void initService( ServiceLocator locator ) { - setLogger( locator.getService( Logger.class ) ); + setLoggerFactory( locator.getService( LoggerFactory.class ) ); setMetadataResolver( locator.getService( MetadataResolver.class ) ); setSyncContextFactory( locator.getService( SyncContextFactory.class ) ); setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) ); } - public DefaultVersionRangeResolver setLogger( Logger logger ) + public DefaultVersionRangeResolver setLoggerFactory( LoggerFactory loggerFactory ) { - this.logger = ( logger != null ) ? logger : NullLogger.INSTANCE; + this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } + void setLogger( LoggerFactory loggerFactory ) + { + // plexus support + setLoggerFactory( loggerFactory ); + } + public DefaultVersionRangeResolver setMetadataResolver( MetadataResolver metadataResolver ) { if ( metadataResolver == null ) @@ -148,7 +174,7 @@ public class DefaultVersionRangeResolver result.setVersionConstraint( versionConstraint ); - if ( versionConstraint.getRanges().isEmpty() ) + if ( versionConstraint.getRange() == null ) { result.addVersion( versionConstraint.getVersion() ); } @@ -265,7 +291,7 @@ public class DefaultVersionRangeResolver } finally { - syncContext.release(); + syncContext.close(); } } } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java index 7c0f85f422..1e0e35365d 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java @@ -28,6 +28,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.inject.Inject; +import javax.inject.Named; + import org.apache.maven.artifact.repository.metadata.Snapshot; import org.apache.maven.artifact.repository.metadata.SnapshotVersion; import org.apache.maven.artifact.repository.metadata.Versioning; @@ -36,40 +39,42 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; -import org.sonatype.aether.ConfigurationProperties; -import org.sonatype.aether.RepositoryCache; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.RepositoryEvent.EventType; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.SyncContext; -import org.sonatype.aether.util.DefaultRequestTrace; -import org.sonatype.aether.util.listener.DefaultRepositoryEvent; -import org.sonatype.aether.util.metadata.DefaultMetadata; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.impl.MetadataResolver; -import org.sonatype.aether.impl.RepositoryEventDispatcher; -import org.sonatype.aether.impl.SyncContextFactory; -import org.sonatype.aether.impl.VersionResolver; -import org.sonatype.aether.impl.internal.CacheUtils; -import org.sonatype.aether.metadata.Metadata; -import org.sonatype.aether.repository.ArtifactRepository; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.WorkspaceReader; -import org.sonatype.aether.repository.WorkspaceRepository; -import org.sonatype.aether.resolution.MetadataRequest; -import org.sonatype.aether.resolution.MetadataResult; -import org.sonatype.aether.resolution.VersionRequest; -import org.sonatype.aether.resolution.VersionResolutionException; -import org.sonatype.aether.resolution.VersionResult; -import org.sonatype.aether.spi.locator.Service; -import org.sonatype.aether.spi.locator.ServiceLocator; -import org.sonatype.aether.spi.log.Logger; -import org.sonatype.aether.spi.log.NullLogger; +import org.eclipse.aether.RepositoryCache; +import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.SyncContext; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.impl.MetadataResolver; +import org.eclipse.aether.impl.RepositoryEventDispatcher; +import org.eclipse.aether.impl.SyncContextFactory; +import org.eclipse.aether.impl.VersionResolver; +import org.eclipse.aether.internal.impl.CacheUtils; +import org.eclipse.aether.metadata.Metadata; +import org.eclipse.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.repository.WorkspaceRepository; +import org.eclipse.aether.resolution.MetadataRequest; +import org.eclipse.aether.resolution.MetadataResult; +import org.eclipse.aether.resolution.VersionRequest; +import org.eclipse.aether.resolution.VersionResolutionException; +import org.eclipse.aether.resolution.VersionResult; +import org.eclipse.aether.spi.locator.Service; +import org.eclipse.aether.spi.locator.ServiceLocator; +import org.eclipse.aether.spi.log.Logger; +import org.eclipse.aether.spi.log.LoggerFactory; +import org.eclipse.aether.spi.log.NullLoggerFactory; +import org.eclipse.aether.util.ConfigUtils; +import org.eclipse.aether.util.DefaultRequestTrace; +import org.eclipse.aether.util.listener.DefaultRepositoryEvent; +import org.eclipse.aether.util.metadata.DefaultMetadata; /** * @author Benjamin Bentmann */ +@Named @Component( role = VersionResolver.class ) public class DefaultVersionResolver implements VersionResolver, Service @@ -84,8 +89,8 @@ public class DefaultVersionResolver private static final String SNAPSHOT = "SNAPSHOT"; @SuppressWarnings( "unused" ) - @Requirement - private Logger logger = NullLogger.INSTANCE; + @Requirement( role = LoggerFactory.class ) + private Logger logger = NullLoggerFactory.LOGGER; @Requirement private MetadataResolver metadataResolver; @@ -96,20 +101,41 @@ public class DefaultVersionResolver @Requirement private RepositoryEventDispatcher repositoryEventDispatcher; + public DefaultVersionResolver() + { + // enable no-arg constructor + } + + @Inject + DefaultVersionResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory, + RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory ) + { + setMetadataResolver( metadataResolver ); + setSyncContextFactory( syncContextFactory ); + setLoggerFactory( loggerFactory ); + setRepositoryEventDispatcher( repositoryEventDispatcher ); + } + public void initService( ServiceLocator locator ) { - setLogger( locator.getService( Logger.class ) ); + setLoggerFactory( locator.getService( LoggerFactory.class ) ); setMetadataResolver( locator.getService( MetadataResolver.class ) ); setSyncContextFactory( locator.getService( SyncContextFactory.class ) ); setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) ); } - public DefaultVersionResolver setLogger( Logger logger ) + public DefaultVersionResolver setLoggerFactory( LoggerFactory loggerFactory ) { - this.logger = ( logger != null ) ? logger : NullLogger.INSTANCE; + this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } + void setLogger( LoggerFactory loggerFactory ) + { + // plexus support + setLoggerFactory( loggerFactory ); + } + public DefaultVersionResolver setMetadataResolver( MetadataResolver metadataResolver ) { if ( metadataResolver == null ) @@ -153,7 +179,7 @@ public class DefaultVersionResolver Key cacheKey = null; RepositoryCache cache = session.getCache(); - if ( cache != null && !ConfigurationProperties.get( session, "aether.versionResolver.noCache", false ) ) + if ( cache != null && !ConfigUtils.getBoolean( session, false, "aether.versionResolver.noCache" ) ) { cacheKey = new Key( session, request ); @@ -355,7 +381,7 @@ public class DefaultVersionResolver } finally { - syncContext.release(); + syncContext.close(); } } } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/LocalSnapshotMetadata.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/LocalSnapshotMetadata.java index a084977abe..944f2ed5a4 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/LocalSnapshotMetadata.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/LocalSnapshotMetadata.java @@ -29,7 +29,7 @@ import org.apache.maven.artifact.repository.metadata.Metadata; import org.apache.maven.artifact.repository.metadata.Snapshot; import org.apache.maven.artifact.repository.metadata.SnapshotVersion; import org.apache.maven.artifact.repository.metadata.Versioning; -import org.sonatype.aether.artifact.Artifact; +import org.eclipse.aether.artifact.Artifact; /** * @author Benjamin Bentmann diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/LocalSnapshotMetadataGenerator.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/LocalSnapshotMetadataGenerator.java index 1d318cd4ff..ee7c10b0c4 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/LocalSnapshotMetadataGenerator.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/LocalSnapshotMetadataGenerator.java @@ -24,12 +24,12 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; -import org.sonatype.aether.ConfigurationProperties; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.impl.MetadataGenerator; -import org.sonatype.aether.installation.InstallRequest; -import org.sonatype.aether.metadata.Metadata; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.impl.MetadataGenerator; +import org.eclipse.aether.installation.InstallRequest; +import org.eclipse.aether.metadata.Metadata; +import org.eclipse.aether.util.ConfigUtils; /** * @author Benjamin Bentmann @@ -44,7 +44,7 @@ class LocalSnapshotMetadataGenerator public LocalSnapshotMetadataGenerator( RepositorySystemSession session, InstallRequest request ) { - legacyFormat = ConfigurationProperties.get( session.getConfigProperties(), "maven.metadata.legacy", false ); + legacyFormat = ConfigUtils.getBoolean( session.getConfigProperties(), false, "maven.metadata.legacy" ); snapshots = new LinkedHashMap(); } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java new file mode 100644 index 0000000000..0432cdb6d0 --- /dev/null +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java @@ -0,0 +1,55 @@ +package org.apache.maven.repository.internal; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import javax.inject.Named; +import javax.inject.Singleton; + +import org.apache.maven.model.building.DefaultModelBuilderFactory; +import org.apache.maven.model.building.ModelBuilder; +import org.eclipse.aether.impl.AetherModule; +import org.eclipse.aether.impl.ArtifactDescriptorReader; +import org.eclipse.aether.impl.MetadataGeneratorFactory; +import org.eclipse.aether.impl.VersionRangeResolver; +import org.eclipse.aether.impl.VersionResolver; + +import com.google.inject.AbstractModule; +import com.google.inject.Provides; +import com.google.inject.name.Names; + +public final class MavenAetherModule + extends AbstractModule +{ + + @Override + protected void configure() + { + install( new AetherModule() ); + bind( ArtifactDescriptorReader.class ) // + .to( DefaultArtifactDescriptorReader.class ).in( Singleton.class ); + bind( VersionResolver.class ) // + .to( DefaultVersionResolver.class ).in( Singleton.class ); + bind( VersionRangeResolver.class ) // + .to( DefaultVersionRangeResolver.class ).in( Singleton.class ); + bind( MetadataGeneratorFactory.class ).annotatedWith( Names.named( "snapshot" ) ) // + .to( SnapshotMetadataGeneratorFactory.class ).in( Singleton.class ); + bind( MetadataGeneratorFactory.class ).annotatedWith( Names.named( "versions" ) ) // + .to( VersionsMetadataGeneratorFactory.class ).in( Singleton.class ); + bind( ModelBuilder.class ) // + .toInstance( new DefaultModelBuilderFactory().newInstance() ); + } + + @Provides + @Singleton + Set provideMetadataGeneratorFactories( @Named( "snapshot" ) MetadataGeneratorFactory snapshot, + @Named( "versions" ) MetadataGeneratorFactory versions ) + { + Set factories = new HashSet(); + factories.add( snapshot ); + factories.add( versions ); + return Collections.unmodifiableSet( factories ); + } + +} diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java index 3db90e94fd..63f7bc4f0f 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java @@ -31,8 +31,8 @@ import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.WriterFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import org.sonatype.aether.RepositoryException; -import org.sonatype.aether.metadata.MergeableMetadata; +import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.metadata.MergeableMetadata; /** * @author Benjamin Bentmann diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemSession.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemSession.java deleted file mode 100644 index ffd24158b2..0000000000 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemSession.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.apache.maven.repository.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.sonatype.aether.collection.DependencyGraphTransformer; -import org.sonatype.aether.collection.DependencyManager; -import org.sonatype.aether.collection.DependencySelector; -import org.sonatype.aether.collection.DependencyTraverser; -import org.sonatype.aether.util.DefaultRepositorySystemSession; -import org.sonatype.aether.util.artifact.DefaultArtifactType; -import org.sonatype.aether.util.artifact.DefaultArtifactTypeRegistry; -import org.sonatype.aether.util.graph.manager.ClassicDependencyManager; -import org.sonatype.aether.util.graph.selector.AndDependencySelector; -import org.sonatype.aether.util.graph.selector.ExclusionDependencySelector; -import org.sonatype.aether.util.graph.selector.OptionalDependencySelector; -import org.sonatype.aether.util.graph.selector.ScopeDependencySelector; -import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer; -import org.sonatype.aether.util.graph.transformer.ConflictMarker; -import org.sonatype.aether.util.graph.transformer.JavaDependencyContextRefiner; -import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator; -import org.sonatype.aether.util.graph.transformer.NearestVersionConflictResolver; -import org.sonatype.aether.util.graph.traverser.FatArtifactTraverser; -import org.sonatype.aether.util.repository.DefaultAuthenticationSelector; -import org.sonatype.aether.util.repository.DefaultMirrorSelector; -import org.sonatype.aether.util.repository.DefaultProxySelector; - -/** - * A simplistic repository system session that mimics Maven's behavior to help third-party developers that want to embed - * Maven's dependency resolution into their own applications. Warning: This class is not intended for - * usage by Maven plugins, those should always acquire the current repository system session via parameter injection. - * - * @author Benjamin Bentmann - */ -public class MavenRepositorySystemSession - extends DefaultRepositorySystemSession -{ - - /** - * Creates a new Maven-like repository system session by initializing the session with values typical for - * Maven-based resolution. In more detail, this constructor configures settings relevant for the processing of - * dependency graphs, most other settings remain at their generic default value. Use the various setters to further - * configure the session with authentication, mirror, proxy and other information required for your environment. - */ - public MavenRepositorySystemSession() - { - setMirrorSelector( new DefaultMirrorSelector() ); - setAuthenticationSelector( new DefaultAuthenticationSelector() ); - setProxySelector( new DefaultProxySelector() ); - - DependencyTraverser depTraverser = new FatArtifactTraverser(); - setDependencyTraverser( depTraverser ); - - DependencyManager depManager = new ClassicDependencyManager(); - setDependencyManager( depManager ); - - DependencySelector depFilter = - new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ), - new OptionalDependencySelector(), new ExclusionDependencySelector() ); - setDependencySelector( depFilter ); - - DependencyGraphTransformer transformer = - new ChainedDependencyGraphTransformer( new ConflictMarker(), new JavaEffectiveScopeCalculator(), - new NearestVersionConflictResolver(), - new JavaDependencyContextRefiner() ); - setDependencyGraphTransformer( transformer ); - - DefaultArtifactTypeRegistry stereotypes = new DefaultArtifactTypeRegistry(); - stereotypes.add( new DefaultArtifactType( "pom" ) ); - stereotypes.add( new DefaultArtifactType( "maven-plugin", "jar", "", "java" ) ); - stereotypes.add( new DefaultArtifactType( "jar", "jar", "", "java" ) ); - stereotypes.add( new DefaultArtifactType( "ejb", "jar", "", "java" ) ); - stereotypes.add( new DefaultArtifactType( "ejb-client", "jar", "client", "java" ) ); - stereotypes.add( new DefaultArtifactType( "test-jar", "jar", "tests", "java" ) ); - stereotypes.add( new DefaultArtifactType( "javadoc", "jar", "javadoc", "java" ) ); - stereotypes.add( new DefaultArtifactType( "java-source", "jar", "sources", "java", false, false ) ); - stereotypes.add( new DefaultArtifactType( "war", "war", "", "java", false, true ) ); - stereotypes.add( new DefaultArtifactType( "ear", "ear", "", "java", false, true ) ); - stereotypes.add( new DefaultArtifactType( "rar", "rar", "", "java", false, true ) ); - stereotypes.add( new DefaultArtifactType( "par", "par", "", "java", false, true ) ); - setArtifactTypeRegistry( stereotypes ); - - setIgnoreInvalidArtifactDescriptor( true ); - setIgnoreMissingArtifactDescriptor( true ); - - setSystemProps( System.getProperties() ); - setConfigProps( System.getProperties() ); - } - -} diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java new file mode 100644 index 0000000000..de21c26654 --- /dev/null +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -0,0 +1,134 @@ +package org.apache.maven.repository.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 java.util.Properties; + +import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.collection.DependencyManager; +import org.eclipse.aether.collection.DependencySelector; +import org.eclipse.aether.collection.DependencyTraverser; +import org.eclipse.aether.impl.ArtifactDescriptorReader; +import org.eclipse.aether.impl.DefaultServiceLocator; +import org.eclipse.aether.impl.MetadataGeneratorFactory; +import org.eclipse.aether.impl.VersionRangeResolver; +import org.eclipse.aether.impl.VersionResolver; +import org.eclipse.aether.util.DefaultRepositorySystemSession; +import org.eclipse.aether.util.artifact.DefaultArtifactType; +import org.eclipse.aether.util.artifact.DefaultArtifactTypeRegistry; +import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.selector.AndDependencySelector; +import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; +import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; +import org.eclipse.aether.util.graph.selector.ScopeDependencySelector; +import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; +import org.eclipse.aether.util.graph.transformer.ConflictMarker; +import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; +import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator; +import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver; +import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; + +/** + * A utility class to assist in setting up a Maven-like repository system. Note: This component is meant to + * assist those clients that employ the repository system outside of an IoC container, Maven plugins should instead + * always use regular dependency injection to acquire the repository system. + * + * @author Benjamin Bentmann + */ +public final class MavenRepositorySystemUtils +{ + + private MavenRepositorySystemUtils() + { + // hide constructor + } + + /** + * Creates a new service locator that already knows about all service implementations included in this library. To + * acquire a complete repository system, clients need to add some repository connectors for remote transfers. + * + * @return The new service locator, never {@code null}. + */ + public static DefaultServiceLocator newServiceLocator() + { + DefaultServiceLocator locator = new DefaultServiceLocator(); + locator.addService( ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class ); + locator.addService( VersionResolver.class, DefaultVersionResolver.class ); + locator.addService( VersionRangeResolver.class, DefaultVersionRangeResolver.class ); + locator.addService( MetadataGeneratorFactory.class, SnapshotMetadataGeneratorFactory.class ); + locator.addService( MetadataGeneratorFactory.class, VersionsMetadataGeneratorFactory.class ); + return locator; + } + + /** + * Creates a new Maven-like repository system session by initializing the session with values typical for + * Maven-based resolution. In more detail, this method configures settings relevant for the processing of dependency + * graphs, most other settings remain at their generic default value. Use the various setters to further configure + * the session with authentication, mirror, proxy and other information required for your environment. + * + * @return The new repository system session, never {@code null}. + */ + public static DefaultRepositorySystemSession newSession() + { + DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); + + DependencyTraverser depTraverser = new FatArtifactTraverser(); + session.setDependencyTraverser( depTraverser ); + + DependencyManager depManager = new ClassicDependencyManager(); + session.setDependencyManager( depManager ); + + DependencySelector depFilter = + new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ), + new OptionalDependencySelector(), new ExclusionDependencySelector() ); + session.setDependencySelector( depFilter ); + + DependencyGraphTransformer transformer = + new ChainedDependencyGraphTransformer( new ConflictMarker(), new JavaEffectiveScopeCalculator(), + new NearestVersionConflictResolver(), + new JavaDependencyContextRefiner() ); + session.setDependencyGraphTransformer( transformer ); + + DefaultArtifactTypeRegistry stereotypes = new DefaultArtifactTypeRegistry(); + stereotypes.add( new DefaultArtifactType( "pom" ) ); + stereotypes.add( new DefaultArtifactType( "maven-plugin", "jar", "", "java" ) ); + stereotypes.add( new DefaultArtifactType( "jar", "jar", "", "java" ) ); + stereotypes.add( new DefaultArtifactType( "ejb", "jar", "", "java" ) ); + stereotypes.add( new DefaultArtifactType( "ejb-client", "jar", "client", "java" ) ); + stereotypes.add( new DefaultArtifactType( "test-jar", "jar", "tests", "java" ) ); + stereotypes.add( new DefaultArtifactType( "javadoc", "jar", "javadoc", "java" ) ); + stereotypes.add( new DefaultArtifactType( "java-source", "jar", "sources", "java", false, false ) ); + stereotypes.add( new DefaultArtifactType( "war", "war", "", "java", false, true ) ); + stereotypes.add( new DefaultArtifactType( "ear", "ear", "", "java", false, true ) ); + stereotypes.add( new DefaultArtifactType( "rar", "rar", "", "java", false, true ) ); + stereotypes.add( new DefaultArtifactType( "par", "par", "", "java", false, true ) ); + session.setArtifactTypeRegistry( stereotypes ); + + session.setIgnoreInvalidArtifactDescriptor( true ); + session.setIgnoreMissingArtifactDescriptor( true ); + + Properties sysProps = System.getProperties(); + session.setSystemProps( sysProps ); + session.setConfigProps( sysProps ); + + return session; + } + +} diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenServiceLocator.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenServiceLocator.java deleted file mode 100644 index db55665f24..0000000000 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenServiceLocator.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.apache.maven.repository.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.sonatype.aether.impl.ArtifactDescriptorReader; -import org.sonatype.aether.impl.internal.DefaultServiceLocator; -import org.sonatype.aether.impl.MetadataGeneratorFactory; -import org.sonatype.aether.impl.VersionRangeResolver; -import org.sonatype.aether.impl.VersionResolver; - -/** - * A simple service locator that is already setup with all components from this library. To acquire a complete - * repository system, clients need to add some repository connectors for remote transfers. Note: This component - * is meant to assist those clients that employ the repository systems outside of an IoC container, Maven plugins - * should instead always use regular dependency injection to acquire the repository system. - * - * @author Benjamin Bentmann - */ -public class MavenServiceLocator - extends DefaultServiceLocator -{ - - /** - * Creates a new service locator that already knows about all service implementations included in this library. - */ - public MavenServiceLocator() - { - addService( ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class ); - addService( VersionResolver.class, DefaultVersionResolver.class ); - addService( VersionRangeResolver.class, DefaultVersionRangeResolver.class ); - addService( MetadataGeneratorFactory.class, SnapshotMetadataGeneratorFactory.class ); - addService( MetadataGeneratorFactory.class, VersionsMetadataGeneratorFactory.class ); - } - -} diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java index 3acc3cb636..b05c5235d0 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java @@ -22,8 +22,8 @@ package org.apache.maven.repository.internal; import java.io.File; import java.util.Map; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.util.artifact.AbstractArtifact; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.util.artifact.AbstractArtifact; /** * @author Benjamin Bentmann diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadata.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadata.java index 4ce43938ac..c8c091ad32 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadata.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadata.java @@ -33,7 +33,7 @@ import org.apache.maven.artifact.repository.metadata.Metadata; import org.apache.maven.artifact.repository.metadata.Snapshot; import org.apache.maven.artifact.repository.metadata.SnapshotVersion; import org.apache.maven.artifact.repository.metadata.Versioning; -import org.sonatype.aether.artifact.Artifact; +import org.eclipse.aether.artifact.Artifact; /** * @author Benjamin Bentmann diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadataGenerator.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadataGenerator.java index d56eed8db2..6cbeec5505 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadataGenerator.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadataGenerator.java @@ -24,12 +24,12 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; -import org.sonatype.aether.ConfigurationProperties; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.deployment.DeployRequest; -import org.sonatype.aether.impl.MetadataGenerator; -import org.sonatype.aether.metadata.Metadata; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.deployment.DeployRequest; +import org.eclipse.aether.impl.MetadataGenerator; +import org.eclipse.aether.metadata.Metadata; +import org.eclipse.aether.util.ConfigUtils; /** * @author Benjamin Bentmann @@ -44,7 +44,7 @@ class RemoteSnapshotMetadataGenerator public RemoteSnapshotMetadataGenerator( RepositorySystemSession session, DeployRequest request ) { - legacyFormat = ConfigurationProperties.get( session.getConfigProperties(), "maven.metadata.legacy", false ); + legacyFormat = ConfigUtils.getBoolean( session.getConfigProperties(), false, "maven.metadata.legacy" ); snapshots = new LinkedHashMap(); diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java index 60e9c3e99c..79ffaade7d 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java @@ -20,11 +20,11 @@ package org.apache.maven.repository.internal; */ import org.codehaus.plexus.component.annotations.Component; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.deployment.DeployRequest; -import org.sonatype.aether.impl.MetadataGenerator; -import org.sonatype.aether.impl.MetadataGeneratorFactory; -import org.sonatype.aether.installation.InstallRequest; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.deployment.DeployRequest; +import org.eclipse.aether.impl.MetadataGenerator; +import org.eclipse.aether.impl.MetadataGeneratorFactory; +import org.eclipse.aether.installation.InstallRequest; /** * @author Benjamin Bentmann @@ -44,7 +44,7 @@ public class SnapshotMetadataGeneratorFactory return new RemoteSnapshotMetadataGenerator( session, request ); } - public int getPriority() + public float getPriority() { return 10; } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadata.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadata.java index 139e5f8c9c..e1be302d58 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadata.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadata.java @@ -26,8 +26,8 @@ import java.util.LinkedHashSet; import org.apache.maven.artifact.repository.metadata.Metadata; import org.apache.maven.artifact.repository.metadata.Versioning; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.util.artifact.ArtifactProperties; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.ArtifactProperties; /** * @author Benjamin Bentmann diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGenerator.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGenerator.java index db1c412810..e2f5e82d5b 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGenerator.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGenerator.java @@ -25,12 +25,12 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.deployment.DeployRequest; -import org.sonatype.aether.impl.MetadataGenerator; -import org.sonatype.aether.installation.InstallRequest; -import org.sonatype.aether.metadata.Metadata; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.deployment.DeployRequest; +import org.eclipse.aether.impl.MetadataGenerator; +import org.eclipse.aether.installation.InstallRequest; +import org.eclipse.aether.metadata.Metadata; /** * @author Benjamin Bentmann diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java index a1e986f5ba..47ef36012b 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java @@ -20,11 +20,11 @@ package org.apache.maven.repository.internal; */ import org.codehaus.plexus.component.annotations.Component; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.deployment.DeployRequest; -import org.sonatype.aether.impl.MetadataGenerator; -import org.sonatype.aether.impl.MetadataGeneratorFactory; -import org.sonatype.aether.installation.InstallRequest; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.deployment.DeployRequest; +import org.eclipse.aether.impl.MetadataGenerator; +import org.eclipse.aether.impl.MetadataGeneratorFactory; +import org.eclipse.aether.installation.InstallRequest; /** * @author Benjamin Bentmann @@ -44,7 +44,7 @@ public class VersionsMetadataGeneratorFactory return new VersionsMetadataGenerator( session, request ); } - public int getPriority() + public float getPriority() { return 5; } diff --git a/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/DefaultServiceLocatorTest.java b/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/MavenRepositorySystemUtilsTest.java similarity index 77% rename from maven-aether-provider/src/test/java/org/apache/maven/repository/internal/DefaultServiceLocatorTest.java rename to maven-aether-provider/src/test/java/org/apache/maven/repository/internal/MavenRepositorySystemUtilsTest.java index 064b6754da..768835a555 100644 --- a/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/DefaultServiceLocatorTest.java +++ b/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/MavenRepositorySystemUtilsTest.java @@ -19,26 +19,26 @@ package org.apache.maven.repository.internal; * under the License. */ -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.impl.MetadataGeneratorFactory; -import org.sonatype.aether.spi.locator.ServiceLocator; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.impl.MetadataGeneratorFactory; +import org.eclipse.aether.spi.locator.ServiceLocator; import junit.framework.TestCase; -public class DefaultServiceLocatorTest +public class MavenRepositorySystemUtilsTest extends TestCase { public void testGetRepositorySystem() { - ServiceLocator locator = new MavenServiceLocator(); + ServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator(); RepositorySystem repoSys = locator.getService( RepositorySystem.class ); assertNotNull( repoSys ); } public void testGetMetadataGeneratorFactories() { - ServiceLocator locator = new MavenServiceLocator(); + ServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator(); assertEquals( 2, locator.getServices( MetadataGeneratorFactory.class ).size() ); } diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index ad6a2a3a12..46f564be8b 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -72,7 +72,7 @@ test - org.sonatype.aether + org.eclipse.aether aether-connector-wagon test diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java b/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java index cc9e665d9e..3f3478d91d 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java @@ -37,15 +37,15 @@ import org.apache.maven.project.artifact.ProjectArtifactMetadata; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.AbstractLogEnabled; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.deployment.DeployRequest; -import org.sonatype.aether.deployment.DeployResult; -import org.sonatype.aether.deployment.DeploymentException; -import org.sonatype.aether.metadata.MergeableMetadata; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.util.DefaultRequestTrace; -import org.sonatype.aether.util.artifact.SubArtifact; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.deployment.DeployRequest; +import org.eclipse.aether.deployment.DeployResult; +import org.eclipse.aether.deployment.DeploymentException; +import org.eclipse.aether.metadata.MergeableMetadata; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.util.DefaultRequestTrace; +import org.eclipse.aether.util.artifact.SubArtifact; @Component( role = ArtifactDeployer.class, instantiationStrategy = "per-lookup" ) public class DefaultArtifactDeployer @@ -86,7 +86,7 @@ public class DefaultArtifactDeployer request.setTrace( DefaultRequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) ); - org.sonatype.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact ); + org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact ); mainArtifact = mainArtifact.setFile( source ); request.addArtifact( mainArtifact ); @@ -103,7 +103,7 @@ public class DefaultArtifactDeployer { if ( metadata instanceof ProjectArtifactMetadata ) { - org.sonatype.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" ); + org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); request.addArtifact( pomArtifact ); } diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java b/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java index d68a65c24d..cf31d2cd8d 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java @@ -36,12 +36,12 @@ import org.apache.maven.project.artifact.ProjectArtifactMetadata; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.AbstractLogEnabled; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.installation.InstallRequest; -import org.sonatype.aether.installation.InstallationException; -import org.sonatype.aether.util.DefaultRequestTrace; -import org.sonatype.aether.util.artifact.SubArtifact; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.installation.InstallRequest; +import org.eclipse.aether.installation.InstallationException; +import org.eclipse.aether.util.DefaultRequestTrace; +import org.eclipse.aether.util.artifact.SubArtifact; /** * @author Jason van Zyl @@ -79,7 +79,7 @@ public class DefaultArtifactInstaller request.setTrace( DefaultRequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) ); - org.sonatype.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact ); + org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact ); mainArtifact = mainArtifact.setFile( source ); request.addArtifact( mainArtifact ); @@ -87,7 +87,7 @@ public class DefaultArtifactInstaller { if ( metadata instanceof ProjectArtifactMetadata ) { - org.sonatype.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" ); + org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); request.addArtifact( pomArtifact ); } diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java b/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java index d24bf12bbd..658dbdac6e 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java @@ -28,7 +28,7 @@ import org.apache.maven.plugin.LegacySupport; import org.apache.maven.repository.RepositorySystem; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; /** * @author jdcasey diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java b/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java index a1fb1e8426..b3ae0280fc 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java @@ -26,8 +26,8 @@ import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.DefaultArtifactRepository; import org.apache.maven.artifact.repository.metadata.RepositoryMetadata; import org.codehaus.plexus.util.FileUtils; -import org.sonatype.aether.RepositoryException; -import org.sonatype.aether.metadata.MergeableMetadata; +import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.metadata.MergeableMetadata; /** * Warning: This is an internal utility class that is only public for technical reasons, it is not part 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 9c8364d461..d8b80fc19e 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 @@ -56,11 +56,11 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.logging.Logger; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.LocalRepositoryManager; -import org.sonatype.aether.resolution.ArtifactRequest; -import org.sonatype.aether.resolution.ArtifactResult; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.LocalRepositoryManager; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResult; /** * @author Jason van Zyl @@ -212,9 +212,9 @@ public class DefaultArtifactResolver result = repoSystem.resolveArtifact( session, artifactRequest ); } - catch ( org.sonatype.aether.resolution.ArtifactResolutionException e ) + catch ( org.eclipse.aether.resolution.ArtifactResolutionException e ) { - if ( e.getCause() instanceof org.sonatype.aether.transfer.ArtifactNotFoundException ) + if ( e.getCause() instanceof org.eclipse.aether.transfer.ArtifactNotFoundException ) { throw new ArtifactNotFoundException( e.getMessage(), artifact, remoteRepositories, e ); } diff --git a/maven-compat/src/main/java/org/apache/maven/project/ProjectUtils.java b/maven-compat/src/main/java/org/apache/maven/project/ProjectUtils.java index 75d1db038f..b70d3cffd5 100644 --- a/maven-compat/src/main/java/org/apache/maven/project/ProjectUtils.java +++ b/maven-compat/src/main/java/org/apache/maven/project/ProjectUtils.java @@ -32,7 +32,7 @@ import org.apache.maven.plugin.LegacySupport; import org.apache.maven.repository.RepositorySystem; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; // This class needs to stick around because it was exposed the the remote resources plugin started using it instead of // getting the repositories from the project. diff --git a/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java b/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java index 93b16017b4..366f8ce636 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java @@ -73,10 +73,10 @@ import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.AuthenticationSelector; -import org.sonatype.aether.repository.ProxySelector; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.AuthenticationSelector; +import org.eclipse.aether.repository.ProxySelector; +import org.eclipse.aether.repository.RemoteRepository; /** * @author Jason van Zyl @@ -478,7 +478,7 @@ public class LegacyRepositorySystem { if ( session != null ) { - org.sonatype.aether.repository.MirrorSelector selector = session.getMirrorSelector(); + org.eclipse.aether.repository.MirrorSelector selector = session.getMirrorSelector(); if ( selector != null ) { RemoteRepository repo = selector.getMirror( RepositoryUtils.toRepo( repository ) ); @@ -583,7 +583,7 @@ public class LegacyRepositorySystem AuthenticationSelector selector = session.getAuthenticationSelector(); if ( selector != null ) { - org.sonatype.aether.repository.Authentication auth = + org.eclipse.aether.repository.Authentication auth = selector.getAuthentication( RepositoryUtils.toRepo( repository ) ); if ( auth != null ) { @@ -688,7 +688,7 @@ public class LegacyRepositorySystem ProxySelector selector = session.getProxySelector(); if ( selector != null ) { - org.sonatype.aether.repository.Proxy proxy = selector.getProxy( RepositoryUtils.toRepo( repository ) ); + org.eclipse.aether.repository.Proxy proxy = selector.getProxy( RepositoryUtils.toRepo( repository ) ); if ( proxy != null ) { Proxy p = new Proxy(); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java index 6645257e8d..1a294b3bd3 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java @@ -36,26 +36,27 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; import org.apache.maven.execution.DefaultMavenExecutionRequest; import org.apache.maven.execution.DefaultMavenExecutionResult; import org.apache.maven.execution.MavenSession; +import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.collection.DependencyGraphTransformer; -import org.sonatype.aether.collection.DependencyManager; -import org.sonatype.aether.collection.DependencySelector; -import org.sonatype.aether.collection.DependencyTraverser; -import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.util.DefaultRepositorySystemSession; -import org.sonatype.aether.util.graph.manager.ClassicDependencyManager; -import org.sonatype.aether.util.graph.selector.AndDependencySelector; -import org.sonatype.aether.util.graph.selector.ExclusionDependencySelector; -import org.sonatype.aether.util.graph.selector.OptionalDependencySelector; -import org.sonatype.aether.util.graph.selector.ScopeDependencySelector; -import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer; -import org.sonatype.aether.util.graph.transformer.NearestVersionConflictResolver; -import org.sonatype.aether.util.graph.transformer.ConflictMarker; -import org.sonatype.aether.util.graph.transformer.JavaDependencyContextRefiner; -import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator; -import org.sonatype.aether.util.graph.traverser.FatArtifactTraverser; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.collection.DependencyManager; +import org.eclipse.aether.collection.DependencySelector; +import org.eclipse.aether.collection.DependencyTraverser; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.util.DefaultRepositorySystemSession; +import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.selector.AndDependencySelector; +import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; +import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; +import org.eclipse.aether.util.graph.selector.ScopeDependencySelector; +import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; +import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver; +import org.eclipse.aether.util.graph.transformer.ConflictMarker; +import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; +import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator; +import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; /** * @author Jason van Zyl @@ -66,7 +67,14 @@ public abstract class AbstractArtifactComponentTestCase protected ArtifactFactory artifactFactory; protected ArtifactRepositoryFactory artifactRepositoryFactory; - + + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + } + @Override protected void setUp() throws Exception @@ -350,7 +358,8 @@ public abstract class AbstractArtifactComponentTestCase new JavaDependencyContextRefiner() ); session.setDependencyGraphTransformer( transformer ); - session.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepository().getBasedir() ) ); + LocalRepository localRepo = new LocalRepository( localRepository().getBasedir() ); + session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( localRepo ) ); return session; } diff --git a/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java index b5ebedb9db..ec3c62d2c5 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java +++ b/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java @@ -27,8 +27,10 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; import org.apache.maven.model.building.ModelBuildingException; import org.apache.maven.model.building.ModelProblem; import org.apache.maven.repository.RepositorySystem; -import org.apache.maven.repository.internal.MavenRepositorySystemSession; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; +import org.eclipse.aether.util.DefaultRepositorySystemSession; /** * @author Jason van Zyl @@ -39,7 +41,14 @@ public abstract class AbstractMavenProjectTestCase protected ProjectBuilder projectBuilder; protected RepositorySystem repositorySystem; - + + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + } + protected void setUp() throws Exception { @@ -166,7 +175,7 @@ public abstract class AbstractMavenProjectTestCase protected void initRepoSession( ProjectBuildingRequest request ) { File localRepo = new File( request.getLocalRepository().getBasedir() ); - MavenRepositorySystemSession session = new MavenRepositorySystemSession(); + DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); session.setLocalRepositoryManager( new LegacyLocalRepositoryManager( localRepo ) ); request.setRepositorySession( session ); } diff --git a/maven-compat/src/test/java/org/apache/maven/project/ClasspathArtifactResolver.java b/maven-compat/src/test/java/org/apache/maven/project/ClasspathArtifactResolver.java index 84d8be274d..36eaee8f25 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/ClasspathArtifactResolver.java +++ b/maven-compat/src/test/java/org/apache/maven/project/ClasspathArtifactResolver.java @@ -26,13 +26,13 @@ import java.util.Collections; import java.util.List; import org.codehaus.plexus.component.annotations.Component; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.impl.ArtifactResolver; -import org.sonatype.aether.resolution.ArtifactRequest; -import org.sonatype.aether.resolution.ArtifactResolutionException; -import org.sonatype.aether.resolution.ArtifactResult; -import org.sonatype.aether.transfer.ArtifactNotFoundException; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.impl.ArtifactResolver; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResolutionException; +import org.eclipse.aether.resolution.ArtifactResult; +import org.eclipse.aether.transfer.ArtifactNotFoundException; /** * @author Benjamin Bentmann diff --git a/maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java b/maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java index daab6c4f8e..35bbc2c27c 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java +++ b/maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java @@ -21,22 +21,36 @@ package org.apache.maven.project; import java.io.File; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; -import org.sonatype.aether.repository.LocalArtifactRequest; -import org.sonatype.aether.repository.LocalArtifactResult; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.metadata.Metadata; +import org.eclipse.aether.repository.LocalArtifactRegistration; +import org.eclipse.aether.repository.LocalArtifactRequest; +import org.eclipse.aether.repository.LocalArtifactResult; +import org.eclipse.aether.repository.LocalMetadataRegistration; +import org.eclipse.aether.repository.LocalMetadataRequest; +import org.eclipse.aether.repository.LocalMetadataResult; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.LocalRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; /** * @author Benjamin Bentmann */ public class LegacyLocalRepositoryManager - extends SimpleLocalRepositoryManager + implements LocalRepositoryManager { + private final LocalRepository repository; + public LegacyLocalRepositoryManager( File basedir ) { - super( basedir ); + this.repository = new LocalRepository( basedir.getAbsoluteFile(), "legacy" ); + } + + public LocalRepository getRepository() + { + return repository; } public String getPathForLocalArtifact( Artifact artifact ) @@ -59,17 +73,121 @@ public class LegacyLocalRepositoryManager return path.toString(); } + public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) + { + return getPathForLocalArtifact( artifact ); + } + + public String getPathForLocalMetadata( Metadata metadata ) + { + return getPath( metadata, "local" ); + } + + public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) + { + return getPath( metadata, getRepositoryKey( repository, context ) ); + } + + String getRepositoryKey( RemoteRepository repository, String context ) + { + return repository.getId(); + } + + private String getPath( Metadata metadata, String repositoryKey ) + { + StringBuilder path = new StringBuilder( 128 ); + + if ( metadata.getGroupId().length() > 0 ) + { + path.append( metadata.getGroupId().replace( '.', '/' ) ).append( '/' ); + + if ( metadata.getArtifactId().length() > 0 ) + { + path.append( metadata.getArtifactId() ).append( '/' ); + + if ( metadata.getVersion().length() > 0 ) + { + path.append( metadata.getVersion() ).append( '/' ); + } + } + } + + path.append( insertRepositoryKey( metadata.getType(), repositoryKey ) ); + + return path.toString(); + } + + private String insertRepositoryKey( String filename, String repositoryKey ) + { + String result; + int idx = filename.indexOf( '.' ); + if ( idx < 0 ) + { + result = filename + '-' + repositoryKey; + } + else + { + result = filename.substring( 0, idx ) + '-' + repositoryKey + filename.substring( idx ); + } + return result; + } + public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) { - String path = getPathForLocalArtifact( request.getArtifact() ); - File file = new File( getRepository().getBasedir(), path ); + String path = getPathForLocalArtifact( request.getArtifact() ); + File file = new File( getRepository().getBasedir(), path ); + LocalArtifactResult result = new LocalArtifactResult( request ); - if ( file.isFile() ) + if ( file.isFile() ) { - result.setFile( file ); - result.setAvailable( true ); - } - return result; - } + result.setFile( file ); + result.setAvailable( true ); + } + + return result; + } + + public void add( RepositorySystemSession session, LocalArtifactRegistration request ) + { + // noop + } + + public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) + { + LocalMetadataResult result = new LocalMetadataResult( request ); + + String path; + + Metadata metadata = request.getMetadata(); + String context = request.getContext(); + RemoteRepository remote = request.getRepository(); + + if ( remote != null ) + { + path = getPathForRemoteMetadata( metadata, remote, context ); + } + else + { + path = getPathForLocalMetadata( metadata ); + } + + File file = new File( getRepository().getBasedir(), path ); + if ( file.isFile() ) + { + result.setFile( file ); + } + + return result; + } + + public void add( RepositorySystemSession session, LocalMetadataRegistration request ) + { + // noop + } + + public String toString() + { + return String.valueOf( getRepository() ); + } } diff --git a/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java b/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java index b84733c1d6..01a128b5ae 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java @@ -25,8 +25,8 @@ import java.util.Iterator; import org.apache.maven.artifact.Artifact; import org.apache.maven.repository.RepositorySystem; import org.apache.maven.repository.internal.DefaultArtifactDescriptorReader; -import org.sonatype.aether.impl.ArtifactDescriptorReader; -import org.sonatype.aether.impl.ArtifactResolver; +import org.eclipse.aether.impl.ArtifactDescriptorReader; +import org.eclipse.aether.impl.ArtifactResolver; public class ProjectClasspathTest extends AbstractMavenProjectTestCase diff --git a/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java b/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java index 64f359cecc..79c18b9800 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java @@ -32,9 +32,11 @@ import org.apache.maven.model.Repository; import org.apache.maven.model.RepositoryPolicy; import org.apache.maven.plugin.LegacySupport; import org.apache.maven.repository.RepositorySystem; +import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; -import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; -import org.sonatype.aether.util.DefaultRepositorySystemSession; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.util.DefaultRepositorySystemSession; /** * Tests {@link LegacyRepositorySystem}. @@ -47,7 +49,14 @@ public class LegacyRepositorySystemTest private RepositorySystem repositorySystem; private ResolutionErrorHandler resolutionErrorHandler; - + + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + } + @Override protected void setUp() throws Exception @@ -114,7 +123,8 @@ public class LegacyRepositorySystemTest .setLocalRepository( getLocalRepository() ); DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); - session.setLocalRepositoryManager( new SimpleLocalRepositoryManager( request.getLocalRepository().getBasedir() ) ); + LocalRepository localRepo = new LocalRepository( request.getLocalRepository().getBasedir() ); + session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( localRepo ) ); LegacySupport legacySupport = lookup( LegacySupport.class ); legacySupport.setSession( new MavenSession( getContainer(), session, new DefaultMavenExecutionRequest(), new DefaultMavenExecutionResult() ) ); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/LegacyRepositorySystemTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/LegacyRepositorySystemTest.java index a56b5462a6..98340be753 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/LegacyRepositorySystemTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/LegacyRepositorySystemTest.java @@ -22,6 +22,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.Authentication; import org.apache.maven.repository.RepositorySystem; import org.apache.maven.settings.Server; +import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; /** @@ -34,6 +35,13 @@ public class LegacyRepositorySystemTest { private RepositorySystem repositorySystem; + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + } + @Override protected void setUp() throws Exception diff --git a/maven-compat/src/test/resources/org/apache/maven/artifact/resolver/ArtifactResolverTest.xml b/maven-compat/src/test/resources/org/apache/maven/artifact/resolver/ArtifactResolverTest.xml index 2666d8dcca..2b950859de 100644 --- a/maven-compat/src/test/resources/org/apache/maven/artifact/resolver/ArtifactResolverTest.xml +++ b/maven-compat/src/test/resources/org/apache/maven/artifact/resolver/ArtifactResolverTest.xml @@ -61,7 +61,7 @@ under the License. legacySupport - org.sonatype.aether.RepositorySystem + org.eclipse.aether.RepositorySystem default repoSystem diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 429d633a17..de444d92ee 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -59,17 +59,17 @@ maven-aether-provider - org.sonatype.aether + org.eclipse.aether aether-impl ${aetherVersion} - org.sonatype.aether + org.eclipse.aether aether-api ${aetherVersion} - org.sonatype.aether + org.eclipse.aether aether-util ${aetherVersion} 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 cd944a8d0f..dcc32e7f0e 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -75,33 +75,33 @@ import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.dag.CycleDetectedException; import org.codehaus.plexus.util.xml.Xpp3Dom; -import org.sonatype.aether.ConfigurationProperties; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.collection.DependencyGraphTransformer; -import org.sonatype.aether.collection.DependencyManager; -import org.sonatype.aether.collection.DependencySelector; -import org.sonatype.aether.collection.DependencyTraverser; -import org.sonatype.aether.repository.Authentication; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.repository.RepositoryPolicy; -import org.sonatype.aether.repository.WorkspaceReader; -import org.sonatype.aether.util.DefaultRepositorySystemSession; -import org.sonatype.aether.util.graph.manager.ClassicDependencyManager; -import org.sonatype.aether.util.graph.selector.AndDependencySelector; -import org.sonatype.aether.util.graph.selector.ExclusionDependencySelector; -import org.sonatype.aether.util.graph.selector.OptionalDependencySelector; -import org.sonatype.aether.util.graph.selector.ScopeDependencySelector; -import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer; -import org.sonatype.aether.util.graph.transformer.NearestVersionConflictResolver; -import org.sonatype.aether.util.graph.transformer.ConflictMarker; -import org.sonatype.aether.util.graph.transformer.JavaDependencyContextRefiner; -import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator; -import org.sonatype.aether.util.graph.traverser.FatArtifactTraverser; -import org.sonatype.aether.util.repository.ChainedWorkspaceReader; -import org.sonatype.aether.util.repository.DefaultAuthenticationSelector; -import org.sonatype.aether.util.repository.DefaultMirrorSelector; -import org.sonatype.aether.util.repository.DefaultProxySelector; +import org.eclipse.aether.ConfigurationProperties; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.collection.DependencyManager; +import org.eclipse.aether.collection.DependencySelector; +import org.eclipse.aether.collection.DependencyTraverser; +import org.eclipse.aether.repository.Authentication; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.util.DefaultRepositorySystemSession; +import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.selector.AndDependencySelector; +import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; +import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; +import org.eclipse.aether.util.graph.selector.ScopeDependencySelector; +import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; +import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver; +import org.eclipse.aether.util.graph.transformer.ConflictMarker; +import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; +import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator; +import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; +import org.eclipse.aether.util.repository.ChainedWorkspaceReader; +import org.eclipse.aether.util.repository.DefaultAuthenticationSelector; +import org.eclipse.aether.util.repository.DefaultMirrorSelector; +import org.eclipse.aether.util.repository.DefaultProxySelector; /** * @author Jason van Zyl @@ -400,7 +400,7 @@ public class DefaultMaven for ( Proxy proxy : decrypted.getProxies() ) { Authentication proxyAuth = new Authentication( proxy.getUsername(), proxy.getPassword() ); - proxySelector.add( new org.sonatype.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), + proxySelector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), proxyAuth ), proxy.getNonProxyHosts() ); } session.setProxySelector( proxySelector ); diff --git a/maven-core/src/main/java/org/apache/maven/LoggingRepositoryListener.java b/maven-core/src/main/java/org/apache/maven/LoggingRepositoryListener.java index 8e46525fcb..d176b9d74d 100644 --- a/maven-core/src/main/java/org/apache/maven/LoggingRepositoryListener.java +++ b/maven-core/src/main/java/org/apache/maven/LoggingRepositoryListener.java @@ -22,9 +22,9 @@ package org.apache.maven; import java.io.FileNotFoundException; import org.codehaus.plexus.logging.Logger; -import org.sonatype.aether.AbstractRepositoryListener; -import org.sonatype.aether.RepositoryEvent; -import org.sonatype.aether.transfer.MetadataNotFoundException; +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.transfer.MetadataNotFoundException; /** * @author Benjamin Bentmann 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 9afe864765..be1efb3399 100644 --- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java +++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java @@ -21,9 +21,9 @@ package org.apache.maven; import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.project.MavenProject; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.repository.WorkspaceReader; -import org.sonatype.aether.repository.WorkspaceRepository; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.repository.WorkspaceRepository; import java.io.File; import java.util.ArrayList; diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java index f5e36c0f22..0977018db2 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -30,20 +30,20 @@ import org.apache.maven.artifact.handler.DefaultArtifactHandler; import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.artifact.ArtifactType; -import org.sonatype.aether.artifact.ArtifactTypeRegistry; -import org.sonatype.aether.graph.Dependency; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.graph.Exclusion; -import org.sonatype.aether.repository.Authentication; -import org.sonatype.aether.repository.Proxy; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.RepositoryPolicy; -import org.sonatype.aether.util.artifact.ArtifactProperties; -import org.sonatype.aether.util.artifact.DefaultArtifact; -import org.sonatype.aether.util.artifact.DefaultArtifactType; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.ArtifactProperties; +import org.eclipse.aether.artifact.ArtifactType; +import org.eclipse.aether.artifact.ArtifactTypeRegistry; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.graph.Exclusion; +import org.eclipse.aether.repository.Authentication; +import org.eclipse.aether.repository.Proxy; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.util.artifact.DefaultArtifact; +import org.eclipse.aether.util.artifact.DefaultArtifactType; /** * Warning: This is an internal utility class that is only public for technical reasons, it is not part diff --git a/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java b/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java index d77f593547..937712ae65 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java +++ b/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java @@ -29,21 +29,20 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException; import org.apache.maven.repository.Proxy; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.metadata.Metadata; -import org.sonatype.aether.repository.LocalArtifactRegistration; -import org.sonatype.aether.repository.LocalArtifactRequest; -import org.sonatype.aether.repository.LocalArtifactResult; -import org.sonatype.aether.repository.LocalMetadataRegistration; -import org.sonatype.aether.repository.LocalMetadataRequest; -import org.sonatype.aether.repository.LocalMetadataResult; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.repository.LocalRepositoryManager; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.util.DefaultRepositorySystemSession; -import org.sonatype.aether.util.FilterRepositorySystemSession; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.metadata.Metadata; +import org.eclipse.aether.repository.LocalArtifactRegistration; +import org.eclipse.aether.repository.LocalArtifactRequest; +import org.eclipse.aether.repository.LocalArtifactResult; +import org.eclipse.aether.repository.LocalMetadataRegistration; +import org.eclipse.aether.repository.LocalMetadataRequest; +import org.eclipse.aether.repository.LocalMetadataResult; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.LocalRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.util.DefaultRepositorySystemSession; /** * Warning: This is an internal utility class that is only public for technical reasons, it is not part @@ -84,14 +83,7 @@ public class LegacyLocalRepositoryManager final LocalRepositoryManager llrm = new LegacyLocalRepositoryManager( repository ); - return new FilterRepositorySystemSession( session ) - { - @Override - public LocalRepositoryManager getLocalRepositoryManager() - { - return llrm; - } - }; + return new DefaultRepositorySystemSession( session ).setLocalRepositoryManager( llrm ); } private LegacyLocalRepositoryManager( ArtifactRepository delegate ) diff --git a/maven-core/src/main/java/org/apache/maven/classrealm/ArtifactClassRealmConstituent.java b/maven-core/src/main/java/org/apache/maven/classrealm/ArtifactClassRealmConstituent.java index e79fa9d20d..562d6f4748 100644 --- a/maven-core/src/main/java/org/apache/maven/classrealm/ArtifactClassRealmConstituent.java +++ b/maven-core/src/main/java/org/apache/maven/classrealm/ArtifactClassRealmConstituent.java @@ -21,7 +21,7 @@ package org.apache.maven.classrealm; import java.io.File; -import org.sonatype.aether.artifact.Artifact; +import org.eclipse.aether.artifact.Artifact; /** * @author Benjamin Bentmann diff --git a/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManager.java b/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManager.java index fe43b52ef3..a09f1b092f 100644 --- a/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManager.java +++ b/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManager.java @@ -25,7 +25,7 @@ import java.util.Map; import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; import org.codehaus.plexus.classworlds.realm.ClassRealm; -import org.sonatype.aether.artifact.Artifact; +import org.eclipse.aether.artifact.Artifact; /** * Manages the class realms used by Maven. Warning: This is an internal utility interface that is only diff --git a/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java b/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java index 2ddbd45c68..da8c21043f 100644 --- a/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java +++ b/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java @@ -45,7 +45,7 @@ import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; -import org.sonatype.aether.artifact.Artifact; +import org.eclipse.aether.artifact.Artifact; /** * Manages the class realms used by Maven. Warning: This is an internal utility class that is only @@ -163,19 +163,19 @@ public class DefaultClassRealmManager imports.put( "org.apache.maven.wagon.resource", coreRealm ); // aether-api, aether-spi, aether-impl - imports.put( "org.sonatype.aether.*", coreRealm ); - imports.put( "org.sonatype.aether.artifact", coreRealm ); - imports.put( "org.sonatype.aether.collection", coreRealm ); - imports.put( "org.sonatype.aether.deployment", coreRealm ); - imports.put( "org.sonatype.aether.graph", coreRealm ); - imports.put( "org.sonatype.aether.impl", coreRealm ); - imports.put( "org.sonatype.aether.installation", coreRealm ); - imports.put( "org.sonatype.aether.metadata", coreRealm ); - imports.put( "org.sonatype.aether.repository", coreRealm ); - imports.put( "org.sonatype.aether.resolution", coreRealm ); - imports.put( "org.sonatype.aether.spi", coreRealm ); - imports.put( "org.sonatype.aether.transfer", coreRealm ); - imports.put( "org.sonatype.aether.version", coreRealm ); + imports.put( "org.eclipse.aether.*", coreRealm ); + imports.put( "org.eclipse.aether.artifact", coreRealm ); + imports.put( "org.eclipse.aether.collection", coreRealm ); + imports.put( "org.eclipse.aether.deployment", coreRealm ); + imports.put( "org.eclipse.aether.graph", coreRealm ); + imports.put( "org.eclipse.aether.impl", coreRealm ); + imports.put( "org.eclipse.aether.installation", coreRealm ); + imports.put( "org.eclipse.aether.metadata", coreRealm ); + imports.put( "org.eclipse.aether.repository", coreRealm ); + imports.put( "org.eclipse.aether.resolution", coreRealm ); + imports.put( "org.eclipse.aether.spi", coreRealm ); + imports.put( "org.eclipse.aether.transfer", coreRealm ); + imports.put( "org.eclipse.aether.version", coreRealm ); // plexus-classworlds imports.put( "org.codehaus.plexus.classworlds", coreRealm ); diff --git a/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java b/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java index eea83214d4..5555ee2cb5 100644 --- a/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java +++ b/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java @@ -62,7 +62,7 @@ public interface EventSpy * @see org.apache.maven.project.DependencyResolutionRequest * @see org.apache.maven.project.DependencyResolutionResultt * @see org.apache.maven.execution.ExecutionEvent - * @see org.sonatype.aether.RepositoryEvent + * @see org.eclipse.aether.RepositoryEvent */ void onEvent( Object event ) throws Exception; diff --git a/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java b/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java index e527336faa..2a16779535 100644 --- a/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java +++ b/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java @@ -27,7 +27,7 @@ import org.apache.maven.execution.ExecutionListener; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; -import org.sonatype.aether.RepositoryListener; +import org.eclipse.aether.RepositoryListener; /** * Dispatches callbacks to all registered eventspies. diff --git a/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java b/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java index f7df6f80ee..1ebf759cb4 100644 --- a/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java +++ b/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java @@ -19,9 +19,9 @@ package org.apache.maven.eventspy.internal; * under the License. */ -import org.sonatype.aether.AbstractRepositoryListener; -import org.sonatype.aether.RepositoryEvent; -import org.sonatype.aether.RepositoryListener; +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RepositoryListener; /** * Forwards repository events to eventspies. diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java index 78436be6b5..7381ac394d 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java @@ -32,10 +32,10 @@ import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.settings.Mirror; import org.apache.maven.settings.Proxy; import org.apache.maven.settings.Server; -import org.sonatype.aether.RepositoryCache; -import org.sonatype.aether.repository.WorkspaceReader; -import org.sonatype.aether.transfer.TransferListener; -import org.sonatype.aether.util.DefaultRepositoryCache; +import org.eclipse.aether.RepositoryCache; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.transfer.TransferListener; +import org.eclipse.aether.util.DefaultRepositoryCache; /** * @author Jason van Zyl diff --git a/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java b/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java index ef91ccf59a..91e6c9cda1 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java @@ -32,9 +32,9 @@ import org.apache.maven.settings.Mirror; import org.apache.maven.settings.Proxy; import org.apache.maven.settings.Server; import org.codehaus.plexus.logging.Logger; -import org.sonatype.aether.RepositoryCache; -import org.sonatype.aether.repository.WorkspaceReader; -import org.sonatype.aether.transfer.TransferListener; +import org.eclipse.aether.RepositoryCache; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.transfer.TransferListener; /** * @author Jason van Zyl diff --git a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java index 9975151e1a..a3e6658a10 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java +++ b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java @@ -36,7 +36,7 @@ import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.settings.Settings; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; /** * @author Jason van Zyl diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java index 32c9ab7eb8..c3b34b50dc 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java @@ -31,11 +31,11 @@ import org.apache.maven.project.artifact.InvalidDependencyVersionException; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; -import org.sonatype.aether.graph.Dependency; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.util.filter.AndDependencyFilter; -import org.sonatype.aether.util.filter.ScopeDependencyFilter; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.util.filter.AndDependencyFilter; +import org.eclipse.aether.util.filter.ScopeDependencyFilter; import java.util.*; @@ -228,7 +228,7 @@ public class LifecycleDependencyResolver for ( Dependency dependency : dependencies ) { - org.sonatype.aether.artifact.Artifact a = dependency.getArtifact(); + org.eclipse.aether.artifact.Artifact a = dependency.getArtifact(); String key = ArtifactUtils.key( a.getGroupId(), a.getArtifactId(), a.getVersion() ); if ( !projectKeys.contains( key ) ) { @@ -310,7 +310,7 @@ public class LifecycleDependencyResolver Dependency dependency = node.getDependency(); if ( dependency != null ) { - org.sonatype.aether.artifact.Artifact a = dependency.getArtifact(); + org.eclipse.aether.artifact.Artifact a = dependency.getArtifact(); String key = ArtifactUtils.key( a.getGroupId(), a.getArtifactId(), a.getVersion() ); return !keys.contains( key ); } diff --git a/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java index 48eed40bde..b079f6be48 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java @@ -22,8 +22,8 @@ import org.apache.maven.model.Plugin; import org.apache.maven.plugin.descriptor.MojoDescriptor; import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.codehaus.plexus.classworlds.realm.ClassRealm; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; /** * @author Jason van Zyl diff --git a/maven-core/src/main/java/org/apache/maven/plugin/CacheUtils.java b/maven-core/src/main/java/org/apache/maven/plugin/CacheUtils.java index ec8c4af77d..cbe1cb01d4 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/CacheUtils.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/CacheUtils.java @@ -25,11 +25,11 @@ import java.util.List; import org.apache.maven.model.Dependency; import org.apache.maven.model.Exclusion; import org.apache.maven.model.Plugin; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.RepositoryPolicy; -import org.sonatype.aether.repository.WorkspaceReader; -import org.sonatype.aether.repository.WorkspaceRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.repository.WorkspaceRepository; /** * @author Benjamin Bentmann diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java index 3ae2c58cc5..af96b6d71a 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java @@ -27,8 +27,8 @@ import org.apache.maven.project.MavenProject; import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; // TODO: the antrun plugin has its own configurator, the only plugin that does. might need to think about how that works // TODO: remove the coreArtifactFilterManager diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java index 6348b738ee..bc10223162 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java @@ -29,7 +29,7 @@ import org.apache.maven.project.ExtensionDescriptor; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.component.annotations.Component; -import org.sonatype.aether.artifact.Artifact; +import org.eclipse.aether.artifact.Artifact; /** * Default extension realm cache implementation. Assumes cached data does not change. diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java index cc2d7bf545..145482d85a 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java @@ -28,12 +28,12 @@ import java.util.Map; import org.apache.maven.model.Plugin; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.annotations.Component; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.WorkspaceRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceRepository; /** * @author Igor Fedorenko diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java index 8bb69095e9..4242a32260 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java @@ -30,10 +30,10 @@ import org.apache.maven.plugin.descriptor.MojoDescriptor; import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.repository.ComponentDescriptor; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.WorkspaceRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceRepository; /** * Caches raw plugin descriptors. A raw plugin descriptor is a descriptor that has just been extracted from the plugin diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java index 896236741e..8438ba6b99 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java @@ -30,11 +30,11 @@ import org.apache.maven.model.Plugin; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.component.annotations.Component; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.WorkspaceRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceRepository; /** * Default PluginCache implementation. Assumes cached data does not change. diff --git a/maven-core/src/main/java/org/apache/maven/plugin/ExtensionRealmCache.java b/maven-core/src/main/java/org/apache/maven/plugin/ExtensionRealmCache.java index 6a0da57cf6..cf5db3e4f1 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/ExtensionRealmCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/ExtensionRealmCache.java @@ -24,7 +24,7 @@ import java.util.List; import org.apache.maven.project.ExtensionDescriptor; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.classworlds.realm.ClassRealm; -import org.sonatype.aether.artifact.Artifact; +import org.eclipse.aether.artifact.Artifact; /** * Caches extension class realms. Warning: This is an internal utility interface that is only public diff --git a/maven-core/src/main/java/org/apache/maven/plugin/LegacySupport.java b/maven-core/src/main/java/org/apache/maven/plugin/LegacySupport.java index cdbc83db95..eef9b4f3ea 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/LegacySupport.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/LegacySupport.java @@ -20,7 +20,7 @@ package org.apache.maven.plugin; */ import org.apache.maven.execution.MavenSession; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; /** * Helps to provide backward-compatibility with plugins that use legacy components. Warning: This is an diff --git a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java index 18ca9c9ab0..e62cb9b534 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java @@ -25,9 +25,9 @@ import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.descriptor.MojoDescriptor; import org.apache.maven.plugin.descriptor.PluginDescriptor; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.RemoteRepository; /** * Provides basic services to manage Maven plugins and their mojos. This component is kept general in its design such diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginArtifactsCache.java index 37d9aeee80..df07d4cd93 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginArtifactsCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginArtifactsCache.java @@ -23,10 +23,10 @@ import java.util.List; import org.apache.maven.model.Plugin; import org.apache.maven.project.MavenProject; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.RemoteRepository; /** * Caches plugin artifacts. Warning: This is an internal utility interface that is only public for diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorCache.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorCache.java index 6b9bf750b3..4b4f368905 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorCache.java @@ -23,8 +23,8 @@ import java.util.List; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.descriptor.PluginDescriptor; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; /** * Caches raw plugin descriptors. A raw plugin descriptor is a descriptor that has just been extracted from the plugin diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginRealmCache.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginRealmCache.java index 684208186e..7c04ed5bb6 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginRealmCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginRealmCache.java @@ -26,9 +26,9 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.model.Plugin; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.classworlds.realm.ClassRealm; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.RemoteRepository; /** * Caches plugin class realms. Warning: This is an internal utility interface that is only public for diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java index aea096316e..ead0f212ea 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java @@ -22,7 +22,7 @@ package org.apache.maven.plugin.internal; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.LegacySupport; import org.codehaus.plexus.component.annotations.Component; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; /** * Helps to provide backward-compatibility with plugins that use legacy components. Warning: This is an diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java index 603e670403..8184b8608c 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java @@ -87,12 +87,12 @@ import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.Xpp3Dom; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.util.filter.AndDependencyFilter; -import org.sonatype.aether.util.graph.PreorderNodeListGenerator; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.util.filter.AndDependencyFilter; +import org.eclipse.aether.util.graph.PreorderNodeListGenerator; /** * Provides basic services to manage Maven plugins and their mojos. This component is kept general in its design such @@ -139,7 +139,7 @@ public class DefaultMavenPluginManager if ( pluginDescriptor == null ) { - org.sonatype.aether.artifact.Artifact artifact = + org.eclipse.aether.artifact.Artifact artifact = pluginDependenciesResolver.resolve( plugin, repositories, session ); Artifact pluginArtifact = RepositoryUtils.toArtifact( artifact ); @@ -369,7 +369,7 @@ public class DefaultMavenPluginManager } } - List pluginArtifacts = nlg.getArtifacts( true ); + List pluginArtifacts = nlg.getArtifacts( true ); ClassRealm pluginRealm = classRealmManager.createPluginRealm( plugin, parent, null, foreignImports, pluginArtifacts ); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java index bfc6fae060..c90634a332 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java @@ -31,35 +31,34 @@ import org.apache.maven.plugin.PluginResolutionException; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.collection.CollectRequest; -import org.sonatype.aether.collection.DependencyCollectionException; -import org.sonatype.aether.collection.DependencyGraphTransformer; -import org.sonatype.aether.collection.DependencySelector; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.graph.DependencyVisitor; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.resolution.ArtifactDescriptorException; -import org.sonatype.aether.resolution.ArtifactDescriptorRequest; -import org.sonatype.aether.resolution.ArtifactDescriptorResult; -import org.sonatype.aether.resolution.ArtifactRequest; -import org.sonatype.aether.resolution.ArtifactResolutionException; -import org.sonatype.aether.resolution.DependencyRequest; -import org.sonatype.aether.resolution.DependencyResolutionException; -import org.sonatype.aether.util.DefaultRepositorySystemSession; -import org.sonatype.aether.util.DefaultRequestTrace; -import org.sonatype.aether.util.FilterRepositorySystemSession; -import org.sonatype.aether.util.artifact.DefaultArtifact; -import org.sonatype.aether.util.artifact.JavaScopes; -import org.sonatype.aether.util.filter.AndDependencyFilter; -import org.sonatype.aether.util.filter.ExclusionsDependencyFilter; -import org.sonatype.aether.util.filter.ScopeDependencyFilter; -import org.sonatype.aether.util.graph.selector.AndDependencySelector; -import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.CollectRequest; +import org.eclipse.aether.collection.DependencyCollectionException; +import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.collection.DependencySelector; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.graph.DependencyVisitor; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.ArtifactDescriptorException; +import org.eclipse.aether.resolution.ArtifactDescriptorRequest; +import org.eclipse.aether.resolution.ArtifactDescriptorResult; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResolutionException; +import org.eclipse.aether.resolution.DependencyRequest; +import org.eclipse.aether.resolution.DependencyResolutionException; +import org.eclipse.aether.util.DefaultRepositorySystemSession; +import org.eclipse.aether.util.DefaultRequestTrace; +import org.eclipse.aether.util.artifact.DefaultArtifact; +import org.eclipse.aether.util.artifact.JavaScopes; +import org.eclipse.aether.util.filter.AndDependencyFilter; +import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; +import org.eclipse.aether.util.filter.ScopeDependencyFilter; +import org.eclipse.aether.util.graph.selector.AndDependencySelector; +import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; /** * Assists in resolving the dependencies of a plugin. Warning: This is an internal utility class that @@ -100,14 +99,8 @@ public class DefaultPluginDependenciesResolver try { - RepositorySystemSession pluginSession = new FilterRepositorySystemSession( session ) - { - @Override - public boolean isIgnoreMissingArtifactDescriptor() - { - return false; - } - }; + RepositorySystemSession pluginSession = + new DefaultRepositorySystemSession( session ).setIgnoreMissingArtifactDescriptor( true ); ArtifactDescriptorRequest request = new ArtifactDescriptorRequest( pluginArtifact, repositories, REPOSITORY_CONTEXT ); @@ -179,10 +172,10 @@ public class DefaultPluginDependenciesResolver CollectRequest request = new CollectRequest(); request.setRequestContext( REPOSITORY_CONTEXT ); request.setRepositories( repositories ); - request.setRoot( new org.sonatype.aether.graph.Dependency( pluginArtifact, null ) ); + request.setRoot( new org.eclipse.aether.graph.Dependency( pluginArtifact, null ) ); for ( Dependency dependency : plugin.getDependencies() ) { - org.sonatype.aether.graph.Dependency pluginDep = + org.eclipse.aether.graph.Dependency pluginDep = RepositoryUtils.toDependency( dependency, session.getArtifactTypeRegistry() ); if ( !JavaScopes.SYSTEM.equals( pluginDep.getScope() ) ) { @@ -228,10 +221,10 @@ public class DefaultPluginDependenciesResolver { StringBuilder buffer = new StringBuilder( 128 ); buffer.append( indent ); - org.sonatype.aether.graph.Dependency dep = node.getDependency(); + org.eclipse.aether.graph.Dependency dep = node.getDependency(); if ( dep != null ) { - org.sonatype.aether.artifact.Artifact art = dep.getArtifact(); + org.eclipse.aether.artifact.Artifact art = dep.getArtifact(); buffer.append( art ); buffer.append( ':' ).append( dep.getScope() ); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java index d191a234ac..94a303024d 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java @@ -19,15 +19,15 @@ package org.apache.maven.plugin.internal; * under the License. */ -import org.sonatype.aether.RepositoryException; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.collection.DependencyGraphTransformationContext; -import org.sonatype.aether.collection.DependencyGraphTransformer; -import org.sonatype.aether.graph.Dependency; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.util.artifact.DefaultArtifact; -import org.sonatype.aether.util.artifact.JavaScopes; -import org.sonatype.aether.util.graph.DefaultDependencyNode; +import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.DependencyGraphTransformationContext; +import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.util.artifact.DefaultArtifact; +import org.eclipse.aether.util.artifact.JavaScopes; +import org.eclipse.aether.util.graph.DefaultDependencyNode; /** * Injects plexus-utils:1.1 into a plugin's class path if it doesn't already declare a dependency on plexus-utils. This diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java index 1aa578eddb..16bbd2e115 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java @@ -23,11 +23,11 @@ import java.util.List; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.PluginResolutionException; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.repository.RemoteRepository; /** * Assists in resolving the dependencies of a plugin. Warning: This is an internal utility interface diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/WagonExcluder.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/WagonExcluder.java index 56b1c4f519..f0e2107fab 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/WagonExcluder.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/WagonExcluder.java @@ -19,10 +19,10 @@ package org.apache.maven.plugin.internal; * under the License. */ -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.collection.DependencyCollectionContext; -import org.sonatype.aether.collection.DependencySelector; -import org.sonatype.aether.graph.Dependency; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.DependencyCollectionContext; +import org.eclipse.aether.collection.DependencySelector; +import org.eclipse.aether.graph.Dependency; /** * Assists in detecting wagon providers brought into the plugin class path via legacy Maven core artifacts (e.g. diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/DefaultPluginPrefixRequest.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/DefaultPluginPrefixRequest.java index 15a514a0c0..27c5f5b9ed 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/DefaultPluginPrefixRequest.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/DefaultPluginPrefixRequest.java @@ -25,8 +25,8 @@ import java.util.List; import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Model; import org.apache.maven.project.MavenProject; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; /** * Collects settings required to resolve a plugin prefix. diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/NoPluginFoundForPrefixException.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/NoPluginFoundForPrefixException.java index 7b868d8c5b..3287021797 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/NoPluginFoundForPrefixException.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/NoPluginFoundForPrefixException.java @@ -21,8 +21,8 @@ package org.apache.maven.plugin.prefix; import java.util.List; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; public class NoPluginFoundForPrefixException extends Exception diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixRequest.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixRequest.java index 14c83cfcdd..c23368ec72 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixRequest.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixRequest.java @@ -22,8 +22,8 @@ package org.apache.maven.plugin.prefix; import java.util.List; import org.apache.maven.model.Model; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; /** * Collects settings required to resolve a plugin prefix. diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java index f21b6701d8..ab5c3dfd8e 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java @@ -1,6 +1,6 @@ package org.apache.maven.plugin.prefix; -import org.sonatype.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.ArtifactRepository; /* * Licensed to the Apache Software Foundation (ASF) under one diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java index a9761aacd1..7790265645 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java @@ -38,20 +38,20 @@ import org.apache.maven.plugin.prefix.PluginPrefixResult; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; -import org.sonatype.aether.RepositoryEvent.EventType; -import org.sonatype.aether.RepositoryListener; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.repository.ArtifactRepository; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.RepositoryPolicy; -import org.sonatype.aether.resolution.MetadataRequest; -import org.sonatype.aether.resolution.MetadataResult; -import org.sonatype.aether.util.DefaultRepositorySystemSession; -import org.sonatype.aether.util.DefaultRequestTrace; -import org.sonatype.aether.util.listener.DefaultRepositoryEvent; -import org.sonatype.aether.util.metadata.DefaultMetadata; +import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositoryListener; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.resolution.MetadataRequest; +import org.eclipse.aether.resolution.MetadataResult; +import org.eclipse.aether.util.DefaultRepositorySystemSession; +import org.eclipse.aether.util.DefaultRequestTrace; +import org.eclipse.aether.util.listener.DefaultRepositoryEvent; +import org.eclipse.aether.util.metadata.DefaultMetadata; /** * Resolves a plugin prefix. @@ -169,7 +169,7 @@ public class DefaultPluginPrefixResolver for ( String pluginGroup : request.getPluginGroups() ) { - org.sonatype.aether.metadata.Metadata metadata = + org.eclipse.aether.metadata.Metadata metadata = new DefaultMetadata( pluginGroup, "maven-metadata.xml", DefaultMetadata.Nature.RELEASE_OR_SNAPSHOT ); requests.add( new MetadataRequest( metadata, null, REPOSITORY_CONTEXT ).setTrace( trace ) ); @@ -213,7 +213,7 @@ public class DefaultPluginPrefixResolver { for ( MetadataResult res : results ) { - org.sonatype.aether.metadata.Metadata metadata = res.getMetadata(); + org.eclipse.aether.metadata.Metadata metadata = res.getMetadata(); if ( metadata != null ) { @@ -243,7 +243,7 @@ public class DefaultPluginPrefixResolver private PluginPrefixResult resolveFromRepository( PluginPrefixRequest request, RequestTrace trace, String pluginGroup, - org.sonatype.aether.metadata.Metadata metadata, + org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository ) { if ( metadata != null && metadata.getFile() != null && metadata.getFile().isFile() ) @@ -277,7 +277,7 @@ public class DefaultPluginPrefixResolver } private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, - org.sonatype.aether.metadata.Metadata metadata, ArtifactRepository repository, + org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository, Exception exception ) { RepositoryListener listener = session.getRepositoryListener(); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResult.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResult.java index 65aea883b4..9917387ed5 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResult.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResult.java @@ -21,7 +21,7 @@ package org.apache.maven.plugin.prefix.internal; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.prefix.PluginPrefixResult; -import org.sonatype.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.ArtifactRepository; /** * Describes the result of a plugin prefix resolution request. diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionRequest.java b/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionRequest.java index 1e671b3bd8..a1f116bb6a 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionRequest.java @@ -26,8 +26,8 @@ import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; import org.apache.maven.project.MavenProject; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; /** * Collects settings required to resolve the version for a plugin. diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionRequest.java b/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionRequest.java index a6b9e5bce7..5d2b63d21d 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionRequest.java @@ -22,8 +22,8 @@ package org.apache.maven.plugin.version; import java.util.List; import org.apache.maven.model.Model; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; /** * Collects settings required to resolve the version for a plugin. diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java b/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java index af85f1f7ac..84ec0967af 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java @@ -21,8 +21,8 @@ package org.apache.maven.plugin.version; import java.util.List; -import org.sonatype.aether.repository.LocalRepository; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; public class PluginVersionResolutionException extends Exception diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResult.java b/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResult.java index 4169d3076d..bc3a2d28d2 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResult.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResult.java @@ -19,7 +19,7 @@ package org.apache.maven.plugin.version; * under the License. */ -import org.sonatype.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.ArtifactRepository; /** * Describes the result of a plugin version resolution request. 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 a215d2855f..3e8c2b8479 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 @@ -43,22 +43,22 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; -import org.sonatype.aether.RepositoryEvent.EventType; -import org.sonatype.aether.RepositoryListener; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.repository.ArtifactRepository; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.resolution.MetadataRequest; -import org.sonatype.aether.resolution.MetadataResult; -import org.sonatype.aether.util.DefaultRequestTrace; -import org.sonatype.aether.util.listener.DefaultRepositoryEvent; -import org.sonatype.aether.util.metadata.DefaultMetadata; -import org.sonatype.aether.util.version.GenericVersionScheme; -import org.sonatype.aether.version.InvalidVersionSpecificationException; -import org.sonatype.aether.version.Version; -import org.sonatype.aether.version.VersionScheme; +import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositoryListener; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.MetadataRequest; +import org.eclipse.aether.resolution.MetadataResult; +import org.eclipse.aether.util.DefaultRequestTrace; +import org.eclipse.aether.util.listener.DefaultRepositoryEvent; +import org.eclipse.aether.util.metadata.DefaultMetadata; +import org.eclipse.aether.util.version.GenericVersionScheme; +import org.eclipse.aether.version.InvalidVersionSpecificationException; +import org.eclipse.aether.version.Version; +import org.eclipse.aether.version.VersionScheme; /** * Resolves a version for a plugin. @@ -118,7 +118,7 @@ public class DefaultPluginVersionResolver DefaultPluginVersionResult result = new DefaultPluginVersionResult(); - org.sonatype.aether.metadata.Metadata metadata = + org.eclipse.aether.metadata.Metadata metadata = new DefaultMetadata( request.getGroupId(), request.getArtifactId(), "maven-metadata.xml", DefaultMetadata.Nature.RELEASE_OR_SNAPSHOT ); @@ -280,7 +280,7 @@ public class DefaultPluginVersionResolver } private void mergeMetadata( RepositorySystemSession session, RequestTrace trace, Versions versions, - org.sonatype.aether.metadata.Metadata metadata, ArtifactRepository repository ) + org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository ) { if ( metadata != null && metadata.getFile() != null && metadata.getFile().isFile() ) { @@ -300,7 +300,7 @@ public class DefaultPluginVersionResolver } private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, - org.sonatype.aether.metadata.Metadata metadata, ArtifactRepository repository, + org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository, Exception exception ) { RepositoryListener listener = session.getRepositoryListener(); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResult.java b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResult.java index 234d0b7ecc..c67516c0ce 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResult.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResult.java @@ -20,7 +20,7 @@ package org.apache.maven.plugin.version.internal; */ import org.apache.maven.plugin.version.PluginVersionResult; -import org.sonatype.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.ArtifactRepository; /** * Describes the result of a plugin version resolution request. diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionRequest.java b/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionRequest.java index a7f3a93812..cf5b0d70df 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionRequest.java @@ -19,8 +19,8 @@ package org.apache.maven.project; * under the License. */ -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.graph.DependencyFilter; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; /** * @author Benjamin Bentmann diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java b/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java index 49727f3afe..b69b69ed02 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java @@ -25,8 +25,8 @@ import java.util.IdentityHashMap; import java.util.List; import java.util.Map; -import org.sonatype.aether.graph.Dependency; -import org.sonatype.aether.graph.DependencyNode; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; /** * @author Benjamin Bentmann diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index f4103028fa..8c206bf5ff 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -51,15 +51,15 @@ import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.StringUtils; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.impl.RemoteRepositoryManager; -import org.sonatype.aether.repository.LocalRepositoryManager; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.repository.WorkspaceRepository; -import org.sonatype.aether.resolution.ArtifactRequest; -import org.sonatype.aether.resolution.ArtifactResult; -import org.sonatype.aether.util.DefaultRequestTrace; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.impl.RemoteRepositoryManager; +import org.eclipse.aether.repository.LocalRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceRepository; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResult; +import org.eclipse.aether.util.DefaultRequestTrace; /** */ @@ -84,7 +84,7 @@ public class DefaultProjectBuilder private RepositorySystem repositorySystem; @Requirement - private org.sonatype.aether.RepositorySystem repoSystem; + private org.eclipse.aether.RepositorySystem repoSystem; @Requirement private RemoteRepositoryManager repositoryManager; @@ -270,7 +270,7 @@ public class DefaultProjectBuilder public ProjectBuildingResult build( Artifact artifact, boolean allowStubModel, ProjectBuildingRequest request ) throws ProjectBuildingException { - org.sonatype.aether.artifact.Artifact pomArtifact = RepositoryUtils.toArtifact( artifact ); + org.eclipse.aether.artifact.Artifact pomArtifact = RepositoryUtils.toArtifact( artifact ); pomArtifact = ArtifactDescriptorUtils.toPomArtifact( pomArtifact ); InternalConfig config = new InternalConfig( request, null, null ); @@ -287,7 +287,7 @@ public class DefaultProjectBuilder pomArtifact = pomResult.getArtifact(); localProject = pomResult.getRepository() instanceof WorkspaceRepository; } - catch ( org.sonatype.aether.resolution.ArtifactResolutionException e ) + catch ( org.eclipse.aether.resolution.ArtifactResolutionException e ) { if ( e.getResults().get( 0 ).isMissing() && allowStubModel ) { diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java index e9b08929c8..0cd6447fba 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java @@ -52,12 +52,12 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.util.filter.ExclusionsDependencyFilter; -import org.sonatype.aether.util.graph.PreorderNodeListGenerator; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; +import org.eclipse.aether.util.graph.PreorderNodeListGenerator; /** * Assists the project builder. Warning: This is an internal utility class that is only public for diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java index f32426d0e3..87b4b8c92b 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java @@ -27,7 +27,7 @@ import java.util.Properties; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.model.Profile; import org.apache.maven.model.building.ModelBuildingRequest; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; public class DefaultProjectBuildingRequest implements ProjectBuildingRequest 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 2d9b15944e..22a8ff7046 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 @@ -34,22 +34,22 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.artifact.ArtifactType; -import org.sonatype.aether.artifact.ArtifactTypeRegistry; -import org.sonatype.aether.collection.CollectRequest; -import org.sonatype.aether.collection.DependencyCollectionException; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.graph.DependencyVisitor; -import org.sonatype.aether.resolution.ArtifactResult; -import org.sonatype.aether.resolution.DependencyRequest; -import org.sonatype.aether.util.DefaultRequestTrace; -import org.sonatype.aether.util.artifact.ArtifacIdUtils; -import org.sonatype.aether.util.artifact.ArtifactProperties; -import org.sonatype.aether.util.artifact.JavaScopes; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.ArtifactProperties; +import org.eclipse.aether.artifact.ArtifactType; +import org.eclipse.aether.artifact.ArtifactTypeRegistry; +import org.eclipse.aether.collection.CollectRequest; +import org.eclipse.aether.collection.DependencyCollectionException; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.graph.DependencyVisitor; +import org.eclipse.aether.resolution.ArtifactResult; +import org.eclipse.aether.resolution.DependencyRequest; +import org.eclipse.aether.util.DefaultRequestTrace; +import org.eclipse.aether.util.artifact.ArtifactIdUtils; +import org.eclipse.aether.util.artifact.JavaScopes; /** * @author Benjamin Bentmann @@ -110,7 +110,7 @@ public class DefaultProjectDependenciesResolver } } String key = - ArtifacIdUtils.toVersionlessId( dependency.getGroupId(), dependency.getArtifactId(), + ArtifactIdUtils.toVersionlessId( dependency.getGroupId(), dependency.getArtifactId(), dependency.getType(), classifier ); dependencies.put( key, dependency ); } @@ -119,11 +119,11 @@ public class DefaultProjectDependenciesResolver String key = artifact.getDependencyConflictId(); Dependency dependency = dependencies.get( key ); Collection exclusions = dependency != null ? dependency.getExclusions() : null; - org.sonatype.aether.graph.Dependency dep = RepositoryUtils.toDependency( artifact, exclusions ); + org.eclipse.aether.graph.Dependency dep = RepositoryUtils.toDependency( artifact, exclusions ); if ( !JavaScopes.SYSTEM.equals( dep.getScope() ) && dep.getArtifact().getFile() != null ) { // enable re-resolution - org.sonatype.aether.artifact.Artifact art = dep.getArtifact(); + org.eclipse.aether.artifact.Artifact art = dep.getArtifact(); art = art.setFile( null ).setVersion( art.getBaseVersion() ); dep = dep.setArtifact( art ); } @@ -182,7 +182,7 @@ public class DefaultProjectDependenciesResolver { process( result, repoSystem.resolveDependencies( session, depRequest ).getArtifactResults() ); } - catch ( org.sonatype.aether.resolution.DependencyResolutionException e ) + catch ( org.eclipse.aether.resolution.DependencyResolutionException e ) { process( result, e.getResult().getArtifactResults() ); @@ -228,10 +228,10 @@ public class DefaultProjectDependenciesResolver { StringBuilder buffer = new StringBuilder( 128 ); buffer.append( indent ); - org.sonatype.aether.graph.Dependency dep = node.getDependency(); + org.eclipse.aether.graph.Dependency dep = node.getDependency(); if ( dep != null ) { - org.sonatype.aether.artifact.Artifact art = dep.getArtifact(); + org.eclipse.aether.artifact.Artifact art = dep.getArtifact(); buffer.append( art ); buffer.append( ':' ).append( dep.getScope() ); @@ -269,7 +269,7 @@ public class DefaultProjectDependenciesResolver return true; } - private void appendManagementSource( StringBuilder buffer, org.sonatype.aether.artifact.Artifact artifact, + private void appendManagementSource( StringBuilder buffer, org.eclipse.aether.artifact.Artifact artifact, String field ) { if ( managed == null ) @@ -285,7 +285,7 @@ public class DefaultProjectDependenciesResolver } String key = - ArtifacIdUtils.toVersionlessId( artifact.getGroupId(), artifact.getArtifactId(), + ArtifactIdUtils.toVersionlessId( artifact.getGroupId(), artifact.getArtifactId(), artifact.getProperty( ArtifactProperties.TYPE, "jar" ), artifact.getClassifier() ); diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java index d895fdf0a7..1c5dfa3517 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java @@ -26,7 +26,7 @@ import java.util.Map; import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.component.annotations.Component; -import org.sonatype.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyFilter; /** * Default project realm cache implementation. Assumes cached data does not change. diff --git a/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionRequest.java b/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionRequest.java index 32dcc4ad93..33713a1c94 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionRequest.java @@ -19,8 +19,8 @@ package org.apache.maven.project; * under the License. */ -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.graph.DependencyFilter; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; /** * A request to resolve the dependencies of a project. diff --git a/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionResult.java b/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionResult.java index d951c05b1d..2f62d80da2 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionResult.java +++ b/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionResult.java @@ -21,8 +21,8 @@ package org.apache.maven.project; import java.util.List; -import org.sonatype.aether.graph.Dependency; -import org.sonatype.aether.graph.DependencyNode; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; /** * The result of a project dependency resolution. 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 1e235f2477..397b5de740 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 @@ -72,8 +72,8 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.Xpp3Dom; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.RemoteRepository; /** * The concern of the project is provide runtime values based on the model. diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java b/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java index 39522f6843..6b7259102c 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java @@ -26,7 +26,7 @@ import java.util.Properties; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.model.Profile; import org.apache.maven.model.building.ModelBuildingRequest; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; public interface ProjectBuildingRequest { 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 e6cc41112a..5feab1c9fc 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 @@ -33,15 +33,15 @@ import org.apache.maven.model.resolution.InvalidRepositoryException; import org.apache.maven.model.resolution.ModelResolver; import org.apache.maven.model.resolution.UnresolvableModelException; import org.apache.maven.repository.internal.ArtifactDescriptorUtils; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.RequestTrace; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.impl.RemoteRepositoryManager; -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.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.impl.RemoteRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResolutionException; +import org.eclipse.aether.util.artifact.DefaultArtifact; /** * A model resolver to assist building of projects. This resolver gives priority to those repositories that have been diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectRealmCache.java b/maven-core/src/main/java/org/apache/maven/project/ProjectRealmCache.java index e36d1d255a..456cfa90e7 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ProjectRealmCache.java +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectRealmCache.java @@ -22,7 +22,7 @@ package org.apache.maven.project; import java.util.List; import org.codehaus.plexus.classworlds.realm.ClassRealm; -import org.sonatype.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyFilter; /** * Caches project class realms. Warning: This is an internal utility interface that is only public for 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 919f0ee2ef..b09518c380 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 @@ -76,9 +76,9 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.logging.Logger; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RepositoryPolicy; -import org.sonatype.aether.transfer.ArtifactNotFoundException; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.transfer.ArtifactNotFoundException; /** * @author Jason van Zyl @@ -735,7 +735,7 @@ public class MavenMetadataSource { return true; } - if ( e.getCause() instanceof org.sonatype.aether.resolution.ArtifactResolutionException + if ( e.getCause() instanceof org.eclipse.aether.resolution.ArtifactResolutionException && e.getCause().getCause() instanceof ArtifactNotFoundException ) { return true; @@ -749,7 +749,7 @@ public class MavenMetadataSource { return true; } - if ( e.getCause() instanceof org.sonatype.aether.resolution.ArtifactResolutionException + if ( e.getCause() instanceof org.eclipse.aether.resolution.ArtifactResolutionException && !( e.getCause().getCause() instanceof ArtifactNotFoundException ) ) { return true; diff --git a/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java b/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java index f8f4f2208e..ba9dd5d7ce 100644 --- a/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java +++ b/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java @@ -34,7 +34,7 @@ import org.apache.maven.model.Plugin; import org.apache.maven.model.Repository; import org.apache.maven.settings.Mirror; import org.apache.maven.settings.Server; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; /** * @author Jason van Zyl diff --git a/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java b/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java index 04ec4fe3ca..2bb801d8bd 100644 --- a/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java +++ b/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java @@ -29,11 +29,11 @@ import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; -import org.sonatype.aether.util.version.GenericVersionScheme; -import org.sonatype.aether.version.InvalidVersionSpecificationException; -import org.sonatype.aether.version.Version; -import org.sonatype.aether.version.VersionConstraint; -import org.sonatype.aether.version.VersionScheme; +import org.eclipse.aether.util.version.GenericVersionScheme; +import org.eclipse.aether.version.InvalidVersionSpecificationException; +import org.eclipse.aether.version.Version; +import org.eclipse.aether.version.VersionConstraint; +import org.eclipse.aether.version.VersionScheme; /** * Provides information about the current Maven runtime. @@ -139,7 +139,7 @@ public class DefaultRuntimeInformation throw new IllegalStateException( "Could not parse current Maven version: " + e.getMessage(), e ); } - if ( constraint.getRanges().isEmpty() ) + if ( constraint.getRange() == null ) { return constraint.getVersion().compareTo( current ) <= 0; } diff --git a/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java b/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java index 31f6c8619f..b0ca6837f8 100644 --- a/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java +++ b/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java @@ -42,12 +42,14 @@ import org.apache.maven.project.DefaultProjectBuildingRequest; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.repository.RepositorySystem; -import org.apache.maven.repository.internal.MavenRepositorySystemSession; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.FileUtils; -import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.util.DefaultRepositorySystemSession; public abstract class AbstractCoreMavenComponentTestCase extends PlexusTestCase @@ -96,8 +98,7 @@ public abstract class AbstractCoreMavenComponentTestCase */ protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { -// containerConfiguration.addComponentDiscoverer( PluginManager.class ); -// containerConfiguration.addComponentDiscoveryListener( PluginManager.class ); + containerConfiguration.setAutoWiring( true ); } protected MavenExecutionRequest createMavenExecutionRequest( File pom ) @@ -160,10 +161,12 @@ public abstract class AbstractCoreMavenComponentTestCase } protected void initRepoSession( ProjectBuildingRequest request ) + throws Exception { - File localRepo = new File( request.getLocalRepository().getBasedir() ); - MavenRepositorySystemSession session = new MavenRepositorySystemSession(); - session.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepo ) ); + File localRepoDir = new File( request.getLocalRepository().getBasedir() ); + LocalRepository localRepo = new LocalRepository( localRepoDir ); + DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); + session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( localRepo ) ); request.setRepositorySession( session ); } 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 be148bd53e..133bcb3a21 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 @@ -24,8 +24,8 @@ import org.apache.maven.plugin.MojoExecution; import org.apache.maven.plugin.descriptor.MojoDescriptor; import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.codehaus.plexus.classworlds.realm.ClassRealm; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; /** * @author Kristian Rosenvold diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java index e5dc526c8d..a4b54e9814 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java @@ -19,7 +19,7 @@ import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; import org.apache.maven.plugin.prefix.PluginPrefixRequest; import org.apache.maven.plugin.prefix.PluginPrefixResolver; import org.apache.maven.plugin.prefix.PluginPrefixResult; -import org.sonatype.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.ArtifactRepository; /** * @author Kristian Rosenvold diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java index b2daee2069..c79658e8d7 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java @@ -19,7 +19,7 @@ import org.apache.maven.plugin.version.PluginVersionRequest; import org.apache.maven.plugin.version.PluginVersionResolutionException; import org.apache.maven.plugin.version.PluginVersionResolver; import org.apache.maven.plugin.version.PluginVersionResult; -import org.sonatype.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.ArtifactRepository; /** * @author Kristian Rosenvold diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java index 673e5387d3..cbb81a4004 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java @@ -24,9 +24,9 @@ import org.apache.maven.project.DependencyResolutionException; import org.apache.maven.project.DependencyResolutionRequest; import org.apache.maven.project.DependencyResolutionResult; import org.apache.maven.project.MavenProject; -import org.sonatype.aether.graph.Dependency; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.util.graph.DefaultDependencyNode; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.util.graph.DefaultDependencyNode; import java.util.Collection; import java.util.Collections; diff --git a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java index aa54f3eae4..d4d0e02f46 100644 --- a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java +++ b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java @@ -27,8 +27,10 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; import org.apache.maven.model.building.ModelBuildingException; import org.apache.maven.model.building.ModelProblem; import org.apache.maven.repository.RepositorySystem; -import org.apache.maven.repository.internal.MavenRepositorySystemSession; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; +import org.eclipse.aether.util.DefaultRepositorySystemSession; /** * @author Jason van Zyl @@ -39,7 +41,14 @@ public abstract class AbstractMavenProjectTestCase protected ProjectBuilder projectBuilder; protected RepositorySystem repositorySystem; - + + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + } + protected void setUp() throws Exception { @@ -170,7 +179,7 @@ public abstract class AbstractMavenProjectTestCase protected void initRepoSession( ProjectBuildingRequest request ) { File localRepo = new File( request.getLocalRepository().getBasedir() ); - MavenRepositorySystemSession repoSession = new MavenRepositorySystemSession(); + DefaultRepositorySystemSession repoSession = MavenRepositorySystemUtils.newSession(); repoSession.setLocalRepositoryManager( new LegacyLocalRepositoryManager( localRepo ) ); request.setRepositorySession( repoSession ); } diff --git a/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java b/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java index daab6c4f8e..35bbc2c27c 100644 --- a/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java +++ b/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java @@ -21,22 +21,36 @@ package org.apache.maven.project; import java.io.File; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; -import org.sonatype.aether.repository.LocalArtifactRequest; -import org.sonatype.aether.repository.LocalArtifactResult; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.metadata.Metadata; +import org.eclipse.aether.repository.LocalArtifactRegistration; +import org.eclipse.aether.repository.LocalArtifactRequest; +import org.eclipse.aether.repository.LocalArtifactResult; +import org.eclipse.aether.repository.LocalMetadataRegistration; +import org.eclipse.aether.repository.LocalMetadataRequest; +import org.eclipse.aether.repository.LocalMetadataResult; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.LocalRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; /** * @author Benjamin Bentmann */ public class LegacyLocalRepositoryManager - extends SimpleLocalRepositoryManager + implements LocalRepositoryManager { + private final LocalRepository repository; + public LegacyLocalRepositoryManager( File basedir ) { - super( basedir ); + this.repository = new LocalRepository( basedir.getAbsoluteFile(), "legacy" ); + } + + public LocalRepository getRepository() + { + return repository; } public String getPathForLocalArtifact( Artifact artifact ) @@ -59,17 +73,121 @@ public class LegacyLocalRepositoryManager return path.toString(); } + public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) + { + return getPathForLocalArtifact( artifact ); + } + + public String getPathForLocalMetadata( Metadata metadata ) + { + return getPath( metadata, "local" ); + } + + public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) + { + return getPath( metadata, getRepositoryKey( repository, context ) ); + } + + String getRepositoryKey( RemoteRepository repository, String context ) + { + return repository.getId(); + } + + private String getPath( Metadata metadata, String repositoryKey ) + { + StringBuilder path = new StringBuilder( 128 ); + + if ( metadata.getGroupId().length() > 0 ) + { + path.append( metadata.getGroupId().replace( '.', '/' ) ).append( '/' ); + + if ( metadata.getArtifactId().length() > 0 ) + { + path.append( metadata.getArtifactId() ).append( '/' ); + + if ( metadata.getVersion().length() > 0 ) + { + path.append( metadata.getVersion() ).append( '/' ); + } + } + } + + path.append( insertRepositoryKey( metadata.getType(), repositoryKey ) ); + + return path.toString(); + } + + private String insertRepositoryKey( String filename, String repositoryKey ) + { + String result; + int idx = filename.indexOf( '.' ); + if ( idx < 0 ) + { + result = filename + '-' + repositoryKey; + } + else + { + result = filename.substring( 0, idx ) + '-' + repositoryKey + filename.substring( idx ); + } + return result; + } + public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) { - String path = getPathForLocalArtifact( request.getArtifact() ); - File file = new File( getRepository().getBasedir(), path ); + String path = getPathForLocalArtifact( request.getArtifact() ); + File file = new File( getRepository().getBasedir(), path ); + LocalArtifactResult result = new LocalArtifactResult( request ); - if ( file.isFile() ) + if ( file.isFile() ) { - result.setFile( file ); - result.setAvailable( true ); - } - return result; - } + result.setFile( file ); + result.setAvailable( true ); + } + + return result; + } + + public void add( RepositorySystemSession session, LocalArtifactRegistration request ) + { + // noop + } + + public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) + { + LocalMetadataResult result = new LocalMetadataResult( request ); + + String path; + + Metadata metadata = request.getMetadata(); + String context = request.getContext(); + RemoteRepository remote = request.getRepository(); + + if ( remote != null ) + { + path = getPathForRemoteMetadata( metadata, remote, context ); + } + else + { + path = getPathForLocalMetadata( metadata ); + } + + File file = new File( getRepository().getBasedir(), path ); + if ( file.isFile() ) + { + result.setFile( file ); + } + + return result; + } + + public void add( RepositorySystemSession session, LocalMetadataRegistration request ) + { + // noop + } + + public String toString() + { + return String.valueOf( getRepository() ); + } } diff --git a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java index 574efbc2c9..a3443da9c8 100644 --- a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java @@ -32,9 +32,12 @@ import org.apache.maven.model.PluginExecution; import org.apache.maven.model.building.ModelBuildingRequest; import org.apache.maven.project.harness.PomTestWrapper; import org.apache.maven.repository.RepositorySystem; -import org.apache.maven.repository.internal.MavenRepositorySystemSession; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; -import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.util.DefaultRepositorySystemSession; public class PomConstructionTest extends PlexusTestCase @@ -51,6 +54,13 @@ public class PomConstructionTest private File testDirectory; + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + } + protected void setUp() throws Exception { @@ -1799,20 +1809,20 @@ public class PomConstructionTest } private PomTestWrapper buildPom( String pomPath, String... profileIds ) - throws ProjectBuildingException + throws Exception { return buildPom( pomPath, null, profileIds ); } private PomTestWrapper buildPom( String pomPath, Properties executionProperties, String... profileIds ) - throws ProjectBuildingException + throws Exception { return buildPom( pomPath, false, executionProperties, profileIds ); } private PomTestWrapper buildPom( String pomPath, boolean lenientValidation, Properties executionProperties, String... profileIds ) - throws ProjectBuildingException + throws Exception { File pomFile = new File( testDirectory, pomPath ); if ( pomFile.isDirectory() ) @@ -1831,10 +1841,9 @@ public class PomConstructionTest config.setUserProperties( executionProperties ); config.setValidationLevel( lenientValidation ? ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 : ModelBuildingRequest.VALIDATION_LEVEL_STRICT ); - MavenRepositorySystemSession repoSession = new MavenRepositorySystemSession(); - repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( - new File( - config.getLocalRepository().getBasedir() ) ) ); + DefaultRepositorySystemSession repoSession = MavenRepositorySystemUtils.newSession(); + LocalRepository localRepo = new LocalRepository( config.getLocalRepository().getBasedir() ); + repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( localRepo ) ); config.setRepositorySession( repoSession ); return new PomTestWrapper( pomFile, projectBuilder.build( pomFile, config ).getProject() ); diff --git a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java index d2a25b1f13..91ace4f1e8 100644 --- a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java +++ b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java @@ -26,15 +26,15 @@ import java.net.URL; import java.util.Collection; import org.codehaus.plexus.util.FileUtils; -import org.sonatype.aether.artifact.Artifact; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.spi.connector.ArtifactDownload; -import org.sonatype.aether.spi.connector.ArtifactUpload; -import org.sonatype.aether.spi.connector.MetadataDownload; -import org.sonatype.aether.spi.connector.MetadataUpload; -import org.sonatype.aether.spi.connector.RepositoryConnector; -import org.sonatype.aether.transfer.ArtifactNotFoundException; -import org.sonatype.aether.transfer.ArtifactTransferException; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.spi.connector.ArtifactDownload; +import org.eclipse.aether.spi.connector.ArtifactUpload; +import org.eclipse.aether.spi.connector.MetadataDownload; +import org.eclipse.aether.spi.connector.MetadataUpload; +import org.eclipse.aether.spi.connector.RepositoryConnector; +import org.eclipse.aether.transfer.ArtifactNotFoundException; +import org.eclipse.aether.transfer.ArtifactTransferException; /** * @author Benjamin Bentmann diff --git a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java index 008a83cbe9..17fd43f925 100644 --- a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java +++ b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java @@ -20,11 +20,11 @@ package org.apache.maven.repository; */ import org.codehaus.plexus.component.annotations.Component; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.spi.connector.RepositoryConnector; -import org.sonatype.aether.spi.connector.RepositoryConnectorFactory; -import org.sonatype.aether.transfer.NoRepositoryConnectorException; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.spi.connector.RepositoryConnector; +import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; +import org.eclipse.aether.transfer.NoRepositoryConnectorException; /** * @author Benjamin Bentmann @@ -40,7 +40,7 @@ public class TestRepositoryConnectorFactory return new TestRepositoryConnector( repository ); } - public int getPriority() + public float getPriority() { return 0; } diff --git a/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java b/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java index c90f08aff8..2a9b17652a 100644 --- a/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java +++ b/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java @@ -48,7 +48,7 @@ import org.apache.maven.settings.Server; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.FileUtils; -import org.sonatype.aether.RepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; /** * @author Benjamin Bentmann diff --git a/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java b/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java index d17dd2397f..f6d777de38 100644 --- a/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java +++ b/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java @@ -31,13 +31,16 @@ import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.project.harness.PomTestWrapper; import org.apache.maven.repository.RepositorySystem; -import org.apache.maven.repository.internal.MavenRepositorySystemSession; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader; +import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.util.DefaultRepositorySystemSession; public class PomConstructionWithSettingsTest extends PlexusTestCase @@ -52,6 +55,13 @@ public class PomConstructionWithSettingsTest private File testDirectory; + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + } + protected void setUp() throws Exception { @@ -113,10 +123,9 @@ public class PomConstructionWithSettingsTest config.setLocalRepository( repositorySystem.createArtifactRepository( "local", localRepoUrl, new DefaultRepositoryLayout(), null, null ) ); config.setActiveProfileIds( settings.getActiveProfiles() ); - MavenRepositorySystemSession repoSession = new MavenRepositorySystemSession(); - repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( - new File( - config.getLocalRepository().getBasedir() ) ) ); + DefaultRepositorySystemSession repoSession = MavenRepositorySystemUtils.newSession(); + LocalRepository localRepo = new LocalRepository( config.getLocalRepository().getBasedir() ); + repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( localRepo ) ); config.setRepositorySession( repoSession ); return new PomTestWrapper( pomFile, projectBuilder.build( pomFile, config ).getProject() ); diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/AbstractMavenTransferListener.java b/maven-embedder/src/main/java/org/apache/maven/cli/AbstractMavenTransferListener.java index 08a44e7145..a05f483765 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/AbstractMavenTransferListener.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/AbstractMavenTransferListener.java @@ -24,10 +24,10 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.Locale; -import org.sonatype.aether.transfer.AbstractTransferListener; -import org.sonatype.aether.transfer.TransferCancelledException; -import org.sonatype.aether.transfer.TransferEvent; -import org.sonatype.aether.transfer.TransferResource; +import org.eclipse.aether.transfer.AbstractTransferListener; +import org.eclipse.aether.transfer.TransferCancelledException; +import org.eclipse.aether.transfer.TransferEvent; +import org.eclipse.aether.transfer.TransferResource; public abstract class AbstractMavenTransferListener extends AbstractTransferListener diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/ConsoleMavenTransferListener.java b/maven-embedder/src/main/java/org/apache/maven/cli/ConsoleMavenTransferListener.java index c848719aba..0c5e9c3383 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/ConsoleMavenTransferListener.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/ConsoleMavenTransferListener.java @@ -23,9 +23,9 @@ import java.io.PrintStream; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.sonatype.aether.transfer.TransferCancelledException; -import org.sonatype.aether.transfer.TransferEvent; -import org.sonatype.aether.transfer.TransferResource; +import org.eclipse.aether.transfer.TransferCancelledException; +import org.eclipse.aether.transfer.TransferEvent; +import org.eclipse.aether.transfer.TransferResource; /** * Console download progress meter. 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 90349d85a2..c9b45e9d12 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 @@ -65,7 +65,7 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; -import org.sonatype.aether.transfer.TransferListener; +import org.eclipse.aether.transfer.TransferListener; import org.sonatype.plexus.components.cipher.DefaultPlexusCipher; import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher; import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; @@ -375,6 +375,7 @@ public class MavenCli ContainerConfiguration cc = new DefaultContainerConfiguration() .setClassWorld( cliRequest.classWorld ) .setRealm( setupContainerRealm( cliRequest ) ) + .setAutoWiring( true ) .setName( "maven" ); container = new DefaultPlexusContainer( cc ); diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/QuietMavenTransferListener.java b/maven-embedder/src/main/java/org/apache/maven/cli/QuietMavenTransferListener.java index b9748a33f7..e05a3c412f 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/QuietMavenTransferListener.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/QuietMavenTransferListener.java @@ -19,7 +19,7 @@ package org.apache.maven.cli; * under the License. */ -import org.sonatype.aether.transfer.AbstractTransferListener; +import org.eclipse.aether.transfer.AbstractTransferListener; /** * @author Benjamin Bentmann diff --git a/pom.xml b/pom.xml index cbca65b766..cc57acbbd2 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 1.7 1.4.1 1.3 - 1.13.1 + 0.9.0-SNAPSHOT true apache-maven @@ -304,35 +304,29 @@ - org.sonatype.aether + org.eclipse.aether aether-api ${aetherVersion} - org.sonatype.aether + org.eclipse.aether aether-spi ${aetherVersion} - org.sonatype.aether + org.eclipse.aether aether-impl ${aetherVersion} - org.sonatype.aether + org.eclipse.aether aether-util ${aetherVersion} - org.sonatype.aether + org.eclipse.aether aether-connector-wagon ${aetherVersion} - - - org.codehaus.plexus - plexus-container-default - - From 18b81002cd9df995bd47719f6cda3a1a9cd6daea Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 30 Dec 2011 22:16:02 +0100 Subject: [PATCH 54/69] o Accounted for API refactoring --- .../internal/DefaultArtifactDescriptorReader.java | 3 +-- .../repository/internal/DefaultVersionRangeResolver.java | 3 +-- .../maven/repository/internal/DefaultVersionResolver.java | 3 +-- .../maven/artifact/deployer/DefaultArtifactDeployer.java | 4 ++-- .../maven/artifact/installer/DefaultArtifactInstaller.java | 4 ++-- .../plugin/internal/DefaultPluginDependenciesResolver.java | 7 +++---- .../prefix/internal/DefaultPluginPrefixResolver.java | 3 +-- .../version/internal/DefaultPluginVersionResolver.java | 3 +-- .../org/apache/maven/project/DefaultProjectBuilder.java | 3 +-- .../maven/project/DefaultProjectDependenciesResolver.java | 5 ++--- 10 files changed, 15 insertions(+), 23 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java index 21daabfb37..f6d6a45f0c 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java @@ -80,7 +80,6 @@ import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.ArtifactNotFoundException; -import org.eclipse.aether.util.DefaultRequestTrace; import org.eclipse.aether.util.artifact.DefaultArtifact; import org.eclipse.aether.util.artifact.DefaultArtifactType; import org.eclipse.aether.util.listener.DefaultRepositoryEvent; @@ -269,7 +268,7 @@ public class DefaultArtifactDescriptorReader ArtifactDescriptorResult result ) throws ArtifactDescriptorException { - RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); + RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); Set visited = new LinkedHashSet(); for ( Artifact artifact = request.getArtifact();; ) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java index 1362557b36..6fbe2e4c75 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java @@ -56,7 +56,6 @@ import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; -import org.eclipse.aether.util.DefaultRequestTrace; import org.eclipse.aether.util.listener.DefaultRepositoryEvent; import org.eclipse.aether.util.metadata.DefaultMetadata; import org.eclipse.aether.util.version.GenericVersionScheme; @@ -210,7 +209,7 @@ public class DefaultVersionRangeResolver private Map getVersions( RepositorySystemSession session, VersionRangeResult result, VersionRangeRequest request ) { - RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); + RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); Map versionIndex = new HashMap(); diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java index 1e0e35365d..f8a5e301b9 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java @@ -67,7 +67,6 @@ import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.util.ConfigUtils; -import org.eclipse.aether.util.DefaultRequestTrace; import org.eclipse.aether.util.listener.DefaultRepositoryEvent; import org.eclipse.aether.util.metadata.DefaultMetadata; @@ -169,7 +168,7 @@ public class DefaultVersionResolver public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { - RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); + RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); Artifact artifact = request.getArtifact(); diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java b/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java index 3f3478d91d..5905e084b4 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java @@ -39,12 +39,12 @@ import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.deployment.DeployResult; import org.eclipse.aether.deployment.DeploymentException; import org.eclipse.aether.metadata.MergeableMetadata; import org.eclipse.aether.repository.RemoteRepository; -import org.eclipse.aether.util.DefaultRequestTrace; import org.eclipse.aether.util.artifact.SubArtifact; @Component( role = ArtifactDeployer.class, instantiationStrategy = "per-lookup" ) @@ -84,7 +84,7 @@ public class DefaultArtifactDeployer DeployRequest request = new DeployRequest(); - request.setTrace( DefaultRequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) ); + request.setTrace( RequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) ); org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact ); mainArtifact = mainArtifact.setFile( source ); diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java b/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java index cf31d2cd8d..aa924e8b7a 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java @@ -38,9 +38,9 @@ import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; import org.eclipse.aether.installation.InstallRequest; import org.eclipse.aether.installation.InstallationException; -import org.eclipse.aether.util.DefaultRequestTrace; import org.eclipse.aether.util.artifact.SubArtifact; /** @@ -77,7 +77,7 @@ public class DefaultArtifactInstaller InstallRequest request = new InstallRequest(); - request.setTrace( DefaultRequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) ); + request.setTrace( RequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) ); org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact ); mainArtifact = mainArtifact.setFile( source ); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java index c90634a332..e14f8389a4 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java @@ -51,7 +51,6 @@ import org.eclipse.aether.resolution.ArtifactResolutionException; import org.eclipse.aether.resolution.DependencyRequest; import org.eclipse.aether.resolution.DependencyResolutionException; import org.eclipse.aether.util.DefaultRepositorySystemSession; -import org.eclipse.aether.util.DefaultRequestTrace; import org.eclipse.aether.util.artifact.DefaultArtifact; import org.eclipse.aether.util.artifact.JavaScopes; import org.eclipse.aether.util.filter.AndDependencyFilter; @@ -93,7 +92,7 @@ public class DefaultPluginDependenciesResolver public Artifact resolve( Plugin plugin, List repositories, RepositorySystemSession session ) throws PluginResolutionException { - RequestTrace trace = DefaultRequestTrace.newChild( null, plugin ); + RequestTrace trace = RequestTrace.newChild( null, plugin ); Artifact pluginArtifact = toArtifact( plugin, session ); @@ -140,7 +139,7 @@ public class DefaultPluginDependenciesResolver List repositories, RepositorySystemSession session ) throws PluginResolutionException { - RequestTrace trace = DefaultRequestTrace.newChild( null, plugin ); + RequestTrace trace = RequestTrace.newChild( null, plugin ); if ( pluginArtifact == null ) { @@ -187,7 +186,7 @@ public class DefaultPluginDependenciesResolver DependencyRequest depRequest = new DependencyRequest( request, resolutionFilter ); depRequest.setTrace( trace ); - request.setTrace( DefaultRequestTrace.newChild( trace, depRequest ) ); + request.setTrace( RequestTrace.newChild( trace, depRequest ) ); node = repoSystem.collectDependencies( pluginSession, request ).getRoot(); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java index 7790265645..a5533f2ac9 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java @@ -49,7 +49,6 @@ import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; import org.eclipse.aether.util.DefaultRepositorySystemSession; -import org.eclipse.aether.util.DefaultRequestTrace; import org.eclipse.aether.util.listener.DefaultRepositoryEvent; import org.eclipse.aether.util.metadata.DefaultMetadata; @@ -163,7 +162,7 @@ public class DefaultPluginPrefixResolver private PluginPrefixResult resolveFromRepository( PluginPrefixRequest request ) { - RequestTrace trace = DefaultRequestTrace.newChild( null, request ); + RequestTrace trace = RequestTrace.newChild( null, request ); List requests = new ArrayList(); 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 3e8c2b8479..290e8e7525 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 @@ -52,7 +52,6 @@ import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; -import org.eclipse.aether.util.DefaultRequestTrace; import org.eclipse.aether.util.listener.DefaultRepositoryEvent; import org.eclipse.aether.util.metadata.DefaultMetadata; import org.eclipse.aether.util.version.GenericVersionScheme; @@ -114,7 +113,7 @@ public class DefaultPluginVersionResolver private PluginVersionResult resolveFromRepository( PluginVersionRequest request ) throws PluginVersionResolutionException { - RequestTrace trace = DefaultRequestTrace.newChild( null, request ); + RequestTrace trace = RequestTrace.newChild( null, request ); DefaultPluginVersionResult result = new DefaultPluginVersionResult(); diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index 8c206bf5ff..07bf3543b8 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -59,7 +59,6 @@ import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.WorkspaceRepository; import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResult; -import org.eclipse.aether.util.DefaultRequestTrace; /** */ @@ -241,7 +240,7 @@ public class DefaultProjectBuilder ModelBuildingRequest request = new DefaultModelBuildingRequest(); - RequestTrace trace = DefaultRequestTrace.newChild( null, configuration ).newChild( request ); + RequestTrace trace = RequestTrace.newChild( null, configuration ).newChild( request ); ModelResolver resolver = new ProjectModelResolver( config.session, trace, repoSystem, repositoryManager, config.repositories, 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 22a8ff7046..47f510b873 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 @@ -47,7 +47,6 @@ import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; import org.eclipse.aether.resolution.ArtifactResult; import org.eclipse.aether.resolution.DependencyRequest; -import org.eclipse.aether.util.DefaultRequestTrace; import org.eclipse.aether.util.artifact.ArtifactIdUtils; import org.eclipse.aether.util.artifact.JavaScopes; @@ -68,7 +67,7 @@ public class DefaultProjectDependenciesResolver public DependencyResolutionResult resolve( DependencyResolutionRequest request ) throws DependencyResolutionException { - RequestTrace trace = DefaultRequestTrace.newChild( null, request ); + RequestTrace trace = RequestTrace.newChild( null, request ); DefaultDependencyResolutionResult result = new DefaultDependencyResolutionResult(); @@ -146,7 +145,7 @@ public class DefaultProjectDependenciesResolver DependencyNode node; try { - collect.setTrace( DefaultRequestTrace.newChild( trace, depRequest ) ); + collect.setTrace( RequestTrace.newChild( trace, depRequest ) ); node = repoSystem.collectDependencies( session, collect ).getRoot(); result.setDependencyGraph( node ); } From a7613aad86332a89fca557af1b4a9bda8feec106 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 31 Dec 2011 21:46:14 +0100 Subject: [PATCH 55/69] o Accounted for API refactoring --- .../internal/DefaultArtifactDescriptorReader.java | 14 +++++++------- .../internal/DefaultVersionRangeResolver.java | 7 ++++--- .../internal/DefaultVersionResolver.java | 7 ++++--- .../internal/DefaultPluginPrefixResolver.java | 7 ++++--- .../internal/DefaultPluginVersionResolver.java | 7 ++++--- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java index f6d6a45f0c..0ab3f0c5d2 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java @@ -51,6 +51,7 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; @@ -82,7 +83,6 @@ import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.ArtifactNotFoundException; import org.eclipse.aether.util.artifact.DefaultArtifact; import org.eclipse.aether.util.artifact.DefaultArtifactType; -import org.eclipse.aether.util.listener.DefaultRepositoryEvent; /** * @author Benjamin Bentmann @@ -469,23 +469,23 @@ public class DefaultArtifactDescriptorReader private void missingDescriptor( RepositorySystemSession session, RequestTrace trace, Artifact artifact, Exception exception ) { - DefaultRepositoryEvent event = - new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_MISSING, session, trace ); + RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_DESCRIPTOR_MISSING ); + event.setTrace( trace ); event.setArtifact( artifact ); event.setException( exception ); - repositoryEventDispatcher.dispatch( event ); + repositoryEventDispatcher.dispatch( event.build() ); } private void invalidDescriptor( RepositorySystemSession session, RequestTrace trace, Artifact artifact, Exception exception ) { - DefaultRepositoryEvent event = - new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_INVALID, session, trace ); + RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_DESCRIPTOR_INVALID ); + event.setTrace( trace ); event.setArtifact( artifact ); event.setException( exception ); - repositoryEventDispatcher.dispatch( event ); + repositoryEventDispatcher.dispatch( event.build() ); } } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java index 6fbe2e4c75..22fd8026bf 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java @@ -35,6 +35,7 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.IOUtil; import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.SyncContext; @@ -56,7 +57,6 @@ import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; -import org.eclipse.aether.util.listener.DefaultRepositoryEvent; import org.eclipse.aether.util.metadata.DefaultMetadata; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; @@ -310,12 +310,13 @@ public class DefaultVersionRangeResolver private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, Metadata metadata, ArtifactRepository repository, Exception exception ) { - DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace ); + RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID ); + event.setTrace( trace ); event.setMetadata( metadata ); event.setException( exception ); event.setRepository( repository ); - repositoryEventDispatcher.dispatch( event ); + repositoryEventDispatcher.dispatch( event.build() ); } } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java index f8a5e301b9..7c46311393 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java @@ -41,6 +41,7 @@ import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import org.eclipse.aether.RepositoryCache; import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.SyncContext; @@ -67,7 +68,6 @@ import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.util.ConfigUtils; -import org.eclipse.aether.util.listener.DefaultRepositoryEvent; import org.eclipse.aether.util.metadata.DefaultMetadata; /** @@ -400,12 +400,13 @@ public class DefaultVersionResolver private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, Metadata metadata, ArtifactRepository repository, Exception exception ) { - DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace ); + RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID ); + event.setTrace( trace ); event.setMetadata( metadata ); event.setException( exception ); event.setRepository( repository ); - repositoryEventDispatcher.dispatch( event ); + repositoryEventDispatcher.dispatch( event.build() ); } private void merge( Artifact artifact, Map infos, Versioning versioning, diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java index a5533f2ac9..341f4a2549 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java @@ -39,6 +39,7 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; @@ -49,7 +50,6 @@ import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; import org.eclipse.aether.util.DefaultRepositorySystemSession; -import org.eclipse.aether.util.listener.DefaultRepositoryEvent; import org.eclipse.aether.util.metadata.DefaultMetadata; /** @@ -282,11 +282,12 @@ public class DefaultPluginPrefixResolver RepositoryListener listener = session.getRepositoryListener(); if ( listener != null ) { - DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace ); + RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID ); + event.setTrace( trace ); event.setMetadata( metadata ); event.setException( exception ); event.setRepository( repository ); - listener.metadataInvalid( event ); + listener.metadataInvalid( event.build() ); } } 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 290e8e7525..a951c71071 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 @@ -44,6 +44,7 @@ import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; @@ -52,7 +53,6 @@ import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; -import org.eclipse.aether.util.listener.DefaultRepositoryEvent; import org.eclipse.aether.util.metadata.DefaultMetadata; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; @@ -305,11 +305,12 @@ public class DefaultPluginVersionResolver RepositoryListener listener = session.getRepositoryListener(); if ( listener != null ) { - DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace ); + RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID ); + event.setTrace( trace ); event.setMetadata( metadata ); event.setException( exception ); event.setRepository( repository ); - listener.metadataInvalid( event ); + listener.metadataInvalid( event.build() ); } } From 2592e158adad0992dd7dc88460e8ddd44049071e Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 1 Jan 2012 20:05:13 +0100 Subject: [PATCH 56/69] o Accounted for API refactoring --- .../maven/repository/internal/MavenRepositorySystemUtils.java | 2 +- .../maven/artifact/AbstractArtifactComponentTestCase.java | 2 +- .../org/apache/maven/project/AbstractMavenProjectTestCase.java | 2 +- .../org/apache/maven/repository/LegacyRepositorySystemTest.java | 2 +- maven-core/src/main/java/org/apache/maven/DefaultMaven.java | 2 +- .../maven/artifact/repository/LegacyLocalRepositoryManager.java | 2 +- .../apache/maven/execution/DefaultMavenExecutionRequest.java | 2 +- .../plugin/internal/DefaultPluginDependenciesResolver.java | 2 +- .../plugin/prefix/internal/DefaultPluginPrefixResolver.java | 2 +- .../org/apache/maven/AbstractCoreMavenComponentTestCase.java | 2 +- .../org/apache/maven/project/AbstractMavenProjectTestCase.java | 2 +- .../test/java/org/apache/maven/project/PomConstructionTest.java | 2 +- .../apache/maven/settings/PomConstructionWithSettingsTest.java | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index de21c26654..ff94d050e1 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -21,6 +21,7 @@ package org.apache.maven.repository.internal; import java.util.Properties; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; @@ -30,7 +31,6 @@ import org.eclipse.aether.impl.DefaultServiceLocator; import org.eclipse.aether.impl.MetadataGeneratorFactory; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.impl.VersionResolver; -import org.eclipse.aether.util.DefaultRepositorySystemSession; import org.eclipse.aether.util.artifact.DefaultArtifactType; import org.eclipse.aether.util.artifact.DefaultArtifactTypeRegistry; import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java index 1a294b3bd3..44c238244c 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java @@ -38,6 +38,7 @@ import org.apache.maven.execution.DefaultMavenExecutionResult; import org.apache.maven.execution.MavenSession; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.collection.DependencyManager; @@ -45,7 +46,6 @@ import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; import org.eclipse.aether.repository.LocalRepository; -import org.eclipse.aether.util.DefaultRepositorySystemSession; import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; diff --git a/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java index ec3c62d2c5..f897dbf7f9 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java +++ b/maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java @@ -30,7 +30,7 @@ import org.apache.maven.repository.RepositorySystem; import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; -import org.eclipse.aether.util.DefaultRepositorySystemSession; +import org.eclipse.aether.DefaultRepositorySystemSession; /** * @author Jason van Zyl diff --git a/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java b/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java index 79c18b9800..be1790ffaa 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java @@ -34,9 +34,9 @@ import org.apache.maven.plugin.LegacySupport; import org.apache.maven.repository.RepositorySystem; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; import org.eclipse.aether.repository.LocalRepository; -import org.eclipse.aether.util.DefaultRepositorySystemSession; /** * Tests {@link LegacyRepositorySystem}. 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 dcc32e7f0e..7bed0639a1 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -76,6 +76,7 @@ import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.dag.CycleDetectedException; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.eclipse.aether.ConfigurationProperties; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.collection.DependencyGraphTransformer; @@ -86,7 +87,6 @@ import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.repository.WorkspaceReader; -import org.eclipse.aether.util.DefaultRepositorySystemSession; import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; diff --git a/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java b/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java index 937712ae65..159d3e3f33 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java +++ b/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java @@ -29,6 +29,7 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException; import org.apache.maven.repository.Proxy; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; @@ -42,7 +43,6 @@ import org.eclipse.aether.repository.LocalMetadataResult; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; -import org.eclipse.aether.util.DefaultRepositorySystemSession; /** * Warning: This is an internal utility class that is only public for technical reasons, it is not part diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java index 7381ac394d..53adcab049 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java @@ -32,10 +32,10 @@ import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.settings.Mirror; import org.apache.maven.settings.Proxy; import org.apache.maven.settings.Server; +import org.eclipse.aether.DefaultRepositoryCache; import org.eclipse.aether.RepositoryCache; import org.eclipse.aether.repository.WorkspaceReader; import org.eclipse.aether.transfer.TransferListener; -import org.eclipse.aether.util.DefaultRepositoryCache; /** * @author Jason van Zyl diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java index e14f8389a4..7b27507eae 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java @@ -31,6 +31,7 @@ import org.apache.maven.plugin.PluginResolutionException; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; @@ -50,7 +51,6 @@ import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; import org.eclipse.aether.resolution.DependencyRequest; import org.eclipse.aether.resolution.DependencyResolutionException; -import org.eclipse.aether.util.DefaultRepositorySystemSession; import org.eclipse.aether.util.artifact.DefaultArtifact; import org.eclipse.aether.util.artifact.JavaScopes; import org.eclipse.aether.util.filter.AndDependencyFilter; diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java index 341f4a2549..64cf3ffbd5 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java @@ -39,6 +39,7 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.RepositorySystem; @@ -49,7 +50,6 @@ import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; -import org.eclipse.aether.util.DefaultRepositorySystemSession; import org.eclipse.aether.util.metadata.DefaultMetadata; /** diff --git a/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java b/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java index b0ca6837f8..1d69c4fa5c 100644 --- a/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java +++ b/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java @@ -47,9 +47,9 @@ import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.FileUtils; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; import org.eclipse.aether.repository.LocalRepository; -import org.eclipse.aether.util.DefaultRepositorySystemSession; public abstract class AbstractCoreMavenComponentTestCase extends PlexusTestCase diff --git a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java index d4d0e02f46..a8b48290e0 100644 --- a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java +++ b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java @@ -30,7 +30,7 @@ import org.apache.maven.repository.RepositorySystem; import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; -import org.eclipse.aether.util.DefaultRepositorySystemSession; +import org.eclipse.aether.DefaultRepositorySystemSession; /** * @author Jason van Zyl diff --git a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java index a3443da9c8..82ac995c80 100644 --- a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java @@ -35,9 +35,9 @@ import org.apache.maven.repository.RepositorySystem; import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; import org.eclipse.aether.repository.LocalRepository; -import org.eclipse.aether.util.DefaultRepositorySystemSession; public class PomConstructionTest extends PlexusTestCase diff --git a/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java b/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java index f6d777de38..b97c064d12 100644 --- a/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java +++ b/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java @@ -38,9 +38,9 @@ import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; import org.eclipse.aether.repository.LocalRepository; -import org.eclipse.aether.util.DefaultRepositorySystemSession; public class PomConstructionWithSettingsTest extends PlexusTestCase From e02c8abdd1dd0656b022c8a7147e9c36bf281cc8 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 8 Jan 2012 20:01:59 +0100 Subject: [PATCH 57/69] Accounted for refactoring of aether-api --- .../repository/internal/ArtifactDescriptorUtils.java | 2 +- .../internal/DefaultArtifactDescriptorReader.java | 4 ++-- .../repository/internal/DefaultModelResolver.java | 2 +- .../internal/DefaultVersionRangeResolver.java | 2 +- .../repository/internal/DefaultVersionResolver.java | 2 +- .../internal/MavenRepositorySystemUtils.java | 2 +- .../maven/repository/internal/RelocatedArtifact.java | 12 +----------- .../main/java/org/apache/maven/RepositoryUtils.java | 4 ++-- .../internal/DefaultPluginDependenciesResolver.java | 2 +- .../maven/plugin/internal/PlexusUtilsInjector.java | 4 ++-- .../prefix/internal/DefaultPluginPrefixResolver.java | 2 +- .../internal/DefaultPluginVersionResolver.java | 2 +- .../apache/maven/project/ProjectModelResolver.java | 2 +- .../stub/ProjectDependenciesResolverStub.java | 2 +- 14 files changed, 17 insertions(+), 27 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java index 7f71dd913f..c4def8a1a3 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java @@ -21,9 +21,9 @@ package org.apache.maven.repository.internal; import org.apache.maven.model.Repository; import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; -import org.eclipse.aether.util.artifact.DefaultArtifact; /** * Warning: This is an internal utility class that is only public for technical reasons, it is not part diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java index 0ab3f0c5d2..0b4e6d8ccf 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java @@ -58,6 +58,8 @@ import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.artifact.ArtifactType; import org.eclipse.aether.artifact.ArtifactTypeRegistry; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.artifact.DefaultArtifactType; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.Exclusion; import org.eclipse.aether.impl.ArtifactDescriptorReader; @@ -81,8 +83,6 @@ import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.ArtifactNotFoundException; -import org.eclipse.aether.util.artifact.DefaultArtifact; -import org.eclipse.aether.util.artifact.DefaultArtifactType; /** * @author Benjamin Bentmann 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 387340ca6b..08ad432273 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 @@ -34,12 +34,12 @@ import org.apache.maven.model.resolution.UnresolvableModelException; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.impl.ArtifactResolver; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; -import org.eclipse.aether.util.artifact.DefaultArtifact; /** * A model resolver to assist building of dependency POMs. This resolver gives priority to those repositories that have diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java index 22fd8026bf..3e04755493 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java @@ -43,6 +43,7 @@ import org.eclipse.aether.impl.MetadataResolver; import org.eclipse.aether.impl.RepositoryEventDispatcher; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.impl.VersionRangeResolver; +import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; @@ -57,7 +58,6 @@ import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; -import org.eclipse.aether.util.metadata.DefaultMetadata; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java index 7c46311393..5af7121907 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java @@ -51,6 +51,7 @@ import org.eclipse.aether.impl.RepositoryEventDispatcher; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.internal.impl.CacheUtils; +import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.LocalRepository; @@ -68,7 +69,6 @@ import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.util.ConfigUtils; -import org.eclipse.aether.util.metadata.DefaultMetadata; /** * @author Benjamin Bentmann diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index ff94d050e1..624e039e53 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -22,6 +22,7 @@ package org.apache.maven.repository.internal; import java.util.Properties; import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.artifact.DefaultArtifactType; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; @@ -31,7 +32,6 @@ import org.eclipse.aether.impl.DefaultServiceLocator; import org.eclipse.aether.impl.MetadataGeneratorFactory; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.impl.VersionResolver; -import org.eclipse.aether.util.artifact.DefaultArtifactType; import org.eclipse.aether.util.artifact.DefaultArtifactTypeRegistry; import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java index b05c5235d0..958eb388cb 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java @@ -22,8 +22,8 @@ package org.apache.maven.repository.internal; import java.io.File; import java.util.Map; +import org.eclipse.aether.artifact.AbstractArtifact; import org.eclipse.aether.artifact.Artifact; -import org.eclipse.aether.util.artifact.AbstractArtifact; /** * @author Benjamin Bentmann @@ -88,16 +88,6 @@ final class RelocatedArtifact } } - public String getBaseVersion() - { - return toBaseVersion( getVersion() ); - } - - public boolean isSnapshot() - { - return isSnapshot( getVersion() ); - } - public String getClassifier() { return artifact.getClassifier(); diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java index 0977018db2..4ad30eab43 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -34,6 +34,8 @@ import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.artifact.ArtifactType; import org.eclipse.aether.artifact.ArtifactTypeRegistry; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.artifact.DefaultArtifactType; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; @@ -42,8 +44,6 @@ import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; -import org.eclipse.aether.util.artifact.DefaultArtifact; -import org.eclipse.aether.util.artifact.DefaultArtifactType; /** * Warning: This is an internal utility class that is only public for technical reasons, it is not part diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java index 7b27507eae..6d2b2ff894 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java @@ -36,6 +36,7 @@ import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.collection.DependencyGraphTransformer; @@ -51,7 +52,6 @@ import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; import org.eclipse.aether.resolution.DependencyRequest; import org.eclipse.aether.resolution.DependencyResolutionException; -import org.eclipse.aether.util.artifact.DefaultArtifact; import org.eclipse.aether.util.artifact.JavaScopes; import org.eclipse.aether.util.filter.AndDependencyFilter; import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java index 94a303024d..2112748027 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java @@ -21,13 +21,13 @@ package org.apache.maven.plugin.internal; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.graph.DefaultDependencyNode; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; -import org.eclipse.aether.util.artifact.DefaultArtifact; import org.eclipse.aether.util.artifact.JavaScopes; -import org.eclipse.aether.util.graph.DefaultDependencyNode; /** * Injects plexus-utils:1.1 into a plugin's class path if it doesn't already declare a dependency on plexus-utils. This diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java index 64cf3ffbd5..76814fd79c 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java @@ -45,12 +45,12 @@ import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; -import org.eclipse.aether.util.metadata.DefaultMetadata; /** * Resolves a plugin prefix. 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 a951c71071..95e0ba8eaa 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 @@ -49,11 +49,11 @@ import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; -import org.eclipse.aether.util.metadata.DefaultMetadata; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; 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 5feab1c9fc..522c79c9a8 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 @@ -37,11 +37,11 @@ import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; -import org.eclipse.aether.util.artifact.DefaultArtifact; /** * A model resolver to assist building of projects. This resolver gives priority to those repositories that have been diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java index cbb81a4004..4147b36cde 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java @@ -24,9 +24,9 @@ import org.apache.maven.project.DependencyResolutionException; import org.apache.maven.project.DependencyResolutionRequest; import org.apache.maven.project.DependencyResolutionResult; import org.apache.maven.project.MavenProject; +import org.eclipse.aether.graph.DefaultDependencyNode; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; -import org.eclipse.aether.util.graph.DefaultDependencyNode; import java.util.Collection; import java.util.Collections; From 8cf8d36777202b98156f4dac80adc459a9668149 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 8 Jan 2012 20:02:32 +0100 Subject: [PATCH 58/69] o Made Aether session read-only once setup --- maven-core/src/main/java/org/apache/maven/DefaultMaven.java | 2 ++ 1 file changed, 2 insertions(+) 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 7bed0639a1..b1f239acec 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -264,6 +264,8 @@ public class DefaultMaven return processResult( result, e ); } + repoSession.setReadOnly(); + ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); try { From 298403bed3852e1ae9f632449f16a8ebf717453a Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 15 Jan 2012 18:36:21 +0100 Subject: [PATCH 59/69] o Accounted for refactoring of aether-api --- .../repository/internal/MavenMetadata.java | 29 ++++++++----------- .../repository/metadata/MetadataBridge.java | 16 ++++++++++ 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java index 63f7bc4f0f..329f99cb77 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java @@ -23,6 +23,8 @@ import java.io.File; import java.io.IOException; import java.io.Reader; import java.io.Writer; +import java.util.Collections; +import java.util.Map; import org.apache.maven.artifact.repository.metadata.Metadata; import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; @@ -32,12 +34,14 @@ import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.WriterFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.metadata.AbstractMetadata; import org.eclipse.aether.metadata.MergeableMetadata; /** * @author Benjamin Bentmann */ abstract class MavenMetadata + extends AbstractMetadata implements MergeableMetadata { @@ -130,24 +134,15 @@ abstract class MavenMetadata } } - @Override - public String toString() + public Map getProperties() { - StringBuilder buffer = new StringBuilder( 128 ); - if ( getGroupId().length() > 0 ) - { - buffer.append( getGroupId() ); - } - if ( getArtifactId().length() > 0 ) - { - buffer.append( ':' ).append( getArtifactId() ); - } - if ( getVersion().length() > 0 ) - { - buffer.append( ':' ).append( getVersion() ); - } - buffer.append( '/' ).append( getType() ); - return buffer.toString(); + return Collections.emptyMap(); + } + + @Override + public org.eclipse.aether.metadata.Metadata setProperties( Map properties ) + { + return this; } } diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java b/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java index b3ae0280fc..7d9935c11e 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java @@ -20,6 +20,8 @@ package org.apache.maven.artifact.repository.metadata; */ import java.io.File; +import java.util.Collections; +import java.util.Map; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.repository.ArtifactRepository; @@ -27,7 +29,9 @@ import org.apache.maven.artifact.repository.DefaultArtifactRepository; import org.apache.maven.artifact.repository.metadata.RepositoryMetadata; import org.codehaus.plexus.util.FileUtils; import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.metadata.AbstractMetadata; import org.eclipse.aether.metadata.MergeableMetadata; +import org.eclipse.aether.metadata.Metadata; /** * Warning: This is an internal utility class that is only public for technical reasons, it is not part @@ -36,6 +40,7 @@ import org.eclipse.aether.metadata.MergeableMetadata; * @author Benjamin Bentmann */ public final class MetadataBridge + extends AbstractMetadata implements MergeableMetadata { @@ -127,6 +132,17 @@ public final class MetadataBridge } } + public Map getProperties() + { + return Collections.emptyMap(); + } + + @Override + public Metadata setProperties( Map properties ) + { + return this; + } + @SuppressWarnings( "deprecation" ) static class MetadataRepository extends DefaultArtifactRepository From 25a273f744cffde2b2c5c0dd70d536693a01ff8f Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 10 Mar 2012 17:41:02 +0100 Subject: [PATCH 60/69] o Accounted for refactoring of aether-api/-util --- .../src/main/java/org/apache/maven/DefaultMaven.java | 9 +++++++-- .../maven/plugin/internal/DefaultMavenPluginManager.java | 2 +- .../maven/project/DefaultProjectBuildingHelper.java | 2 +- 3 files changed, 9 insertions(+), 4 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 b1f239acec..1e74cb7f8c 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -87,6 +87,7 @@ import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.resolution.ResolutionErrorPolicy; import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; @@ -102,6 +103,7 @@ import org.eclipse.aether.util.repository.ChainedWorkspaceReader; import org.eclipse.aether.util.repository.DefaultAuthenticationSelector; import org.eclipse.aether.util.repository.DefaultMirrorSelector; import org.eclipse.aether.util.repository.DefaultProxySelector; +import org.eclipse.aether.util.repository.SimpleResolutionErrorPolicy; /** * @author Jason van Zyl @@ -360,8 +362,11 @@ public class DefaultMaven session.setUpdatePolicy( null ); } - session.setNotFoundCachingEnabled( request.isCacheNotFound() ); - session.setTransferErrorCachingEnabled( request.isCacheTransferError() ); + int errorPolicy = 0; + errorPolicy |= request.isCacheNotFound() ? ResolutionErrorPolicy.CACHE_NOT_FOUND : 0; + errorPolicy |= request.isCacheTransferError() ? ResolutionErrorPolicy.CACHE_TRANSFER_ERROR : 0; + session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( errorPolicy, errorPolicy + | ResolutionErrorPolicy.CACHE_NOT_FOUND ) ); session.setArtifactTypeRegistry( RepositoryUtils.newArtifactTypeRegistry( artifactHandlerManager ) ); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java index 8184b8608c..c36bd55c2e 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java @@ -92,7 +92,7 @@ import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.util.filter.AndDependencyFilter; -import org.eclipse.aether.util.graph.PreorderNodeListGenerator; +import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator; /** * Provides basic services to manage Maven plugins and their mojos. This component is kept general in its design such diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java index 0cd6447fba..1d99343f64 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java @@ -57,7 +57,7 @@ import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; -import org.eclipse.aether.util.graph.PreorderNodeListGenerator; +import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator; /** * Assists the project builder. Warning: This is an internal utility class that is only public for From 02927ead50a1dbf731ff775257c6cd42d6be7a89 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 11 Mar 2012 23:18:43 +0100 Subject: [PATCH 61/69] o Accounted for refactoring of aether-api --- .../DefaultArtifactDescriptorReader.java | 18 +++++++++++++++--- .../internal/MavenRepositorySystemUtils.java | 4 ++-- .../AbstractArtifactComponentTestCase.java | 4 ++-- .../java/org/apache/maven/DefaultMaven.java | 3 ++- .../DefaultPluginDependenciesResolver.java | 5 +++-- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java index 0b4e6d8ccf..60a183c499 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java @@ -69,6 +69,8 @@ import org.eclipse.aether.impl.RepositoryEventDispatcher; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.repository.WorkspaceRepository; import org.eclipse.aether.resolution.ArtifactDescriptorException; +import org.eclipse.aether.resolution.ArtifactDescriptorPolicy; +import org.eclipse.aether.resolution.ArtifactDescriptorPolicyRequest; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.eclipse.aether.resolution.ArtifactRequest; @@ -293,7 +295,7 @@ public class DefaultArtifactDescriptorReader RepositoryException exception = new RepositoryException( "Artifact relocations form a cycle: " + visited ); invalidDescriptor( session, trace, artifact, exception ); - if ( session.isIgnoreInvalidArtifactDescriptor() ) + if ( ( getPolicy( session, artifact, request ) & ArtifactDescriptorPolicy.IGNORE_INVALID ) != 0 ) { return null; } @@ -318,7 +320,7 @@ public class DefaultArtifactDescriptorReader if ( e.getCause() instanceof ArtifactNotFoundException ) { missingDescriptor( session, trace, artifact, (Exception) e.getCause() ); - if ( session.isIgnoreMissingArtifactDescriptor() ) + if ( ( getPolicy( session, artifact, request ) & ArtifactDescriptorPolicy.IGNORE_MISSING ) != 0 ) { return null; } @@ -363,7 +365,7 @@ public class DefaultArtifactDescriptorReader } } invalidDescriptor( session, trace, artifact, e ); - if ( session.isIgnoreInvalidArtifactDescriptor() ) + if ( ( getPolicy( session, artifact, request ) & ArtifactDescriptorPolicy.IGNORE_INVALID ) != 0 ) { return null; } @@ -488,4 +490,14 @@ public class DefaultArtifactDescriptorReader repositoryEventDispatcher.dispatch( event.build() ); } + private int getPolicy( RepositorySystemSession session, Artifact artifact, ArtifactDescriptorRequest request ) + { + ArtifactDescriptorPolicy policy = session.getArtifactDescriptorPolicy(); + if ( policy == null ) + { + return ArtifactDescriptorPolicy.STRICT; + } + return policy.getPolicy( session, new ArtifactDescriptorPolicyRequest( artifact, request.getRequestContext() ) ); + } + } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index 624e039e53..c88e341ff7 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -44,6 +44,7 @@ import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator; import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver; import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; +import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy; /** * A utility class to assist in setting up a Maven-like repository system. Note: This component is meant to @@ -121,8 +122,7 @@ public final class MavenRepositorySystemUtils stereotypes.add( new DefaultArtifactType( "par", "par", "", "java", false, true ) ); session.setArtifactTypeRegistry( stereotypes ); - session.setIgnoreInvalidArtifactDescriptor( true ); - session.setIgnoreMissingArtifactDescriptor( true ); + session.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, true ) ); Properties sysProps = System.getProperties(); session.setSystemProps( sysProps ); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java index 44c238244c..ead1d95d37 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java @@ -57,6 +57,7 @@ import org.eclipse.aether.util.graph.transformer.ConflictMarker; import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator; import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; +import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy; /** * @author Jason van Zyl @@ -339,8 +340,7 @@ public abstract class AbstractArtifactComponentTestCase throws Exception { DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); - session.setIgnoreMissingArtifactDescriptor( true ); - session.setIgnoreInvalidArtifactDescriptor( true ); + session.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, true ) ); DependencyTraverser depTraverser = new FatArtifactTraverser(); session.setDependencyTraverser( depTraverser ); 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 1e74cb7f8c..eae73b47e4 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -103,6 +103,7 @@ import org.eclipse.aether.util.repository.ChainedWorkspaceReader; import org.eclipse.aether.util.repository.DefaultAuthenticationSelector; import org.eclipse.aether.util.repository.DefaultMirrorSelector; import org.eclipse.aether.util.repository.DefaultProxySelector; +import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy; import org.eclipse.aether.util.repository.SimpleResolutionErrorPolicy; /** @@ -339,7 +340,7 @@ public class DefaultMaven session.setCache( request.getRepositoryCache() ); - session.setIgnoreInvalidArtifactDescriptor( true ).setIgnoreMissingArtifactDescriptor( true ); + session.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, true ) ); Map configProps = new LinkedHashMap(); configProps.put( ConfigurationProperties.USER_AGENT, getUserAgent() ); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java index 6d2b2ff894..c4b5fee0ea 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java @@ -58,6 +58,7 @@ import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; import org.eclipse.aether.util.filter.ScopeDependencyFilter; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; +import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy; /** * Assists in resolving the dependencies of a plugin. Warning: This is an internal utility class that @@ -98,8 +99,8 @@ public class DefaultPluginDependenciesResolver try { - RepositorySystemSession pluginSession = - new DefaultRepositorySystemSession( session ).setIgnoreMissingArtifactDescriptor( true ); + DefaultRepositorySystemSession pluginSession = new DefaultRepositorySystemSession( session ); + pluginSession.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, false ) ); ArtifactDescriptorRequest request = new ArtifactDescriptorRequest( pluginArtifact, repositories, REPOSITORY_CONTEXT ); From 03b0269579da71d4e977679e3ef272c443732718 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 18 Mar 2012 16:52:54 +0100 Subject: [PATCH 62/69] o Accounted for refactoring of aether-api --- .../repository/internal/MavenRepositorySystemUtils.java | 4 ++-- maven-core/src/main/java/org/apache/maven/DefaultMaven.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index c88e341ff7..d603638956 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -125,8 +125,8 @@ public final class MavenRepositorySystemUtils session.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, true ) ); Properties sysProps = System.getProperties(); - session.setSystemProps( sysProps ); - session.setConfigProps( sysProps ); + session.setSystemProperties( sysProps ); + session.setConfigProperties( sysProps ); return session; } 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 eae73b47e4..28769e73d3 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -463,9 +463,9 @@ public class DefaultMaven session.setRepositoryListener( eventSpyDispatcher.chainListener( new LoggingRepositoryListener( logger ) ) ); - session.setUserProps( request.getUserProperties() ); - session.setSystemProps( request.getSystemProperties() ); - session.setConfigProps( configProps ); + session.setUserProperties( request.getUserProperties() ); + session.setSystemProperties( request.getSystemProperties() ); + session.setConfigProperties( configProps ); return session; } From 28387451563d45dbc166df3d4b029b63a858c6ac Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Mon, 17 Sep 2012 00:05:23 +0200 Subject: [PATCH 63/69] o Accounted for refactoring of aether-api --- .../legacy/LegacyRepositorySystem.java | 26 +++++++++++++------ .../java/org/apache/maven/DefaultMaven.java | 18 +++++++------ .../org/apache/maven/RepositoryUtils.java | 12 ++++++--- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java b/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java index 366f8ce636..591debc049 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java @@ -74,6 +74,7 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationSelector; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RemoteRepository; @@ -583,13 +584,17 @@ public class LegacyRepositorySystem AuthenticationSelector selector = session.getAuthenticationSelector(); if ( selector != null ) { - org.eclipse.aether.repository.Authentication auth = - selector.getAuthentication( RepositoryUtils.toRepo( repository ) ); + RemoteRepository repo = RepositoryUtils.toRepo( repository ); + org.eclipse.aether.repository.Authentication auth = selector.getAuthentication( repo ); if ( auth != null ) { - Authentication result = new Authentication( auth.getUsername(), auth.getPassword() ); - result.setPrivateKey( auth.getPrivateKeyFile() ); - result.setPassphrase( auth.getPassphrase() ); + AuthenticationContext authCtx = AuthenticationContext.forRepository( session, repo ); + Authentication result = + new Authentication( authCtx.get( AuthenticationContext.USERNAME ), + authCtx.get( AuthenticationContext.PASSWORD ) ); + result.setPrivateKey( authCtx.get( AuthenticationContext.PRIVATE_KEY_PATH ) ); + result.setPassphrase( authCtx.get( AuthenticationContext.PRIVATE_KEY_PASSPHRASE ) ); + authCtx.close(); return result; } } @@ -688,7 +693,8 @@ public class LegacyRepositorySystem ProxySelector selector = session.getProxySelector(); if ( selector != null ) { - org.eclipse.aether.repository.Proxy proxy = selector.getProxy( RepositoryUtils.toRepo( repository ) ); + RemoteRepository repo = RepositoryUtils.toRepo( repository ); + org.eclipse.aether.repository.Proxy proxy = selector.getProxy( repo ); if ( proxy != null ) { Proxy p = new Proxy(); @@ -697,8 +703,12 @@ public class LegacyRepositorySystem p.setPort( proxy.getPort() ); if ( proxy.getAuthentication() != null ) { - p.setUserName( proxy.getAuthentication().getUsername() ); - p.setPassword( proxy.getAuthentication().getPassword() ); + AuthenticationContext authCtx = AuthenticationContext.forProxy( session, repo ); + p.setUserName( authCtx.get( AuthenticationContext.USERNAME ) ); + p.setPassword( authCtx.get( AuthenticationContext.PASSWORD ) ); + p.setNtlmDomain( authCtx.get( AuthenticationContext.NTLM_DOMAIN ) ); + p.setNtlmHost( authCtx.get( AuthenticationContext.NTLM_WORKSTATION ) ); + authCtx.close(); } return p; } 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 28769e73d3..b6f3f491ac 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -83,7 +83,6 @@ import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.collection.DependencyTraverser; -import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.repository.WorkspaceReader; @@ -99,6 +98,7 @@ import org.eclipse.aether.util.graph.transformer.ConflictMarker; import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator; import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; +import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.eclipse.aether.util.repository.ChainedWorkspaceReader; import org.eclipse.aether.util.repository.DefaultAuthenticationSelector; import org.eclipse.aether.util.repository.DefaultMirrorSelector; @@ -407,19 +407,21 @@ public class DefaultMaven DefaultProxySelector proxySelector = new DefaultProxySelector(); for ( Proxy proxy : decrypted.getProxies() ) { - Authentication proxyAuth = new Authentication( proxy.getUsername(), proxy.getPassword() ); - proxySelector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), - proxyAuth ), proxy.getNonProxyHosts() ); + AuthenticationBuilder authBuilder = new AuthenticationBuilder(); + authBuilder.username( proxy.getUsername() ).password( proxy.getPassword() ); + proxySelector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(), + proxy.getPort(), authBuilder.build() ), + proxy.getNonProxyHosts() ); } session.setProxySelector( proxySelector ); DefaultAuthenticationSelector authSelector = new DefaultAuthenticationSelector(); for ( Server server : decrypted.getServers() ) { - Authentication auth = - new Authentication( server.getUsername(), server.getPassword(), server.getPrivateKey(), - server.getPassphrase() ); - authSelector.add( server.getId(), auth ); + AuthenticationBuilder authBuilder = new AuthenticationBuilder(); + authBuilder.username( server.getUsername() ).password( server.getPassword() ); + authBuilder.privateKey( server.getPrivateKey(), server.getPassphrase() ); + authSelector.add( server.getId(), authBuilder.build() ); if ( server.getConfiguration() != null ) { diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java index 4ad30eab43..f07a377cf7 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -44,6 +44,7 @@ import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.util.repository.AuthenticationBuilder; /** * Warning: This is an internal utility class that is only public for technical reasons, it is not part @@ -247,8 +248,10 @@ public class RepositoryUtils Authentication result = null; if ( auth != null ) { - result = - new Authentication( auth.getUsername(), auth.getPassword(), auth.getPrivateKey(), auth.getPassphrase() ); + AuthenticationBuilder authBuilder = new AuthenticationBuilder(); + authBuilder.username( auth.getUsername() ).password( auth.getPassword() ); + authBuilder.privateKey( auth.getPrivateKey(), auth.getPassphrase() ); + result = authBuilder.build(); } return result; } @@ -258,8 +261,9 @@ public class RepositoryUtils Proxy result = null; if ( proxy != null ) { - Authentication auth = new Authentication( proxy.getUserName(), proxy.getPassword() ); - result = new Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), auth ); + AuthenticationBuilder authBuilder = new AuthenticationBuilder(); + authBuilder.username( proxy.getUserName() ).password( proxy.getPassword() ); + result = new Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), authBuilder.build() ); } return result; } From 42536ce88f252c032f1d73c3cbd0ec22f7c946cd Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 30 Sep 2012 17:37:09 +0200 Subject: [PATCH 64/69] Accounted for refactoring of aether-api --- .../internal/ArtifactDescriptorUtils.java | 10 +++++----- .../deployer/DefaultArtifactDeployer.java | 6 ++++-- .../java/org/apache/maven/DefaultMaven.java | 6 +++--- .../org/apache/maven/RepositoryUtils.java | 20 ++++++++++--------- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java index c4def8a1a3..85158037d6 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java @@ -49,11 +49,11 @@ public class ArtifactDescriptorUtils public static RemoteRepository toRemoteRepository( Repository repository ) { - RemoteRepository result = - new RemoteRepository( repository.getId(), repository.getLayout(), repository.getUrl() ); - result.setPolicy( true, toRepositoryPolicy( repository.getSnapshots() ) ); - result.setPolicy( false, toRepositoryPolicy( repository.getReleases() ) ); - return result; + RemoteRepository.Builder builder = + new RemoteRepository.Builder( repository.getId(), repository.getLayout(), repository.getUrl() ); + builder.setSnapshotPolicy( toRepositoryPolicy( repository.getSnapshots() ) ); + builder.setReleasePolicy( toRepositoryPolicy( repository.getReleases() ) ); + return builder.build(); } public static RepositoryPolicy toRepositoryPolicy( org.apache.maven.model.RepositoryPolicy policy ) diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java b/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java index 5905e084b4..abbab821a0 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java @@ -126,8 +126,10 @@ public class DefaultArtifactDeployer if ( deploymentRepository instanceof DefaultArtifactRepository && deploymentRepository.getAuthentication() == null ) { - remoteRepo.setAuthentication( session.getAuthenticationSelector().getAuthentication( remoteRepo ) ); - remoteRepo.setProxy( session.getProxySelector().getProxy( remoteRepo ) ); + RemoteRepository.Builder builder = new RemoteRepository.Builder( remoteRepo ); + builder.setAuthentication( session.getAuthenticationSelector().getAuthentication( remoteRepo ) ); + builder.setProxy( session.getProxySelector().getProxy( remoteRepo ) ); + remoteRepo = builder.build(); } request.setRepository( remoteRepo ); 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 b6f3f491ac..0e2ca6494b 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -408,7 +408,7 @@ public class DefaultMaven for ( Proxy proxy : decrypted.getProxies() ) { AuthenticationBuilder authBuilder = new AuthenticationBuilder(); - authBuilder.username( proxy.getUsername() ).password( proxy.getPassword() ); + authBuilder.addUsername( proxy.getUsername() ).addPassword( proxy.getPassword() ); proxySelector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), authBuilder.build() ), proxy.getNonProxyHosts() ); @@ -419,8 +419,8 @@ public class DefaultMaven for ( Server server : decrypted.getServers() ) { AuthenticationBuilder authBuilder = new AuthenticationBuilder(); - authBuilder.username( server.getUsername() ).password( server.getPassword() ); - authBuilder.privateKey( server.getPrivateKey(), server.getPassphrase() ); + authBuilder.addUsername( server.getUsername() ).addPassword( server.getPassword() ); + authBuilder.addPrivateKey( server.getPrivateKey(), server.getPassphrase() ); authSelector.add( server.getId(), authBuilder.build() ); if ( server.getConfiguration() != null ) diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java index f07a377cf7..9b68a2e62e 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -198,12 +198,14 @@ public class RepositoryUtils RemoteRepository result = null; if ( repo != null ) { - result = new RemoteRepository( repo.getId(), getLayout( repo ), repo.getUrl() ); - result.setPolicy( true, toPolicy( repo.getSnapshots() ) ); - result.setPolicy( false, toPolicy( repo.getReleases() ) ); - result.setAuthentication( toAuthentication( repo.getAuthentication() ) ); - result.setProxy( toProxy( repo.getProxy() ) ); - result.setMirroredRepositories( toRepos( repo.getMirroredRepositories() ) ); + RemoteRepository.Builder builder = + new RemoteRepository.Builder( repo.getId(), getLayout( repo ), repo.getUrl() ); + builder.setSnapshotPolicy( toPolicy( repo.getSnapshots() ) ); + builder.setReleasePolicy( toPolicy( repo.getReleases() ) ); + builder.setAuthentication( toAuthentication( repo.getAuthentication() ) ); + builder.setProxy( toProxy( repo.getProxy() ) ); + builder.setMirroredRepositories( toRepos( repo.getMirroredRepositories() ) ); + result = builder.build(); } return result; } @@ -249,8 +251,8 @@ public class RepositoryUtils if ( auth != null ) { AuthenticationBuilder authBuilder = new AuthenticationBuilder(); - authBuilder.username( auth.getUsername() ).password( auth.getPassword() ); - authBuilder.privateKey( auth.getPrivateKey(), auth.getPassphrase() ); + authBuilder.addUsername( auth.getUsername() ).addPassword( auth.getPassword() ); + authBuilder.addPrivateKey( auth.getPrivateKey(), auth.getPassphrase() ); result = authBuilder.build(); } return result; @@ -262,7 +264,7 @@ public class RepositoryUtils if ( proxy != null ) { AuthenticationBuilder authBuilder = new AuthenticationBuilder(); - authBuilder.username( proxy.getUserName() ).password( proxy.getPassword() ); + authBuilder.addUsername( proxy.getUserName() ).addPassword( proxy.getPassword() ); result = new Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), authBuilder.build() ); } return result; From 3df76ee227a93b5deeb184d1537f1e6f26c973b0 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 30 Sep 2012 21:09:51 +0200 Subject: [PATCH 65/69] Fixed auth retrieval --- .../apache/maven/repository/legacy/LegacyRepositorySystem.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java b/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java index 591debc049..6dd84dbc27 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java @@ -588,6 +588,7 @@ public class LegacyRepositorySystem org.eclipse.aether.repository.Authentication auth = selector.getAuthentication( repo ); if ( auth != null ) { + repo = new RemoteRepository.Builder( repo ).setAuthentication( auth ).build(); AuthenticationContext authCtx = AuthenticationContext.forRepository( session, repo ); Authentication result = new Authentication( authCtx.get( AuthenticationContext.USERNAME ), @@ -703,6 +704,7 @@ public class LegacyRepositorySystem p.setPort( proxy.getPort() ); if ( proxy.getAuthentication() != null ) { + repo = new RemoteRepository.Builder( repo ).setProxy( proxy ).build(); AuthenticationContext authCtx = AuthenticationContext.forProxy( session, repo ); p.setUserName( authCtx.get( AuthenticationContext.USERNAME ) ); p.setPassword( authCtx.get( AuthenticationContext.PASSWORD ) ); From 3916201b985c281a2b073b9b764bbb554584f5a7 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 29 Dec 2012 22:25:25 +0100 Subject: [PATCH 66/69] Used improved conflict resolver --- .../internal/MavenRepositorySystemUtils.java | 12 ++++++------ .../artifact/AbstractArtifactComponentTestCase.java | 12 ++++++------ .../src/main/java/org/apache/maven/DefaultMaven.java | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index d603638956..3e379f9efb 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -39,10 +39,11 @@ import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; import org.eclipse.aether.util.graph.selector.ScopeDependencySelector; import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; -import org.eclipse.aether.util.graph.transformer.ConflictMarker; +import org.eclipse.aether.util.graph.transformer.ConflictResolver; import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; -import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator; -import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver; +import org.eclipse.aether.util.graph.transformer.JavaScopeDeriver; +import org.eclipse.aether.util.graph.transformer.JavaScopeSelector; +import org.eclipse.aether.util.graph.transformer.NearestVersionSelector; import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy; @@ -102,9 +103,8 @@ public final class MavenRepositorySystemUtils session.setDependencySelector( depFilter ); DependencyGraphTransformer transformer = - new ChainedDependencyGraphTransformer( new ConflictMarker(), new JavaEffectiveScopeCalculator(), - new NearestVersionConflictResolver(), - new JavaDependencyContextRefiner() ); + new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), new JavaScopeDeriver() ); + new ChainedDependencyGraphTransformer( transformer, new JavaDependencyContextRefiner() ); session.setDependencyGraphTransformer( transformer ); DefaultArtifactTypeRegistry stereotypes = new DefaultArtifactTypeRegistry(); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java index ead1d95d37..d051575b82 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java @@ -52,10 +52,11 @@ import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; import org.eclipse.aether.util.graph.selector.ScopeDependencySelector; import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; -import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver; -import org.eclipse.aether.util.graph.transformer.ConflictMarker; +import org.eclipse.aether.util.graph.transformer.ConflictResolver; +import org.eclipse.aether.util.graph.transformer.JavaScopeDeriver; +import org.eclipse.aether.util.graph.transformer.JavaScopeSelector; import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; -import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator; +import org.eclipse.aether.util.graph.transformer.NearestVersionSelector; import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy; @@ -353,9 +354,8 @@ public abstract class AbstractArtifactComponentTestCase session.setDependencySelector( depFilter ); DependencyGraphTransformer transformer = - new ChainedDependencyGraphTransformer( new ConflictMarker(), new JavaEffectiveScopeCalculator(), - new NearestVersionConflictResolver(), - new JavaDependencyContextRefiner() ); + new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), new JavaScopeDeriver() ); + new ChainedDependencyGraphTransformer( transformer, new JavaDependencyContextRefiner() ); session.setDependencyGraphTransformer( transformer ); LocalRepository localRepo = new LocalRepository( localRepository().getBasedir() ); 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 0e2ca6494b..54e17265f7 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -93,10 +93,11 @@ import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; import org.eclipse.aether.util.graph.selector.ScopeDependencySelector; import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; -import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver; -import org.eclipse.aether.util.graph.transformer.ConflictMarker; +import org.eclipse.aether.util.graph.transformer.ConflictResolver; +import org.eclipse.aether.util.graph.transformer.JavaScopeDeriver; +import org.eclipse.aether.util.graph.transformer.JavaScopeSelector; import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; -import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator; +import org.eclipse.aether.util.graph.transformer.NearestVersionSelector; import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.eclipse.aether.util.repository.ChainedWorkspaceReader; @@ -456,9 +457,8 @@ public class DefaultMaven session.setDependencySelector( depFilter ); DependencyGraphTransformer transformer = - new ChainedDependencyGraphTransformer( new ConflictMarker(), new JavaEffectiveScopeCalculator(), - new NearestVersionConflictResolver(), - new JavaDependencyContextRefiner() ); + new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), new JavaScopeDeriver() ); + transformer = new ChainedDependencyGraphTransformer( transformer, new JavaDependencyContextRefiner() ); session.setDependencyGraphTransformer( transformer ); session.setTransferListener( request.getTransferListener() ); From 36bee64938e32f402b990c5f5ce036fcf8c1ca1e Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 29 Dec 2012 22:27:26 +0100 Subject: [PATCH 67/69] Added Aether's snapshot repo to ease building --- pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pom.xml b/pom.xml index cc57acbbd2..ba8322ac37 100644 --- a/pom.xml +++ b/pom.xml @@ -178,6 +178,15 @@ + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + false + true + + + From b5e0532310136be5bb7d518cec1c1fda90eb3fed Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 3 Feb 2013 20:44:44 +0100 Subject: [PATCH 68/69] Updated for latest ConflictResolver --- .../maven/repository/internal/MavenRepositorySystemUtils.java | 4 +++- .../maven/artifact/AbstractArtifactComponentTestCase.java | 4 +++- maven-core/src/main/java/org/apache/maven/DefaultMaven.java | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index 3e379f9efb..b7ed320158 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -44,6 +44,7 @@ import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; import org.eclipse.aether.util.graph.transformer.JavaScopeDeriver; import org.eclipse.aether.util.graph.transformer.JavaScopeSelector; import org.eclipse.aether.util.graph.transformer.NearestVersionSelector; +import org.eclipse.aether.util.graph.transformer.SimpleOptionalitySelector; import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy; @@ -103,7 +104,8 @@ public final class MavenRepositorySystemUtils session.setDependencySelector( depFilter ); DependencyGraphTransformer transformer = - new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), new JavaScopeDeriver() ); + new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), + new SimpleOptionalitySelector(), new JavaScopeDeriver() ); new ChainedDependencyGraphTransformer( transformer, new JavaDependencyContextRefiner() ); session.setDependencyGraphTransformer( transformer ); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java index d051575b82..09cebe8bcc 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java @@ -57,6 +57,7 @@ import org.eclipse.aether.util.graph.transformer.JavaScopeDeriver; import org.eclipse.aether.util.graph.transformer.JavaScopeSelector; import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; import org.eclipse.aether.util.graph.transformer.NearestVersionSelector; +import org.eclipse.aether.util.graph.transformer.SimpleOptionalitySelector; import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy; @@ -354,7 +355,8 @@ public abstract class AbstractArtifactComponentTestCase session.setDependencySelector( depFilter ); DependencyGraphTransformer transformer = - new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), new JavaScopeDeriver() ); + new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), + new SimpleOptionalitySelector(), new JavaScopeDeriver() ); new ChainedDependencyGraphTransformer( transformer, new JavaDependencyContextRefiner() ); session.setDependencyGraphTransformer( transformer ); 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 54e17265f7..49d0035807 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -98,6 +98,7 @@ import org.eclipse.aether.util.graph.transformer.JavaScopeDeriver; import org.eclipse.aether.util.graph.transformer.JavaScopeSelector; import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; import org.eclipse.aether.util.graph.transformer.NearestVersionSelector; +import org.eclipse.aether.util.graph.transformer.SimpleOptionalitySelector; import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser; import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.eclipse.aether.util.repository.ChainedWorkspaceReader; @@ -457,7 +458,8 @@ public class DefaultMaven session.setDependencySelector( depFilter ); DependencyGraphTransformer transformer = - new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), new JavaScopeDeriver() ); + new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), + new SimpleOptionalitySelector(), new JavaScopeDeriver() ); transformer = new ChainedDependencyGraphTransformer( transformer, new JavaDependencyContextRefiner() ); session.setDependencyGraphTransformer( transformer ); From 4fdcdbd26244ff81e242054fd38cf415d92499be Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 10 Feb 2013 19:11:11 +0100 Subject: [PATCH 69/69] Followed change to DependencyNode.getPremanaged*() --- .../DefaultPluginDependenciesResolver.java | 10 ---------- .../DefaultProjectDependenciesResolver.java | 20 +++++++++++++++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java index c4b5fee0ea..8153aed8e7 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java @@ -228,16 +228,6 @@ public class DefaultPluginDependenciesResolver buffer.append( art ); buffer.append( ':' ).append( dep.getScope() ); - - if ( node.getPremanagedScope() != null && !node.getPremanagedScope().equals( dep.getScope() ) ) - { - buffer.append( " (scope managed from " ).append( node.getPremanagedScope() ).append( ")" ); - } - - if ( node.getPremanagedVersion() != null && !node.getPremanagedVersion().equals( art.getVersion() ) ) - { - buffer.append( " (version managed from " ).append( node.getPremanagedVersion() ).append( ")" ); - } } logger.debug( buffer.toString() ); 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 47f510b873..2a6be6d23b 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 @@ -34,6 +34,7 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; +import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; @@ -49,6 +50,7 @@ import org.eclipse.aether.resolution.ArtifactResult; import org.eclipse.aether.resolution.DependencyRequest; import org.eclipse.aether.util.artifact.ArtifactIdUtils; import org.eclipse.aether.util.artifact.JavaScopes; +import org.eclipse.aether.util.graph.manager.DependencyManagerUtils; /** * @author Benjamin Bentmann @@ -73,11 +75,19 @@ public class DefaultProjectDependenciesResolver MavenProject project = request.getMavenProject(); RepositorySystemSession session = request.getRepositorySession(); + if ( logger.isDebugEnabled() + && session.getConfigProperties().get( DependencyManagerUtils.CONFIG_PROP_VERBOSE ) == null ) + { + DefaultRepositorySystemSession verbose = new DefaultRepositorySystemSession( session ); + verbose.setConfigProperty( DependencyManagerUtils.CONFIG_PROP_VERBOSE, Boolean.TRUE ); + session = verbose; + } DependencyFilter filter = request.getResolutionFilter(); ArtifactTypeRegistry stereotypes = session.getArtifactTypeRegistry(); CollectRequest collect = new CollectRequest(); + collect.setRootArtifact( RepositoryUtils.toArtifact( project.getArtifact() ) ); collect.setRequestContext( "project" ); collect.setRepositories( project.getRemoteProjectRepositories() ); @@ -235,16 +245,18 @@ public class DefaultProjectDependenciesResolver buffer.append( art ); buffer.append( ':' ).append( dep.getScope() ); - if ( node.getPremanagedScope() != null && !node.getPremanagedScope().equals( dep.getScope() ) ) + String premanagedScope = DependencyManagerUtils.getPremanagedScope( node ); + if ( premanagedScope != null && !premanagedScope.equals( dep.getScope() ) ) { - buffer.append( " (scope managed from " ).append( node.getPremanagedScope() ); + buffer.append( " (scope managed from " ).append( premanagedScope ); appendManagementSource( buffer, art, "scope" ); buffer.append( ")" ); } - if ( node.getPremanagedVersion() != null && !node.getPremanagedVersion().equals( art.getVersion() ) ) + String premanagedVersion = DependencyManagerUtils.getPremanagedVersion( node ); + if ( premanagedVersion != null && !premanagedVersion.equals( art.getVersion() ) ) { - buffer.append( " (version managed from " ).append( node.getPremanagedVersion() ); + buffer.append( " (version managed from " ).append( premanagedVersion ); appendManagementSource( buffer, art, "version" ); buffer.append( ")" ); }