maven-surefire git commit: [SUREFIRE-1341] Documentation of configuration parameters in Failsafe should mention IT instead or Test.java
Repository: maven-surefire Updated Branches: refs/heads/master 332b19fa2 -> f4d54fac0 [SUREFIRE-1341] Documentation of configuration parameters in Failsafe should mention IT instead or Test.java Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/f4d54fac Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/f4d54fac Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/f4d54fac Branch: refs/heads/master Commit: f4d54fac09f768fc352a1d0c59a6f05a66982183 Parents: 332b19f Author: Tibor17 Authored: Thu Mar 9 01:39:46 2017 +0100 Committer: Tibor17 Committed: Thu Mar 9 01:39:46 2017 +0100 -- .../maven/plugin/failsafe/IntegrationTestMojo.java | 16 1 file changed, 8 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/f4d54fac/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java -- diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java index 2d78109..51c36ee 100644 --- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java +++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java @@ -86,13 +86,13 @@ public class IntegrationTestMojo /** * Specify this parameter to run individual tests by file name, overriding the includes/excludes * parameters. Each pattern you specify here will be used to create an include pattern formatted like - * **/${test}.java, so you can just type "-Dit.test=MyTest" to run a single test called - * "foo/MyTest.java". + * **/${it.test}.java, so you can just type "-Dit.test=MyIT" to run a single test called + * "foo/MyIT.java". * This parameter overrides the includes/excludes parameters, and the TestNG suiteXmlFiles * parameter. * * Since 2.7.3 You can execute a limited number of methods in the test with adding #myMethod or #my*ethod. E.g. type - * "-Dit.test=MyTest#myMethod" supported for junit 4.x and testNg + * "-Dit.test=MyIT#myMethod" supported for junit 4.x and testNg * * Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): * "-Dit.test=???IT, !Unstable*, pkg/**/Ci*leIT.java, *IT#test*One+testTwo?, #fast*+slowTest" @@ -306,9 +306,9 @@ public class IntegrationTestMojo /** * A file containing include patterns. Blank lines, or lines starting with # are ignored. If {@code includes} are * also specified, these patterns are appended. Example with path, simple and regex includes: - * */test/* + * */it/* * **/NotIncludedByDefault.java - * %regex[.*Test.*|.*Not.*] + * %regex[.*IT.*|.*Not.*] */ @Parameter( property = "failsafe.includesFile" ) private File includesFile; @@ -316,9 +316,9 @@ public class IntegrationTestMojo /** * A file containing exclude patterns. Blank lines, or lines starting with # are ignored. If {@code excludes} are * also specified, these patterns are appended. Example with path, simple and regex excludes: - * */test/* - * **/DontRunTest.* - * %regex[.*Test.*|.*Not.*] + * */it/* + * **/DontRunIT.* + * %regex[.*IT.*|.*Not.*] */ @Parameter( property = "failsafe.excludesFile" ) private File excludesFile;
maven git commit: [MNG-6078] Confirm commons-cli 1.4-SNAPSHOT before official release
Repository: maven Updated Branches: refs/heads/MNG-6078 [created] d0d34dfd4 refs/heads/MNG-6181 [created] e0da20a1f [MNG-6078] Confirm commons-cli 1.4-SNAPSHOT before official release Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/d0d34dfd Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/d0d34dfd Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/d0d34dfd Branch: refs/heads/MNG-6078 Commit: d0d34dfd416acf138e206c6bdf38b41ff43b0cc8 Parents: 34afec6 Author: rfscholte Authored: Wed Mar 8 21:38:08 2017 +0100 Committer: rfscholte Committed: Wed Mar 8 21:38:08 2017 +0100 -- .../java/org/apache/maven/cli/MavenCli.java | 42 ++- .../org/apache/maven/cli/MergedCommandLine.java | 75 pom.xml | 2 +- 3 files changed, 42 insertions(+), 77 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/d0d34dfd/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java -- diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 8d38ab0..0ac416a 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 @@ -23,6 +23,7 @@ import com.google.common.base.Charsets; import com.google.common.io.Files; import com.google.inject.AbstractModule; import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Option; import org.apache.commons.cli.ParseException; import org.apache.commons.cli.UnrecognizedOptionException; import org.apache.maven.BuildAbort; @@ -421,7 +422,7 @@ public class MavenCli } else { -cliRequest.commandLine = new MergedCommandLine( cliManager.parse( cliRequest.args ), mavenConfig ); +cliRequest.commandLine = cliMerge( cliManager.parse( cliRequest.args ), mavenConfig ); } } catch ( ParseException e ) @@ -444,6 +445,45 @@ public class MavenCli } } +private CommandLine cliMerge( CommandLine mavenArgs, CommandLine mavenConfig ) +{ +CommandLine.Builder commandLineBuilder = new CommandLine.Builder(); + +// the args are easy, cli first then config file +for ( String arg : mavenArgs.getArgs() ) +{ +commandLineBuilder.addArg( arg ); +} +for ( String arg : mavenConfig.getArgs() ) +{ +commandLineBuilder.addArg( arg ); +} + +// now add all options, except for -D with cli first then config file +List setPropertyOptions = new ArrayList<>(); +for ( Option opt : mavenArgs.getOptions() ) +{ +if ( String.valueOf( CLIManager.SET_SYSTEM_PROPERTY ).equals( opt.getOpt() ) ) +{ +setPropertyOptions.add( opt ); +} +else +{ +commandLineBuilder.addOption( opt ); +} +} +for ( Option opt : mavenConfig.getOptions() ) +{ +commandLineBuilder.addOption( opt ); +} +// finally add the CLI system properties +for ( Option opt : setPropertyOptions ) +{ +commandLineBuilder.addOption( opt ); +} +return commandLineBuilder.build(); +} + /** * configure logging */ http://git-wip-us.apache.org/repos/asf/maven/blob/d0d34dfd/maven-embedder/src/main/java/org/apache/maven/cli/MergedCommandLine.java -- diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MergedCommandLine.java b/maven-embedder/src/main/java/org/apache/maven/cli/MergedCommandLine.java deleted file mode 100644 index cb0a587..000 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MergedCommandLine.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.apache.maven.cli; - -/* - * 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 impl
maven-integration-testing git commit: [MNG-6057], [MNG-6090], [MNG-5895] o Added IT's for MNG-5895, MNG-6057, MNG-6090 [Forced Update!]
Repository: maven-integration-testing Updated Branches: refs/heads/MNG-6057 e882d83e6 -> c066c2f3f (forced update) [MNG-6057], [MNG-6090], [MNG-5895] o Added IT's for MNG-5895, MNG-6057, MNG-6090 Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/c066c2f3 Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/c066c2f3 Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/c066c2f3 Branch: refs/heads/MNG-6057 Commit: c066c2f3f013b0b1d302ad44b3cbf8a6d9eea78f Parents: c68f707 Author: Karl Heinz Marbaise Authored: Wed Mar 8 00:12:31 2017 +0100 Committer: Karl Heinz Marbaise Committed: Wed Mar 8 21:04:14 2017 +0100 -- .gitignore | 1 + .../apache/maven/it/IntegrationTestSuite.java | 3 + ...Tmng5895CIFriendlyUsageWithPropertyTest.java | 70 +++ .../it/MavenITmng6057CheckReactorOrderTest.java | 119 +++ .../maven/it/MavenITmng6090CIFriendlyTest.java | 80 + .../module-1/pom.xml| 33 + .../module-2/pom.xml| 33 + .../module-3/jar-with-prod.xml | 17 +++ .../module-3/pom.xml| 57 + .../pom.xml | 39 ++ .../module-1/pom.xml| 34 ++ .../module-2/pom.xml| 40 +++ .../mng-6057-check-reactor-order/pom.xml| 35 ++ .../mng-6090-ci-friendly/module-1/pom.xml | 33 + .../mng-6090-ci-friendly/module-2/pom.xml | 33 + .../module-3/jar-with-prod.xml | 17 +++ .../mng-6090-ci-friendly/module-3/pom.xml | 57 + .../test/resources/mng-6090-ci-friendly/pom.xml | 68 +++ 18 files changed, 769 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c066c2f3/.gitignore -- diff --git a/.gitignore b/.gitignore index fa65a79..5fb5e3a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ bin .DS_Store .idea jvz-* +.flattened-pom.xml http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c066c2f3/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java -- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index 272a859..bbc7c9e 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -106,6 +106,9 @@ public class IntegrationTestSuite // - // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 +suite.addTestSuite( MavenITmng6057CheckReactorOrderTest.class ); +suite.addTestSuite( MavenITmng5895CIFriendlyUsageWithPropertyTest.class ); +suite.addTestSuite( MavenITmng6090CIFriendlyTest.class ); suite.addTestSuite( MavenITmng6173GetProjectsAndDependencyGraphTest.class ); suite.addTestSuite( MavenITmng6173GetAllProjectsInReactorTest.class ); suite.addTestSuite( MavenITmng5958LifecyclePhaseBinaryCompat.class ); http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c066c2f3/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java -- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java new file mode 100644 index 000..7d13fd4 --- /dev/null +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java @@ -0,0 +1,70 @@ +package org.apache.maven.it; + +/* + * 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 un
[2/3] maven git commit: [MNG-6183] Dependency management debug message enhancements.
[MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/MNG-6057 Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[1/3] maven git commit: [MNG-6182] ModelResolver interface enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/MNG-6057 fd4f1efa0 -> bb722723e (forced update) [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/MNG-6057 Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroupId(), parent
[3/3] maven git commit: [MNG-6090] CI friendly properties break submodule builds [MNG-6057] Problem with CI friendly usage of ${..} reactor order is changed o Based on the missing replacement of the v
[MNG-6090] CI friendly properties break submodule builds [MNG-6057] Problem with CI friendly usage of ${..} reactor order is changed o Based on the missing replacement of the versions ${revision} ${changelist} or ${sha1} within the parent element the order of the reactor changes. [MNG-5895] Problem with CI friendly usage of ${..} which is already defined via property in pom file. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/bb722723 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/bb722723 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/bb722723 Branch: refs/heads/MNG-6057 Commit: bb722723e55b19b9daa7feb1e87d4826c22d275f Parents: 34afec6 Author: Karl Heinz Marbaise Authored: Tue Sep 29 11:46:48 2015 +0200 Committer: Karl Heinz Marbaise Committed: Wed Mar 8 20:57:43 2017 +0100 -- .../resolver/DefaultArtifactResolver.java | 46 .../model/building/DefaultModelBuilder.java | 35 +-- .../AbstractStringBasedModelInterpolator.java | 33 +++--- 3 files changed, 77 insertions(+), 37 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/bb722723/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java -- diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java index b78846b..93a5919 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 @@ -22,10 +22,12 @@ package org.apache.maven.artifact.resolver; import java.io.File; import java.util.ArrayList; import java.util.Collections; +import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; @@ -149,21 +151,21 @@ public class DefaultArtifactResolver public void resolve( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository, TransferListener resolutionListener ) - throws ArtifactResolutionException, ArtifactNotFoundException +throws ArtifactResolutionException, ArtifactNotFoundException { resolve( artifact, remoteRepositories, getSession( localRepository ) ); } public void resolveAlways( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository ) - throws ArtifactResolutionException, ArtifactNotFoundException +throws ArtifactResolutionException, ArtifactNotFoundException { resolve( artifact, remoteRepositories, getSession( localRepository ) ); } private void resolve( Artifact artifact, List remoteRepositories, RepositorySystemSession session ) - throws ArtifactResolutionException, ArtifactNotFoundException +throws ArtifactResolutionException, ArtifactNotFoundException { if ( artifact == null ) { @@ -255,8 +257,7 @@ public class DefaultArtifactResolver ArtifactRepository localRepository, List remoteRepositories, ArtifactMetadataSource source, ArtifactFilter filter ) - throws ArtifactResolutionException, - ArtifactNotFoundException +throws ArtifactResolutionException, ArtifactNotFoundException { return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository, remoteRepositories, source, filter ); @@ -268,8 +269,7 @@ public class DefaultArtifactResolver ArtifactRepository localRepository, List remoteRepositories, ArtifactMetadataSource source ) - throws ArtifactResolutionException, - ArtifactNotFoundException +throws ArtifactResolutionException, ArtifactNotFo
[2/5] maven git commit: [MNG-1577] dependencyManagement does not work for transitive dependencies
[MNG-1577] dependencyManagement does not work for transitive dependencies o Updated to correct an incorrect test case. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/c7736ec4 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/c7736ec4 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/c7736ec4 Branch: refs/heads/DEPMGMT Commit: c7736ec46326d3704ebeaced9199e0b640057163 Parents: 50f8aa7 Author: Christian Schulte Authored: Wed Feb 3 19:17:02 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:48:20 2017 +0100 -- maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml | 2 -- maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml| 2 -- 2 files changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/c7736ec4/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml -- diff --git a/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml b/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml index 4686219..2ac9544 100644 --- a/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml +++ b/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml @@ -24,8 +24,6 @@ maven-test t06-d 1.0 -test -false http://git-wip-us.apache.org/repos/asf/maven/blob/c7736ec4/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml -- diff --git a/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml b/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml index 60c540c..6a66cd1 100644 --- a/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml +++ b/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml @@ -29,8 +29,6 @@ maven-test t06-d 1.2 -test -false
[3/5] maven git commit: [MNG-5935] Optional true getting lost in managed dependencies when transitive
[MNG-5935] Optional true getting lost in managed dependencies when transitive Updated to correctly map the optional flag of Maven model dependencies to Aether dependencies. Prior to this change all managed dependencies implicitly had the optional flag set to 'false' leading to Aether managing that flag to 'false' on all managed dependencies when transitive. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/50f8aa7b Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/50f8aa7b Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/50f8aa7b Branch: refs/heads/DEPMGMT Commit: 50f8aa7b5b7b94ddbf740ed3617855fd78ce9181 Parents: c2e631f Author: Christian Schulte Authored: Thu Feb 11 08:45:19 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:48:20 2017 +0100 -- .../src/main/java/org/apache/maven/RepositoryUtils.java | 7 ++- .../repository/internal/ArtifactDescriptorReaderDelegate.java | 6 +- 2 files changed, 11 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/50f8aa7b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java -- 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 86eab4e..52442b7 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -316,7 +316,12 @@ public class RepositoryUtils exclusions.add( toExclusion( exclusion ) ); } -Dependency result = new Dependency( artifact, dependency.getScope(), dependency.isOptional(), exclusions ); +Dependency result = new Dependency( artifact, +dependency.getScope(), +dependency.getOptional() != null +? dependency.isOptional() +: null, +exclusions ); return result; } http://git-wip-us.apache.org/repos/asf/maven/blob/50f8aa7b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java index 53c0475..a5e2ffd 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java @@ -124,7 +124,11 @@ public class ArtifactDescriptorReaderDelegate exclusions.add( convert( exclusion ) ); } -Dependency result = new Dependency( artifact, dependency.getScope(), dependency.isOptional(), exclusions ); +Dependency result = new Dependency( artifact, dependency.getScope(), +dependency.getOptional() != null +? dependency.isOptional() +: null, +exclusions ); return result; }
[1/5] maven git commit: [MNG-5227] The 'optional' flag of a dependency should be manageable. [Forced Update!]
Repository: maven Updated Branches: refs/heads/DEPMGMT f99ff62f0 -> d8d67e6a7 (forced update) [MNG-5227] The 'optional' flag of a dependency should be manageable. o Updated to add missing management of the optional flag to the ModelBuilder. The Maven resolver has been managing the optional flag since years. This just adds the missing parts to the ModelBuilder to make optional flag management consistent when building the effective model no matter if resolved or if build. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/c2e631ff Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/c2e631ff Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/c2e631ff Branch: refs/heads/DEPMGMT Commit: c2e631ff276138c57e994e18bc84a4bf3155b79c Parents: a98321e Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:46:53 2017 +0100 -- .../model/management/DefaultDependencyManagementInjector.java | 7 --- 1 file changed, 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/c2e631ff/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java index e611973..731cdd8 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java @@ -82,13 +82,6 @@ public class DefaultDependencyManagementInjector } @Override -protected void mergeDependency_Optional( Dependency target, Dependency source, boolean sourceDominant, - Map context ) -{ -// optional flag is not managed -} - -@Override protected void mergeDependency_Exclusions( Dependency target, Dependency source, boolean sourceDominant, Map context ) {
[5/5] maven git commit: [MNG-6135] Maven plugins and core extensions are not dependencies, they should be resolved the same way as projects.
[MNG-6135] Maven plugins and core extensions are not dependencies, they should be resolved the same way as projects. o Updated to use the '' element to decide the style of resolution as discussed on dev@. Plugins with prerequisites >= 3.6 get the correct resolution, all other plugins will be resolved with direct 'test' and 'provided' dependencies ignored but direct 'optional' dependencies. o During working on MNG-6135, it turned out that plugin dependency management also is applied to the dependencies declared for a plugin using the 'plugins/plugin/dependencies/dependency' element. Dependencies declared that way must not be overridden by any management. I added management for 'plexus-utils' in the core IT suite. This immediately made the ITs for MNG-4276 and MNG-4274 fail, because 'plexus-utils' got subject to management although a different version has been declared in the plugin declaration. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/d8d67e6a Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/d8d67e6a Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/d8d67e6a Branch: refs/heads/DEPMGMT Commit: d8d67e6a72cf20bf1d487d9b5429e87156490864 Parents: a991829 Author: Christian Schulte Authored: Sat Dec 17 03:07:04 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:48:21 2017 +0100 -- .../java/org/apache/maven/RepositoryUtils.java | 12 +- .../DefaultPluginDependenciesResolver.java | 370 --- .../plugin/internal/PlexusUtilsInjector.java| 30 +- .../maven/plugin/internal/WagonExcluder.java| 14 +- 4 files changed, 344 insertions(+), 82 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/d8d67e6a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java -- 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 52442b7..08749ea 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -114,12 +114,16 @@ public class RepositoryUtils List nodeTrail = new ArrayList<>( trail.size() + 1 ); nodeTrail.addAll( trail ); -nodeTrail.add( artifact.getId() ); -if ( filter == null || filter.accept( node, Collections.emptyList() ) ) +if ( artifact != null ) { -artifact.setDependencyTrail( nodeTrail ); -artifacts.add( artifact ); +nodeTrail.add( artifact.getId() ); + +if ( filter == null || filter.accept( node, Collections.emptyList() ) ) +{ +artifact.setDependencyTrail( nodeTrail ); +artifacts.add( artifact ); +} } toArtifacts( artifacts, node.getChildren(), nodeTrail, filter ); http://git-wip-us.apache.org/repos/asf/maven/blob/d8d67e6a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java -- 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 b79b15f..80fd80d 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 @@ -20,10 +20,11 @@ package org.apache.maven.plugin.internal; */ import java.util.LinkedHashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; - import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.versioning.ComparableVersion; import org.apache.maven.model.Dependency; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.PluginResolutionException; @@ -37,8 +38,11 @@ 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.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.collection.DependencyManagement; +import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyN
[4/5] maven git commit: [MNG-5761] Dependency management is not transitive.
[MNG-5761] Dependency management is not transitive. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/a9918298 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/a9918298 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/a9918298 Branch: refs/heads/DEPMGMT Commit: a99182986fabfcf32d840271e10d8c97181f4a55 Parents: c7736ec Author: Christian Schulte Authored: Tue Dec 13 22:35:13 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:48:21 2017 +0100 -- .../maven/artifact/AbstractArtifactComponentTestCase.java | 4 ++-- .../maven/repository/internal/MavenRepositorySystemUtils.java | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/a9918298/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java -- 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 0cdea19..8e054e5 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 @@ -39,7 +39,7 @@ 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.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; @@ -349,7 +349,7 @@ public abstract class AbstractArtifactComponentTestCase DependencyTraverser depTraverser = new FatArtifactTraverser(); session.setDependencyTraverser( depTraverser ); -DependencyManager depManager = new ClassicDependencyManager(); +DependencyManager depManager = new TransitiveDependencyManager(); session.setDependencyManager( depManager ); DependencySelector depFilter = new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ), http://git-wip-us.apache.org/repos/asf/maven/blob/a9918298/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index 1b11cb3..f6aeb11 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -20,7 +20,6 @@ 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; @@ -33,7 +32,7 @@ import org.eclipse.aether.impl.MetadataGeneratorFactory; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.util.artifact.DefaultArtifactTypeRegistry; -import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; @@ -95,7 +94,7 @@ public final class MavenRepositorySystemUtils DependencyTraverser depTraverser = new FatArtifactTraverser(); session.setDependencyTraverser( depTraverser ); -DependencyManager depManager = new ClassicDependencyManager(); +DependencyManager depManager = new TransitiveDependencyManager(); session.setDependencyManager( depManager ); DependencySelector depFilter =
[3/3] maven git commit: [MNG-6164] Collections inconsistently immutable.
[MNG-6164] Collections inconsistently immutable. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/c013c0ee Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/c013c0ee Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/c013c0ee Branch: refs/heads/MNG-6164 Commit: c013c0ee6fc1f6380b71c9e04719cc5af204183f Parents: 34afec6 Author: Christian Schulte Authored: Mon Dec 14 04:57:47 2015 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:43:35 2017 +0100 -- .../apache/maven/artifact/DefaultArtifact.java | 2 +- .../maven/artifact/versioning/VersionRange.java | 2 +- .../repository/DefaultArtifactRepository.java | 2 +- .../repository/MetadataResolutionResult.java| 27 ++-- .../repository/MavenArtifactRepository.java | 2 +- .../resolver/ArtifactResolutionResult.java | 27 ++-- .../maven/artifact/resolver/ResolutionNode.java | 1 + .../maven/exception/ExceptionSummary.java | 5 +++- .../execution/DefaultMavenExecutionResult.java | 6 +++-- .../maven/lifecycle/internal/MojoExecutor.java | 18 +++-- .../internal/DefaultMavenPluginManager.java | 2 +- .../prefix/DefaultPluginPrefixRequest.java | 4 +-- .../version/DefaultPluginVersionRequest.java| 2 +- .../DefaultDependencyResolutionResult.java | 5 +++- .../maven/project/DefaultProjectBuilder.java| 3 ++- .../maven/project/DefaultProjectRealmCache.java | 4 ++- .../org/apache/maven/project/MavenProject.java | 19 +++--- .../maven/project/artifact/ProjectArtifact.java | 7 +++-- .../java/org/apache/maven/cli/MavenCli.java | 4 ++- .../model/building/ModelBuildingException.java | 2 +- 20 files changed, 92 insertions(+), 52 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/c013c0ee/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java -- diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java b/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java index bd2e8ed..a6d1367 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java @@ -272,7 +272,7 @@ public class DefaultArtifact return Collections.emptyList(); } -return metadataMap.values(); +return Collections.unmodifiableCollection( metadataMap.values() ); } // -- http://git-wip-us.apache.org/repos/asf/maven/blob/c013c0ee/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java -- diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java index 502b0e7..8cccb44 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java @@ -261,7 +261,7 @@ public class VersionRange } else { -restrictions = intersection( r1, r2 ); +restrictions = Collections.unmodifiableList( intersection( r1, r2 ) ); } ArtifactVersion version = null; http://git-wip-us.apache.org/repos/asf/maven/blob/c013c0ee/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java -- diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java b/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java index f5db5ef..16b82c5 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java @@ -256,7 +256,7 @@ public class DefaultArtifactRepository { if ( mirroredRepositories != null ) { -this.mirroredRepositories = mirroredRepositories; +this.mirroredRepositories = Collections.unmodifiableList( mirroredRepositories ); } else { http://git-wip-us.apache.org/repos/asf/maven/blob/c013c0ee/maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java -- diff --git a/maven-compat/src/main/java/org/apache/maven/repository/MetadataRe
[2/3] maven git commit: [MNG-6183] Dependency management debug message enhancements.
[MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/MNG-6164 Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[1/3] maven git commit: [MNG-6182] ModelResolver interface enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/MNG-6164 a8d5f3bed -> c013c0ee6 (forced update) [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/MNG-6164 Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroupId(), parent
[3/3] maven git commit: [MNG-6114] Profiles from the global settings should be ordered before profiles from the user settings.
[MNG-6114] Profiles from the global settings should be ordered before profiles from the user settings. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/6d17c079 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/6d17c079 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/6d17c079 Branch: refs/heads/MNG-6114 Commit: 6d17c0796c751f723c0e748d3fa8bb4df893ff59 Parents: 34afec6 Author: Christian Schulte Authored: Sat Nov 12 21:06:19 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:43:14 2017 +0100 -- .../org/apache/maven/settings/merge/MavenSettingsMerger.java| 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/6d17c079/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java -- diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java index 8d9f67b..cb5f6c1 100644 --- a/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java +++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java @@ -111,6 +111,7 @@ public class MavenSettingsMerger String recessiveSourceLevel ) { Map dominantById = mapById( dominant ); +final List identifiables = new ArrayList<>( recessive.size() ); for ( T identifiable : recessive ) { @@ -118,9 +119,11 @@ public class MavenSettingsMerger { identifiable.setSourceLevel( recessiveSourceLevel ); -dominant.add( identifiable ); +identifiables.add( identifiable ); } } + +dominant.addAll( 0, identifiables ); } /**
[1/3] maven git commit: [MNG-6182] ModelResolver interface enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/MNG-6114 85cd59bf8 -> 6d17c0796 (forced update) [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/MNG-6114 Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroupId(), parent
[2/3] maven git commit: [MNG-6183] Dependency management debug message enhancements.
[MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/MNG-6114 Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[3/4] maven git commit: [MNG-5984] Maven core extension resolution ignores repositories from activeByDefault profiles in settings.xml
[MNG-5984] Maven core extension resolution ignores repositories from activeByDefault profiles in settings.xml Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/10782f6c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/10782f6c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/10782f6c Branch: refs/heads/MNG-5984 Commit: 10782f6c762c7a2a21328c6326b5e569a768d982 Parents: 34afec6 Author: Christian Schulte Authored: Thu Feb 25 19:46:13 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:42:44 2017 +0100 -- .../apache/maven/settings/SettingsUtils.java| 2 +- .../java/org/apache/maven/cli/MavenCli.java | 158 --- .../SettingsXmlConfigurationProcessor.java | 65 ++-- 3 files changed, 152 insertions(+), 73 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/10782f6c/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java -- diff --git a/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java b/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java index 8da696e..16ccdb6 100644 --- a/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java +++ b/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java @@ -139,7 +139,7 @@ public final class SettingsUtils profile.setId( settingsProfile.getId() ); -profile.setSource( "settings.xml" ); +profile.setSource( org.apache.maven.model.Profile.SOURCE_SETTINGS ); Activation settingsActivation = settingsProfile.getActivation(); http://git-wip-us.apache.org/repos/asf/maven/blob/10782f6c/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java -- diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 8d38ab0..27f86d8 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 @@ -19,6 +19,28 @@ package org.apache.maven.cli; * under the License. */ +import java.io.BufferedInputStream; +import java.io.Console; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import com.google.common.base.Charsets; import com.google.common.io.Files; import com.google.inject.AbstractModule; @@ -28,6 +50,8 @@ import org.apache.commons.cli.UnrecognizedOptionException; import org.apache.maven.BuildAbort; import org.apache.maven.InternalErrorException; import org.apache.maven.Maven; +import org.apache.maven.artifact.InvalidRepositoryException; +import org.apache.maven.bridge.MavenRepositorySystem; import org.apache.maven.building.FileSource; import org.apache.maven.building.Problem; import org.apache.maven.building.Source; @@ -58,7 +82,15 @@ import org.apache.maven.execution.MavenExecutionResult; import org.apache.maven.extension.internal.CoreExports; import org.apache.maven.extension.internal.CoreExtensionEntry; import org.apache.maven.lifecycle.LifecycleExecutionException; +import org.apache.maven.model.Profile; +import org.apache.maven.model.Repository; +import org.apache.maven.model.building.DefaultModelProblem; +import org.apache.maven.model.building.ModelProblem; +import org.apache.maven.model.building.ModelProblemCollector; +import org.apache.maven.model.building.ModelProblemCollectorRequest; import org.apache.maven.model.building.ModelProcessor; +import org.apache.maven.model.profile.DefaultProfileActivationContext; +import org.apache.maven.model.profile.ProfileSelector; import org.apache.maven.project.MavenProject; import org.apache.maven.properties.internal.EnvironmentUtils; import org.apache.maven.properties.internal.SystemProperties; @@ -89,28 +121,6 @@ import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; import org.sonatype.plexus.components.sec.dispatcher.SecUtil; import org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity; -import java.io.BufferedInputStream; -import java.io.Console; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -
[1/4] maven git commit: [MNG-6182] ModelResolver interface enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/MNG-5359 32553d554 -> ef88bf59a (forced update) [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/MNG-5359 Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroupId(), parent
[2/4] maven git commit: [MNG-6183] Dependency management debug message enhancements.
[MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/MNG-5984 Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[4/4] maven git commit: o Updated to 3.5.1-SNAPSHOT to make the ITs run.
o Updated to 3.5.1-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ef88bf59 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ef88bf59 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ef88bf59 Branch: refs/heads/MNG-5359 Commit: ef88bf59a15014768c13d3ebe396438207b7c7c9 Parents: 1d6af70 Author: Christian Schulte Authored: Tue Jan 31 04:17:19 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:42:16 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ef88bf59/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 6fc5a73..d313f80 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/ef88bf59/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index e3943c9..b13482b 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/ef88bf59/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 39eb161..5eb7903 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/ef88bf59/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 2b205f7..b06d3f3 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/ef88bf59/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 0e20235..71f09c0 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/ef88bf59/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 30ad2ce..66e09a3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/ef88bf59/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 0dd08ac..859f0b3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/ef88bf59/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 41cf168..aabb25d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/ef88bf59/maven-plugin-api/pom.xml --
[1/4] maven git commit: [MNG-6182] ModelResolver interface enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/MNG-5984 5b7246a89 -> 759af2256 (forced update) [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/MNG-5984 Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroupId(), parent
[4/4] maven git commit: o Updated to 3.5.1-SNAPSHOT.
o Updated to 3.5.1-SNAPSHOT. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/759af225 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/759af225 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/759af225 Branch: refs/heads/MNG-5984 Commit: 759af2256a85016caaa7c25be849160005b2d830 Parents: 10782f6 Author: Christian Schulte Authored: Tue Jan 31 19:49:13 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:42:44 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/759af225/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 6fc5a73..d313f80 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/759af225/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index e3943c9..b13482b 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/759af225/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 39eb161..5eb7903 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/759af225/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 2b205f7..b06d3f3 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/759af225/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 0e20235..71f09c0 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/759af225/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 30ad2ce..66e09a3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/759af225/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 0dd08ac..859f0b3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/759af225/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 41cf168..aabb25d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/759af225/maven-plugin-api/pom.xml --
[3/4] maven git commit: [MNG-5359] Declared execution in PluginMgmt gets bound to lifecycle (regression)
[MNG-5359] Declared execution in PluginMgmt gets bound to lifecycle (regression) Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/1d6af709 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/1d6af709 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/1d6af709 Branch: refs/heads/MNG-5359 Commit: 1d6af709bca616f82db79009d2ebfc8da7724569 Parents: 34afec6 Author: Christian Schulte Authored: Sun Dec 20 19:32:57 2015 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:42:16 2017 +0100 -- .../project/EmptyLifecyclePluginAnalyzer.java | 27 ++- .../project/AbstractMavenProjectTestCase.xml| 2 +- .../lifecycle/DefaultLifecycleExecutor.java | 22 +- .../lifecycle/LifeCyclePluginAnalyzer.java | 32 --- .../maven/lifecycle/LifecycleExecutor.java | 20 +- .../LifecycleMappingNotFoundException.java | 45 .../lifecycle/LifecyclePluginAnalyzer.java | 59 ++ .../DefaultLifecyclePluginAnalyzer.java | 207 ++- .../DefaultLifecycleBindingsInjector.java | 40 ++-- .../lifecycle/EmptyLifecyclePluginAnalyzer.java | 25 ++- .../LifecycleExecutorSubModulesTest.java| 4 +- .../stub/LifeCyclePluginAnalyzerStub.java | 74 --- .../stub/LifecyclePluginAnalyzerStub.java | 96 + .../project/AbstractMavenProjectTestCase.xml| 2 +- .../maven/project/PomConstructionTest.xml | 2 +- 15 files changed, 451 insertions(+), 206 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/1d6af709/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java -- diff --git a/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java b/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java index 672e07b..2e0d7ea 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java +++ b/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java @@ -23,7 +23,9 @@ import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; -import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer; +import org.apache.maven.lifecycle.LifecyclePluginAnalyzer; +import org.apache.maven.model.Build; +import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; import org.apache.maven.model.PluginExecution; @@ -31,8 +33,9 @@ import org.apache.maven.model.PluginExecution; * @author Benjamin Bentmann */ public class EmptyLifecyclePluginAnalyzer -implements LifeCyclePluginAnalyzer +implements LifecyclePluginAnalyzer { + public Set getPluginsBoundByDefaultToAllLifecycles( String packaging ) { Set plugins; @@ -57,6 +60,26 @@ public class EmptyLifecyclePluginAnalyzer return plugins; } +@Override +public Model getLifecycleModel( final Model model ) +{ +if ( model == null ) +{ +throw new NullPointerException( "model" ); +} + +final Model lifecycleModel = new Model(); +lifecycleModel.setBuild( new Build() ); +lifecycleModel.getBuild().setPluginManagement( model.getBuild() != null + ? model.getBuild().getPluginManagement() + : null ); + +lifecycleModel.getBuild().getPlugins(). +addAll( this.getPluginsBoundByDefaultToAllLifecycles( model.getPackaging() ) ); + +return lifecycleModel; +} + private Plugin newPlugin( String artifactId, String... goals ) { Plugin plugin = new Plugin(); http://git-wip-us.apache.org/repos/asf/maven/blob/1d6af709/maven-compat/src/test/resources/org/apache/maven/project/AbstractMavenProjectTestCase.xml -- diff --git a/maven-compat/src/test/resources/org/apache/maven/project/AbstractMavenProjectTestCase.xml b/maven-compat/src/test/resources/org/apache/maven/project/AbstractMavenProjectTestCase.xml index bcc291e..7e02f5e 100644 --- a/maven-compat/src/test/resources/org/apache/maven/project/AbstractMavenProjectTestCase.xml +++ b/maven-compat/src/test/resources/org/apache/maven/project/AbstractMavenProjectTestCase.xml @@ -2,7 +2,7 @@ - org.apache.maven.lifecycle.LifeCyclePluginAnalyzer + org.apache.maven.lifecycle.LifecyclePluginAnalyzer org.apache.maven.project.EmptyLifecyclePluginAnalyzer http://git-wip-us.apache.org/repos/asf/maven/blob/1d6af709/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java ---
[2/4] maven git commit: [MNG-6183] Dependency management debug message enhancements.
[MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/MNG-5359 Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[12/15] maven git commit: [MNG-6135] Maven plugins and core extensions are not dependencies, they should be resolved the same way as projects.
[MNG-6135] Maven plugins and core extensions are not dependencies, they should be resolved the same way as projects. o Updated to use the '' element to decide the style of resolution as discussed on dev@. Plugins with prerequisites >= 3.6 get the correct resolution, all other plugins will be resolved with direct 'test' and 'provided' dependencies ignored but direct 'optional' dependencies. o During working on MNG-6135, it turned out that plugin dependency management also is applied to the dependencies declared for a plugin using the 'plugins/plugin/dependencies/dependency' element. Dependencies declared that way must not be overridden by any management. I added management for 'plexus-utils' in the core IT suite. This immediately made the ITs for MNG-4276 and MNG-4274 fail, because 'plexus-utils' got subject to management although a different version has been declared in the plugin declaration. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/f99ff62f Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f99ff62f Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f99ff62f Branch: refs/heads/DEPMGMT Commit: f99ff62f0f05e8b900e075c74e4f532a1fb0eb7c Parents: 67249bb Author: Christian Schulte Authored: Sat Dec 17 03:07:04 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:41:23 2017 +0100 -- .../java/org/apache/maven/RepositoryUtils.java | 12 +- .../DefaultPluginDependenciesResolver.java | 370 --- .../plugin/internal/PlexusUtilsInjector.java| 30 +- .../maven/plugin/internal/WagonExcluder.java| 14 +- 4 files changed, 344 insertions(+), 82 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/f99ff62f/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java -- 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 52442b7..08749ea 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -114,12 +114,16 @@ public class RepositoryUtils List nodeTrail = new ArrayList<>( trail.size() + 1 ); nodeTrail.addAll( trail ); -nodeTrail.add( artifact.getId() ); -if ( filter == null || filter.accept( node, Collections.emptyList() ) ) +if ( artifact != null ) { -artifact.setDependencyTrail( nodeTrail ); -artifacts.add( artifact ); +nodeTrail.add( artifact.getId() ); + +if ( filter == null || filter.accept( node, Collections.emptyList() ) ) +{ +artifact.setDependencyTrail( nodeTrail ); +artifacts.add( artifact ); +} } toArtifacts( artifacts, node.getChildren(), nodeTrail, filter ); http://git-wip-us.apache.org/repos/asf/maven/blob/f99ff62f/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java -- 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 b79b15f..80fd80d 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 @@ -20,10 +20,11 @@ package org.apache.maven.plugin.internal; */ import java.util.LinkedHashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; - import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.versioning.ComparableVersion; import org.apache.maven.model.Dependency; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.PluginResolutionException; @@ -37,8 +38,11 @@ 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.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.collection.DependencyManagement; +import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyN
[14/15] maven git commit: [MNG-5227] The 'optional' flag of a dependency should be manageable.
[MNG-5227] The 'optional' flag of a dependency should be manageable. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ded79ab0 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ded79ab0 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ded79ab0 Branch: refs/heads/DEPMGMT Commit: ded79ab0c8cbabb1942d5ba0efb2cf8d06e1cd77 Parents: a98321e Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:41:23 2017 +0100 -- .../model/management/DefaultDependencyManagementInjector.java | 7 --- 1 file changed, 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ded79ab0/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java index e611973..731cdd8 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java @@ -82,13 +82,6 @@ public class DefaultDependencyManagementInjector } @Override -protected void mergeDependency_Optional( Dependency target, Dependency source, boolean sourceDominant, - Map context ) -{ -// optional flag is not managed -} - -@Override protected void mergeDependency_Exclusions( Dependency target, Dependency source, boolean sourceDominant, Map context ) {
[11/15] maven git commit: o Updated to Maven Resolver 1.2.0-SNAPSHOT.
o Updated to Maven Resolver 1.2.0-SNAPSHOT. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/a98321ea Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/a98321ea Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/a98321ea Branch: refs/heads/DEPMGMT Commit: a98321ea9e420e83f223b542f2aeb3fcd9e69c54 Parents: cdb327d Author: Christian Schulte Authored: Tue Jan 31 20:22:42 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:41:23 2017 +0100 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/a98321ea/pom.xml -- diff --git a/pom.xml b/pom.xml index 45fe5d1..868841a 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ under the License. 1.7 1.8.3 1.3 -1.0.3 +1.2.0-SNAPSHOT 1.7.22 true
[10/15] maven git commit: [MNG-1577] dependencyManagement does not work for transitive dependencies
[MNG-1577] dependencyManagement does not work for transitive dependencies o Updated to correct an incorrect test case. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/53f3cde9 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/53f3cde9 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/53f3cde9 Branch: refs/heads/DEPMGMT Commit: 53f3cde9823b2a07e27771239256bd1822fb47a5 Parents: 3cab133 Author: Christian Schulte Authored: Wed Feb 3 19:17:02 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:41:23 2017 +0100 -- maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml | 2 -- maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml| 2 -- 2 files changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/53f3cde9/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml -- diff --git a/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml b/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml index 4686219..2ac9544 100644 --- a/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml +++ b/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml @@ -24,8 +24,6 @@ maven-test t06-d 1.0 -test -false http://git-wip-us.apache.org/repos/asf/maven/blob/53f3cde9/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml -- diff --git a/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml b/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml index 60c540c..6a66cd1 100644 --- a/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml +++ b/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml @@ -29,8 +29,6 @@ maven-test t06-d 1.2 -test -false
[15/15] maven git commit: [MNG-5935] Optional true getting lost in managed dependencies when transitive
[MNG-5935] Optional true getting lost in managed dependencies when transitive Updated to correctly map the optional flag of Maven model dependencies to Aether dependencies. Prior to this change all managed dependencies implicitly had the optional flag set to 'false' leading to Aether managing that flag to 'false' on all managed dependencies when transitive. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/3cab133a Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/3cab133a Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/3cab133a Branch: refs/heads/DEPMGMT Commit: 3cab133a9b8b9d3f0bdd90c9b6c9d6a5ab56abd6 Parents: ded79ab Author: Christian Schulte Authored: Thu Feb 11 08:45:19 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:41:23 2017 +0100 -- .../src/main/java/org/apache/maven/RepositoryUtils.java | 7 ++- .../repository/internal/ArtifactDescriptorReaderDelegate.java | 6 +- 2 files changed, 11 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/3cab133a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java -- 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 86eab4e..52442b7 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -316,7 +316,12 @@ public class RepositoryUtils exclusions.add( toExclusion( exclusion ) ); } -Dependency result = new Dependency( artifact, dependency.getScope(), dependency.isOptional(), exclusions ); +Dependency result = new Dependency( artifact, +dependency.getScope(), +dependency.getOptional() != null +? dependency.isOptional() +: null, +exclusions ); return result; } http://git-wip-us.apache.org/repos/asf/maven/blob/3cab133a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java index 53c0475..a5e2ffd 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java @@ -124,7 +124,11 @@ public class ArtifactDescriptorReaderDelegate exclusions.add( convert( exclusion ) ); } -Dependency result = new Dependency( artifact, dependency.getScope(), dependency.isOptional(), exclusions ); +Dependency result = new Dependency( artifact, dependency.getScope(), +dependency.getOptional() != null +? dependency.isOptional() +: null, +exclusions ); return result; }
[06/15] maven git commit: o Updated version to 3.6.0-SNAPSHOT to make the ITs run.
o Updated version to 3.6.0-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/cdb327d0 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/cdb327d0 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/cdb327d0 Branch: refs/heads/DEPMGMT Commit: cdb327d0311dd3a9a8b9df3addd608beb065fc11 Parents: 3f218a6 Author: Christian Schulte Authored: Tue Jan 31 03:15:47 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:58 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index d313f80..2c52eb0 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index b13482b..089f4ac 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 5eb7903..6ca5ca2 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index b06d3f3..d4f53bd 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 71f09c0..053aafc 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 66e09a3..918d7d3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 859f0b3..f62e640 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index aabb25d..0ed9879 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-plugin-api/pom.xml ---
[08/15] maven git commit: [MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile modifications from settings.xml
[MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile modifications from settings.xml o Updated the 'DefaultModelResolver' to handle replacing repositories the same way the 'DefaultDependencyCollector' does. When the 'DefaultDependencyCollector' finds a repository in a child node with an id matching a repository already in use, it will only merge any mirror definitions but never change the repository already in use. The 'DefaultModelResolver' needs to follow the same logic. What has been provided must not change for consistency. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/6500c7ab Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/6500c7ab Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/6500c7ab Branch: refs/heads/DEPMGMT Commit: 6500c7abbef91e33efa47e4d5af5e2f64cc1ac8e Parents: 7703955 Author: Christian Schulte Authored: Tue Dec 13 03:30:32 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:58 2017 +0100 -- .../maven/repository/internal/DefaultModelResolver.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/6500c7ab/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java index 3e82eb9..3be37d0 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java @@ -71,6 +71,8 @@ class DefaultModelResolver private final List externalRepositories; +private final Set externalRepositoryIds; + private final ArtifactResolver resolver; private final VersionRangeResolver versionRangeResolver; @@ -93,8 +95,13 @@ class DefaultModelResolver List externalRepositories = new ArrayList<>(); externalRepositories.addAll( repositories ); this.externalRepositories = Collections.unmodifiableList( externalRepositories ); - this.repositoryIds = new HashSet<>(); +this.externalRepositoryIds = new HashSet<>(); +for ( final RemoteRepository repository : this.repositories ) +{ +this.repositoryIds.add( repository.getId() ); +this.externalRepositoryIds.add( repository.getId() ); +} } private DefaultModelResolver( DefaultModelResolver original ) @@ -108,6 +115,7 @@ class DefaultModelResolver this.repositories = new ArrayList<>( original.repositories ); this.externalRepositories = original.externalRepositories; this.repositoryIds = new HashSet<>( original.repositoryIds ); +this.externalRepositoryIds = new HashSet<>( original.externalRepositoryIds ); } @Override @@ -128,7 +136,7 @@ class DefaultModelResolver if ( !repositoryIds.add( repository.getId() ) ) { -if ( !replace ) +if ( !replace || this.externalRepositoryIds.contains( repository.getId() ) ) { return; }
[09/15] maven git commit: [MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter}
[MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter} o Updated to stop replacing external repositories when repository merging is set to REQUEST_DOMINANT. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/7d3c50ad Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/7d3c50ad Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/7d3c50ad Branch: refs/heads/DEPMGMT Commit: 7d3c50ad0f7e99d4734693177c990d10e878bd5c Parents: 6500c7a Author: Christian Schulte Authored: Tue Dec 13 20:16:20 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:58 2017 +0100 -- .../project/DefaultProjectBuildingRequest.java | 19 +++ .../maven/project/ProjectModelResolver.java | 12 +++- 2 files changed, 22 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/7d3c50ad/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java -- 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 dafbefd..d42da04 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 @@ -80,22 +80,25 @@ public class DefaultProjectBuildingRequest pluginArtifactRepositories = new ArrayList<>(); } +@SuppressWarnings( "deprecation" ) public DefaultProjectBuildingRequest( ProjectBuildingRequest request ) { this(); -setProcessPlugins( request.isProcessPlugins() ); -setProfiles( request.getProfiles() ); setActiveProfileIds( request.getActiveProfileIds() ); +setBuildStartTime( request.getBuildStartTime() ); setInactiveProfileIds( request.getInactiveProfileIds() ); -setSystemProperties( request.getSystemProperties() ); -setUserProperties( request.getUserProperties() ); -setRemoteRepositories( request.getRemoteRepositories() ); -setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); -setRepositorySession( request.getRepositorySession() ); setLocalRepository( request.getLocalRepository() ); -setBuildStartTime( request.getBuildStartTime() ); +setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); +setProcessPlugins( request.isProcessPlugins() ); +setProfiles( request.getProfiles() ); setProject( request.getProject() ); +setRemoteRepositories( request.getRemoteRepositories() ); +setRepositoryMerging( request.getRepositoryMerging() ); +setRepositorySession( request.getRepositorySession() ); setResolveDependencies( request.isResolveDependencies() ); +setResolveVersionRanges( request.isResolveVersionRanges() ); +setSystemProperties( request.getSystemProperties() ); +setUserProperties( request.getUserProperties() ); setValidationLevel( request.getValidationLevel() ); } http://git-wip-us.apache.org/repos/asf/maven/blob/7d3c50ad/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 3a31d33..531ae0b 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 @@ -78,6 +78,8 @@ public class ProjectModelResolver private final Set repositoryIds; +private final Set externalRepositoryIds; + private final ReactorModelPool modelPool; private final ProjectBuildingRequest.RepositoryMerging repositoryMerging; @@ -99,7 +101,13 @@ public class ProjectModelResolver this.repositories.addAll( externalRepositories ); this.repositoryMerging = repositoryMerging; this.repositoryIds = new HashSet<>(); +this.externalRepositoryIds = new HashSet<>(); this.modelPool = modelPool; +for ( final RemoteRepository repository : repositories ) +{ +this.repositoryIds.add( repository.getId() ); +this.externalRepositoryIds.add( repository.getId() ); +} } private ProjectModelResolver( ProjectModelResolver original ) @@ -113,6 +121,7 @@ public class ProjectModelResolver this.repositories = new ArrayList<>( original.repositories ); t
[03/15] maven git commit: [MNG-5600] Dependency management import should support exclusions.
[MNG-5600] Dependency management import should support exclusions. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/a737ac87 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/a737ac87 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/a737ac87 Branch: refs/heads/DEPMGMT Commit: a737ac87320816010945501cea12b8b638e0033a Parents: 12247ff Author: Christian Schulte Authored: Sun Jun 19 16:32:25 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 57 +++- 1 file changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/a737ac87/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index e3beb2c..6d0b4a9 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 @@ -19,6 +19,16 @@ package org.apache.maven.model.building; * under the License. */ +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; import org.apache.commons.lang3.Validate; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; @@ -28,6 +38,7 @@ import org.apache.maven.model.Activation; import org.apache.maven.model.Build; import org.apache.maven.model.Dependency; import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Exclusion; import org.apache.maven.model.InputLocation; import org.apache.maven.model.InputSource; import org.apache.maven.model.Model; @@ -63,17 +74,6 @@ import org.apache.maven.model.validation.ModelValidator; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; - import static org.apache.maven.model.building.Result.error; import static org.apache.maven.model.building.Result.newResult; @@ -1223,7 +1223,40 @@ public class DefaultModelBuilder importMgmt = new DependencyManagement(); } -putCache( request.getModelCache(), groupId, artifactId, version, ModelCacheTag.IMPORT, importMgmt ); +// [MNG-5600] Dependency management import should support exclusions. +if ( !dependency.getExclusions().isEmpty() ) +{ +for ( final Exclusion exclusion : dependency.getExclusions() ) +{ +if ( exclusion.getGroupId() != null && exclusion.getArtifactId() != null ) +{ +for ( final Iterator dependencies = importMgmt.getDependencies().iterator(); + dependencies.hasNext(); ) +{ +final Dependency candidate = dependencies.next(); + +if ( ( exclusion.getGroupId().equals( "*" ) + || exclusion.getGroupId().equals( candidate.getGroupId() ) ) + && ( exclusion.getArtifactId().equals( "*" ) + || exclusion.getArtifactId().equals( candidate.getArtifactId() ) ) ) +{ +// Dependency excluded from import. +dependencies.remove(); +} +} +} +} + +for ( final Dependency includedDependency : importMgmt.getDependencies() ) +{ +includedDependency.getExclusions().addAll( dependency.getExclusions() ); +} +} +else +{ +// Only dependency managements without exclusion processing applied can be cached. +putCache( request.getMode
[02/15] maven git commit: o Updated to 3.5.1-SNAPSHOT to make the ITs run.
o Updated to 3.5.1-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/77039555 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/77039555 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/77039555 Branch: refs/heads/DEPMGMT Commit: 77039555e2a6f329f63c1e26966ddb26f940af35 Parents: a737ac8 Author: Christian Schulte Authored: Tue Jan 31 03:17:58 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 6fc5a73..d313f80 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index e3943c9..b13482b 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 39eb161..5eb7903 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 2b205f7..b06d3f3 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 0e20235..71f09c0 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 30ad2ce..66e09a3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 0dd08ac..859f0b3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 41cf168..aabb25d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-plugin-api/pom.xml ---
[07/15] maven git commit: [MNG-5971] Imported dependencies should be available to inheritance processing
[MNG-5971] Imported dependencies should be available to inheritance processing o Updated the 'DefaultDependencyManagementImporter' to stop ignoring import dependency conflicts silently. Such conflicts need to be resolved manually by adding the conflicting dependency to the pom manually. o Updated to add support for an 'include' scope in dependency management processed before inheritance and interpolation. o Re-formatted 'DefaultModelBuilder'. o Documentation updates. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/3f218a60 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/3f218a60 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/3f218a60 Branch: refs/heads/DEPMGMT Commit: 3f218a6024f9b40365f19dba5fbba59bd0007c35 Parents: 7d3c50a Author: Christian Schulte Authored: Thu Feb 18 14:07:02 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:58 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 384 ++- .../building/DefaultModelBuildingResult.java| 26 +- .../model/building/ModelBuildingResult.java | 12 + .../DefaultDependencyManagementImporter.java| 213 +- maven-model-builder/src/site/apt/index.apt | 12 +- 5 files changed, 528 insertions(+), 119 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/3f218a60/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 6d0b4a9..a010db5 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; @@ -84,6 +85,7 @@ import static org.apache.maven.model.building.Result.newResult; public class DefaultModelBuilder implements ModelBuilder { + @Requirement private ModelProcessor modelProcessor; @@ -250,8 +252,8 @@ public class DefaultModelBuilder DefaultProfileActivationContext profileActivationContext = getProfileActivationContext( request ); problems.setSource( "(external profiles)" ); -List activeExternalProfiles = profileSelector.getActiveProfiles( request.getProfiles(), - profileActivationContext, problems ); +List activeExternalProfiles = +profileSelector.getActiveProfiles( request.getProfiles(), profileActivationContext, problems ); result.setActiveExternalProfiles( activeExternalProfiles ); @@ -298,8 +300,9 @@ public class DefaultModelBuilder profileActivationContext.setProjectProperties( tmpModel.getProperties() ); -List activePomProfiles = profileSelector.getActiveProfiles( rawModel.getProfiles(), - profileActivationContext, problems ); +List activePomProfiles = +profileSelector.getActiveProfiles( rawModel.getProfiles(), profileActivationContext, problems ); + currentData.setActiveProfiles( activePomProfiles ); Map interpolatedActivations = getProfileActivations( rawModel, false ); @@ -334,13 +337,13 @@ public class DefaultModelBuilder } else if ( currentData == resultData ) { // First iteration - add initial id after version resolution. -currentData.setGroupId( currentData.getRawModel().getGroupId() == null ? parentData.getGroupId() - : currentData.getRawModel() - .getGroupId() ); +currentData.setGroupId( currentData.getRawModel().getGroupId() == null +? parentData.getGroupId() +: currentData.getRawModel().getGroupId() ); -currentData.setVersion( currentData.getRawModel().getVersion() == null ? parentData.getVersion() - : currentData.getRawModel() -
[04/15] maven git commit: [MNG-4463] Dependency management import should support version ranges.
[MNG-4463] Dependency management import should support version ranges. Closes #64 without merging. ITs are pending to be committed. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/d0911ac5 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/d0911ac5 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/d0911ac5 Branch: refs/heads/DEPMGMT Commit: d0911ac57dccb758435cdfd3495121ec9f0ae1b4 Parents: 34afec6 Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/d0911ac5/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 4ebb033..3699bd9 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 @@ -1213,7 +1213,25 @@ public class DefaultModelBuilder final ModelSource importSource; try { -importSource = modelResolver.resolveModel( groupId, artifactId, version ); +dependency = dependency.clone(); +importSource = modelResolver.resolveModel( dependency ); +final String resolvedId = +dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); + +if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) +{ +// A version range has been resolved to a cycle. +String message = "The dependencies of type=pom and with scope=import form a cycle: "; +for ( String modelId : importIds ) +{ +message += modelId + " -> "; +} +message += resolvedId; +problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). +setMessage( message ) ); + +continue; +} } catch ( UnresolvableModelException e ) {
[01/15] maven git commit: [MNG-6183] Dependency management debug message enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/DEPMGMT 3845f5c35 -> f99ff62f0 (forced update) [MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/DEPMGMT Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[13/15] maven git commit: [MNG-5761] Dependency management is not transitive.
[MNG-5761] Dependency management is not transitive. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/67249bb9 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/67249bb9 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/67249bb9 Branch: refs/heads/DEPMGMT Commit: 67249bb9402b4e7caf3b80456c0ac1f2d5883841 Parents: 53f3cde Author: Christian Schulte Authored: Tue Dec 13 22:35:13 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:41:23 2017 +0100 -- .../maven/artifact/AbstractArtifactComponentTestCase.java | 4 ++-- .../maven/repository/internal/MavenRepositorySystemUtils.java | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/67249bb9/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java -- 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 0cdea19..8e054e5 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 @@ -39,7 +39,7 @@ 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.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; @@ -349,7 +349,7 @@ public abstract class AbstractArtifactComponentTestCase DependencyTraverser depTraverser = new FatArtifactTraverser(); session.setDependencyTraverser( depTraverser ); -DependencyManager depManager = new ClassicDependencyManager(); +DependencyManager depManager = new TransitiveDependencyManager(); session.setDependencyManager( depManager ); DependencySelector depFilter = new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ), http://git-wip-us.apache.org/repos/asf/maven/blob/67249bb9/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index 1b11cb3..f6aeb11 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -20,7 +20,6 @@ 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; @@ -33,7 +32,7 @@ import org.eclipse.aether.impl.MetadataGeneratorFactory; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.util.artifact.DefaultArtifactTypeRegistry; -import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; @@ -95,7 +94,7 @@ public final class MavenRepositorySystemUtils DependencyTraverser depTraverser = new FatArtifactTraverser(); session.setDependencyTraverser( depTraverser ); -DependencyManager depManager = new ClassicDependencyManager(); +DependencyManager depManager = new TransitiveDependencyManager(); session.setDependencyManager( depManager ); DependencySelector depFilter =
[05/15] maven git commit: [MNG-5527] Dependency management import should support relocations.
[MNG-5527] Dependency management import should support relocations. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/12247ff7 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/12247ff7 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/12247ff7 Branch: refs/heads/DEPMGMT Commit: 12247ff7f4922548c2037b9874841ae03eb9952f Parents: d0911ac Author: Christian Schulte Authored: Tue Jun 21 21:35:40 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 191 --- 1 file changed, 126 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/12247ff7/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 3699bd9..e3beb2c 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 @@ -1119,8 +1119,6 @@ public class DefaultModelBuilder final WorkspaceModelResolver workspaceResolver = request.getWorkspaceModelResolver(); final ModelResolver modelResolver = request.getModelResolver(); -ModelBuildingRequest importRequest = null; - List importMgmts = null; for ( Iterator it = depMgmt.getDependencies().iterator(); it.hasNext(); ) @@ -1207,75 +1205,15 @@ public class DefaultModelBuilder } } -// no workspace resolver or workspace resolver returned null (i.e. model not in workspace) if ( importModel == null ) { -final ModelSource importSource; -try -{ -dependency = dependency.clone(); -importSource = modelResolver.resolveModel( dependency ); -final String resolvedId = -dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); - -if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) -{ -// A version range has been resolved to a cycle. -String message = "The dependencies of type=pom and with scope=import form a cycle: "; -for ( String modelId : importIds ) -{ -message += modelId + " -> "; -} -message += resolvedId; -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). -setMessage( message ) ); - -continue; -} -} -catch ( UnresolvableModelException e ) -{ -StringBuilder buffer = new StringBuilder( 256 ); -buffer.append( "Non-resolvable import POM" ); -if ( !containsCoordinates( e.getMessage(), groupId, artifactId, version ) ) -{ -buffer.append( ' ' ).append( ModelProblemUtils.toId( groupId, artifactId, version ) ); -} -buffer.append( ": " ).append( e.getMessage() ); - -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) -.setMessage( buffer.toString() ).setLocation( dependency.getLocation( "" ) ) -.setException( e ) ); -continue; -} - -if ( importRequest == null ) -{ -importRequest = new DefaultModelBuildingRequest(); -importRequest.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); -importRequest.setModelCache( request.getModelCache() ); -importRequest.setSystemProperties( request.getSystemProperties() ); -importRequest.setUserProperties( request.getUserProperties() ); -importRequest.setLocationTracking( request.isLocationTracking() ); -} - -importRequest.setModelSource( importSource ); -
[3/9] maven git commit: [MNG-5527] Dependency management import should support relocations.
[MNG-5527] Dependency management import should support relocations. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/12247ff7 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/12247ff7 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/12247ff7 Branch: refs/heads/DEPMGMT-INCLUDE Commit: 12247ff7f4922548c2037b9874841ae03eb9952f Parents: d0911ac Author: Christian Schulte Authored: Tue Jun 21 21:35:40 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 191 --- 1 file changed, 126 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/12247ff7/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 3699bd9..e3beb2c 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 @@ -1119,8 +1119,6 @@ public class DefaultModelBuilder final WorkspaceModelResolver workspaceResolver = request.getWorkspaceModelResolver(); final ModelResolver modelResolver = request.getModelResolver(); -ModelBuildingRequest importRequest = null; - List importMgmts = null; for ( Iterator it = depMgmt.getDependencies().iterator(); it.hasNext(); ) @@ -1207,75 +1205,15 @@ public class DefaultModelBuilder } } -// no workspace resolver or workspace resolver returned null (i.e. model not in workspace) if ( importModel == null ) { -final ModelSource importSource; -try -{ -dependency = dependency.clone(); -importSource = modelResolver.resolveModel( dependency ); -final String resolvedId = -dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); - -if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) -{ -// A version range has been resolved to a cycle. -String message = "The dependencies of type=pom and with scope=import form a cycle: "; -for ( String modelId : importIds ) -{ -message += modelId + " -> "; -} -message += resolvedId; -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). -setMessage( message ) ); - -continue; -} -} -catch ( UnresolvableModelException e ) -{ -StringBuilder buffer = new StringBuilder( 256 ); -buffer.append( "Non-resolvable import POM" ); -if ( !containsCoordinates( e.getMessage(), groupId, artifactId, version ) ) -{ -buffer.append( ' ' ).append( ModelProblemUtils.toId( groupId, artifactId, version ) ); -} -buffer.append( ": " ).append( e.getMessage() ); - -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) -.setMessage( buffer.toString() ).setLocation( dependency.getLocation( "" ) ) -.setException( e ) ); -continue; -} - -if ( importRequest == null ) -{ -importRequest = new DefaultModelBuildingRequest(); -importRequest.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); -importRequest.setModelCache( request.getModelCache() ); -importRequest.setSystemProperties( request.getSystemProperties() ); -importRequest.setUserProperties( request.getUserProperties() ); -importRequest.setLocationTracking( request.isLocationTracking() ); -} - -importRequest.setModelSource( importSour
[5/9] maven git commit: [MNG-4463] Dependency management import should support version ranges.
[MNG-4463] Dependency management import should support version ranges. Closes #64 without merging. ITs are pending to be committed. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/d0911ac5 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/d0911ac5 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/d0911ac5 Branch: refs/heads/DEPMGMT-INCLUDE Commit: d0911ac57dccb758435cdfd3495121ec9f0ae1b4 Parents: 34afec6 Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/d0911ac5/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 4ebb033..3699bd9 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 @@ -1213,7 +1213,25 @@ public class DefaultModelBuilder final ModelSource importSource; try { -importSource = modelResolver.resolveModel( groupId, artifactId, version ); +dependency = dependency.clone(); +importSource = modelResolver.resolveModel( dependency ); +final String resolvedId = +dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); + +if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) +{ +// A version range has been resolved to a cycle. +String message = "The dependencies of type=pom and with scope=import form a cycle: "; +for ( String modelId : importIds ) +{ +message += modelId + " -> "; +} +message += resolvedId; +problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). +setMessage( message ) ); + +continue; +} } catch ( UnresolvableModelException e ) {
[6/9] maven git commit: o Updated version to 3.6.0-SNAPSHOT to make the ITs run.
o Updated version to 3.6.0-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/cdb327d0 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/cdb327d0 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/cdb327d0 Branch: refs/heads/DEPMGMT-INCLUDE Commit: cdb327d0311dd3a9a8b9df3addd608beb065fc11 Parents: 3f218a6 Author: Christian Schulte Authored: Tue Jan 31 03:15:47 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:58 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index d313f80..2c52eb0 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index b13482b..089f4ac 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 5eb7903..6ca5ca2 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index b06d3f3..d4f53bd 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 71f09c0..053aafc 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 66e09a3..918d7d3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 859f0b3..f62e640 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index aabb25d..0ed9879 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/cdb327d0/maven-plugin-api/pom
[7/9] maven git commit: [MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter}
[MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter} o Updated to stop replacing external repositories when repository merging is set to REQUEST_DOMINANT. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/7d3c50ad Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/7d3c50ad Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/7d3c50ad Branch: refs/heads/DEPMGMT-INCLUDE Commit: 7d3c50ad0f7e99d4734693177c990d10e878bd5c Parents: 6500c7a Author: Christian Schulte Authored: Tue Dec 13 20:16:20 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:58 2017 +0100 -- .../project/DefaultProjectBuildingRequest.java | 19 +++ .../maven/project/ProjectModelResolver.java | 12 +++- 2 files changed, 22 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/7d3c50ad/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java -- 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 dafbefd..d42da04 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 @@ -80,22 +80,25 @@ public class DefaultProjectBuildingRequest pluginArtifactRepositories = new ArrayList<>(); } +@SuppressWarnings( "deprecation" ) public DefaultProjectBuildingRequest( ProjectBuildingRequest request ) { this(); -setProcessPlugins( request.isProcessPlugins() ); -setProfiles( request.getProfiles() ); setActiveProfileIds( request.getActiveProfileIds() ); +setBuildStartTime( request.getBuildStartTime() ); setInactiveProfileIds( request.getInactiveProfileIds() ); -setSystemProperties( request.getSystemProperties() ); -setUserProperties( request.getUserProperties() ); -setRemoteRepositories( request.getRemoteRepositories() ); -setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); -setRepositorySession( request.getRepositorySession() ); setLocalRepository( request.getLocalRepository() ); -setBuildStartTime( request.getBuildStartTime() ); +setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); +setProcessPlugins( request.isProcessPlugins() ); +setProfiles( request.getProfiles() ); setProject( request.getProject() ); +setRemoteRepositories( request.getRemoteRepositories() ); +setRepositoryMerging( request.getRepositoryMerging() ); +setRepositorySession( request.getRepositorySession() ); setResolveDependencies( request.isResolveDependencies() ); +setResolveVersionRanges( request.isResolveVersionRanges() ); +setSystemProperties( request.getSystemProperties() ); +setUserProperties( request.getUserProperties() ); setValidationLevel( request.getValidationLevel() ); } http://git-wip-us.apache.org/repos/asf/maven/blob/7d3c50ad/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 3a31d33..531ae0b 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 @@ -78,6 +78,8 @@ public class ProjectModelResolver private final Set repositoryIds; +private final Set externalRepositoryIds; + private final ReactorModelPool modelPool; private final ProjectBuildingRequest.RepositoryMerging repositoryMerging; @@ -99,7 +101,13 @@ public class ProjectModelResolver this.repositories.addAll( externalRepositories ); this.repositoryMerging = repositoryMerging; this.repositoryIds = new HashSet<>(); +this.externalRepositoryIds = new HashSet<>(); this.modelPool = modelPool; +for ( final RemoteRepository repository : repositories ) +{ +this.repositoryIds.add( repository.getId() ); +this.externalRepositoryIds.add( repository.getId() ); +} } private ProjectModelResolver( ProjectModelResolver original ) @@ -113,6 +121,7 @@ public class ProjectModelResolver this.repositories = new ArrayList<>( original.repositories );
[1/9] maven git commit: [MNG-6183] Dependency management debug message enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/DEPMGMT-INCLUDE 4c9d6a0e8 -> cdb327d03 (forced update) [MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/DEPMGMT-INCLUDE Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[4/9] maven git commit: o Updated to 3.5.1-SNAPSHOT to make the ITs run.
o Updated to 3.5.1-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/77039555 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/77039555 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/77039555 Branch: refs/heads/DEPMGMT-INCLUDE Commit: 77039555e2a6f329f63c1e26966ddb26f940af35 Parents: a737ac8 Author: Christian Schulte Authored: Tue Jan 31 03:17:58 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 6fc5a73..d313f80 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index e3943c9..b13482b 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 39eb161..5eb7903 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 2b205f7..b06d3f3 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 0e20235..71f09c0 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 30ad2ce..66e09a3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 0dd08ac..859f0b3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 41cf168..aabb25d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-plugin-api/pom.xml ---
[2/9] maven git commit: [MNG-5600] Dependency management import should support exclusions.
[MNG-5600] Dependency management import should support exclusions. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/a737ac87 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/a737ac87 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/a737ac87 Branch: refs/heads/DEPMGMT-INCLUDE Commit: a737ac87320816010945501cea12b8b638e0033a Parents: 12247ff Author: Christian Schulte Authored: Sun Jun 19 16:32:25 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 57 +++- 1 file changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/a737ac87/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index e3beb2c..6d0b4a9 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 @@ -19,6 +19,16 @@ package org.apache.maven.model.building; * under the License. */ +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; import org.apache.commons.lang3.Validate; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; @@ -28,6 +38,7 @@ import org.apache.maven.model.Activation; import org.apache.maven.model.Build; import org.apache.maven.model.Dependency; import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Exclusion; import org.apache.maven.model.InputLocation; import org.apache.maven.model.InputSource; import org.apache.maven.model.Model; @@ -63,17 +74,6 @@ import org.apache.maven.model.validation.ModelValidator; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; - import static org.apache.maven.model.building.Result.error; import static org.apache.maven.model.building.Result.newResult; @@ -1223,7 +1223,40 @@ public class DefaultModelBuilder importMgmt = new DependencyManagement(); } -putCache( request.getModelCache(), groupId, artifactId, version, ModelCacheTag.IMPORT, importMgmt ); +// [MNG-5600] Dependency management import should support exclusions. +if ( !dependency.getExclusions().isEmpty() ) +{ +for ( final Exclusion exclusion : dependency.getExclusions() ) +{ +if ( exclusion.getGroupId() != null && exclusion.getArtifactId() != null ) +{ +for ( final Iterator dependencies = importMgmt.getDependencies().iterator(); + dependencies.hasNext(); ) +{ +final Dependency candidate = dependencies.next(); + +if ( ( exclusion.getGroupId().equals( "*" ) + || exclusion.getGroupId().equals( candidate.getGroupId() ) ) + && ( exclusion.getArtifactId().equals( "*" ) + || exclusion.getArtifactId().equals( candidate.getArtifactId() ) ) ) +{ +// Dependency excluded from import. +dependencies.remove(); +} +} +} +} + +for ( final Dependency includedDependency : importMgmt.getDependencies() ) +{ +includedDependency.getExclusions().addAll( dependency.getExclusions() ); +} +} +else +{ +// Only dependency managements without exclusion processing applied can be cached. +putCache( request
[8/9] maven git commit: [MNG-5971] Imported dependencies should be available to inheritance processing
[MNG-5971] Imported dependencies should be available to inheritance processing o Updated the 'DefaultDependencyManagementImporter' to stop ignoring import dependency conflicts silently. Such conflicts need to be resolved manually by adding the conflicting dependency to the pom manually. o Updated to add support for an 'include' scope in dependency management processed before inheritance and interpolation. o Re-formatted 'DefaultModelBuilder'. o Documentation updates. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/3f218a60 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/3f218a60 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/3f218a60 Branch: refs/heads/DEPMGMT-INCLUDE Commit: 3f218a6024f9b40365f19dba5fbba59bd0007c35 Parents: 7d3c50a Author: Christian Schulte Authored: Thu Feb 18 14:07:02 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:58 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 384 ++- .../building/DefaultModelBuildingResult.java| 26 +- .../model/building/ModelBuildingResult.java | 12 + .../DefaultDependencyManagementImporter.java| 213 +- maven-model-builder/src/site/apt/index.apt | 12 +- 5 files changed, 528 insertions(+), 119 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/3f218a60/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 6d0b4a9..a010db5 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; @@ -84,6 +85,7 @@ import static org.apache.maven.model.building.Result.newResult; public class DefaultModelBuilder implements ModelBuilder { + @Requirement private ModelProcessor modelProcessor; @@ -250,8 +252,8 @@ public class DefaultModelBuilder DefaultProfileActivationContext profileActivationContext = getProfileActivationContext( request ); problems.setSource( "(external profiles)" ); -List activeExternalProfiles = profileSelector.getActiveProfiles( request.getProfiles(), - profileActivationContext, problems ); +List activeExternalProfiles = +profileSelector.getActiveProfiles( request.getProfiles(), profileActivationContext, problems ); result.setActiveExternalProfiles( activeExternalProfiles ); @@ -298,8 +300,9 @@ public class DefaultModelBuilder profileActivationContext.setProjectProperties( tmpModel.getProperties() ); -List activePomProfiles = profileSelector.getActiveProfiles( rawModel.getProfiles(), - profileActivationContext, problems ); +List activePomProfiles = +profileSelector.getActiveProfiles( rawModel.getProfiles(), profileActivationContext, problems ); + currentData.setActiveProfiles( activePomProfiles ); Map interpolatedActivations = getProfileActivations( rawModel, false ); @@ -334,13 +337,13 @@ public class DefaultModelBuilder } else if ( currentData == resultData ) { // First iteration - add initial id after version resolution. -currentData.setGroupId( currentData.getRawModel().getGroupId() == null ? parentData.getGroupId() - : currentData.getRawModel() - .getGroupId() ); +currentData.setGroupId( currentData.getRawModel().getGroupId() == null +? parentData.getGroupId() +: currentData.getRawModel().getGroupId() ); -currentData.setVersion( currentData.getRawModel().getVersion() == null ? parentData.getVersion() - : currentData.getRawModel() -
[9/9] maven git commit: [MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile modifications from settings.xml
[MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile modifications from settings.xml o Updated the 'DefaultModelResolver' to handle replacing repositories the same way the 'DefaultDependencyCollector' does. When the 'DefaultDependencyCollector' finds a repository in a child node with an id matching a repository already in use, it will only merge any mirror definitions but never change the repository already in use. The 'DefaultModelResolver' needs to follow the same logic. What has been provided must not change for consistency. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/6500c7ab Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/6500c7ab Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/6500c7ab Branch: refs/heads/DEPMGMT-INCLUDE Commit: 6500c7abbef91e33efa47e4d5af5e2f64cc1ac8e Parents: 7703955 Author: Christian Schulte Authored: Tue Dec 13 03:30:32 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:58 2017 +0100 -- .../maven/repository/internal/DefaultModelResolver.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/6500c7ab/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java index 3e82eb9..3be37d0 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java @@ -71,6 +71,8 @@ class DefaultModelResolver private final List externalRepositories; +private final Set externalRepositoryIds; + private final ArtifactResolver resolver; private final VersionRangeResolver versionRangeResolver; @@ -93,8 +95,13 @@ class DefaultModelResolver List externalRepositories = new ArrayList<>(); externalRepositories.addAll( repositories ); this.externalRepositories = Collections.unmodifiableList( externalRepositories ); - this.repositoryIds = new HashSet<>(); +this.externalRepositoryIds = new HashSet<>(); +for ( final RemoteRepository repository : this.repositories ) +{ +this.repositoryIds.add( repository.getId() ); +this.externalRepositoryIds.add( repository.getId() ); +} } private DefaultModelResolver( DefaultModelResolver original ) @@ -108,6 +115,7 @@ class DefaultModelResolver this.repositories = new ArrayList<>( original.repositories ); this.externalRepositories = original.externalRepositories; this.repositoryIds = new HashSet<>( original.repositoryIds ); +this.externalRepositoryIds = new HashSet<>( original.externalRepositoryIds ); } @Override @@ -128,7 +136,7 @@ class DefaultModelResolver if ( !repositoryIds.add( repository.getId() ) ) { -if ( !replace ) +if ( !replace || this.externalRepositoryIds.contains( repository.getId() ) ) { return; }
[2/5] maven git commit: [MNG-5527] Dependency management import should support relocations.
[MNG-5527] Dependency management import should support relocations. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/12247ff7 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/12247ff7 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/12247ff7 Branch: refs/heads/DEPMGMT-IMPORT Commit: 12247ff7f4922548c2037b9874841ae03eb9952f Parents: d0911ac Author: Christian Schulte Authored: Tue Jun 21 21:35:40 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 191 --- 1 file changed, 126 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/12247ff7/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 3699bd9..e3beb2c 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 @@ -1119,8 +1119,6 @@ public class DefaultModelBuilder final WorkspaceModelResolver workspaceResolver = request.getWorkspaceModelResolver(); final ModelResolver modelResolver = request.getModelResolver(); -ModelBuildingRequest importRequest = null; - List importMgmts = null; for ( Iterator it = depMgmt.getDependencies().iterator(); it.hasNext(); ) @@ -1207,75 +1205,15 @@ public class DefaultModelBuilder } } -// no workspace resolver or workspace resolver returned null (i.e. model not in workspace) if ( importModel == null ) { -final ModelSource importSource; -try -{ -dependency = dependency.clone(); -importSource = modelResolver.resolveModel( dependency ); -final String resolvedId = -dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); - -if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) -{ -// A version range has been resolved to a cycle. -String message = "The dependencies of type=pom and with scope=import form a cycle: "; -for ( String modelId : importIds ) -{ -message += modelId + " -> "; -} -message += resolvedId; -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). -setMessage( message ) ); - -continue; -} -} -catch ( UnresolvableModelException e ) -{ -StringBuilder buffer = new StringBuilder( 256 ); -buffer.append( "Non-resolvable import POM" ); -if ( !containsCoordinates( e.getMessage(), groupId, artifactId, version ) ) -{ -buffer.append( ' ' ).append( ModelProblemUtils.toId( groupId, artifactId, version ) ); -} -buffer.append( ": " ).append( e.getMessage() ); - -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) -.setMessage( buffer.toString() ).setLocation( dependency.getLocation( "" ) ) -.setException( e ) ); -continue; -} - -if ( importRequest == null ) -{ -importRequest = new DefaultModelBuildingRequest(); -importRequest.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); -importRequest.setModelCache( request.getModelCache() ); -importRequest.setSystemProperties( request.getSystemProperties() ); -importRequest.setUserProperties( request.getUserProperties() ); -importRequest.setLocationTracking( request.isLocationTracking() ); -} - -importRequest.setModelSource( importSourc
[1/5] maven git commit: [MNG-6183] Dependency management debug message enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/DEPMGMT-IMPORT 1da33efe7 -> 77039555e (forced update) [MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/DEPMGMT-IMPORT Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[3/5] maven git commit: [MNG-5600] Dependency management import should support exclusions.
[MNG-5600] Dependency management import should support exclusions. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/a737ac87 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/a737ac87 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/a737ac87 Branch: refs/heads/DEPMGMT-IMPORT Commit: a737ac87320816010945501cea12b8b638e0033a Parents: 12247ff Author: Christian Schulte Authored: Sun Jun 19 16:32:25 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 57 +++- 1 file changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/a737ac87/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index e3beb2c..6d0b4a9 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 @@ -19,6 +19,16 @@ package org.apache.maven.model.building; * under the License. */ +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; import org.apache.commons.lang3.Validate; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; @@ -28,6 +38,7 @@ import org.apache.maven.model.Activation; import org.apache.maven.model.Build; import org.apache.maven.model.Dependency; import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Exclusion; import org.apache.maven.model.InputLocation; import org.apache.maven.model.InputSource; import org.apache.maven.model.Model; @@ -63,17 +74,6 @@ import org.apache.maven.model.validation.ModelValidator; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; - import static org.apache.maven.model.building.Result.error; import static org.apache.maven.model.building.Result.newResult; @@ -1223,7 +1223,40 @@ public class DefaultModelBuilder importMgmt = new DependencyManagement(); } -putCache( request.getModelCache(), groupId, artifactId, version, ModelCacheTag.IMPORT, importMgmt ); +// [MNG-5600] Dependency management import should support exclusions. +if ( !dependency.getExclusions().isEmpty() ) +{ +for ( final Exclusion exclusion : dependency.getExclusions() ) +{ +if ( exclusion.getGroupId() != null && exclusion.getArtifactId() != null ) +{ +for ( final Iterator dependencies = importMgmt.getDependencies().iterator(); + dependencies.hasNext(); ) +{ +final Dependency candidate = dependencies.next(); + +if ( ( exclusion.getGroupId().equals( "*" ) + || exclusion.getGroupId().equals( candidate.getGroupId() ) ) + && ( exclusion.getArtifactId().equals( "*" ) + || exclusion.getArtifactId().equals( candidate.getArtifactId() ) ) ) +{ +// Dependency excluded from import. +dependencies.remove(); +} +} +} +} + +for ( final Dependency includedDependency : importMgmt.getDependencies() ) +{ +includedDependency.getExclusions().addAll( dependency.getExclusions() ); +} +} +else +{ +// Only dependency managements without exclusion processing applied can be cached. +putCache( request.
[4/5] maven git commit: o Updated to 3.5.1-SNAPSHOT to make the ITs run.
o Updated to 3.5.1-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/77039555 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/77039555 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/77039555 Branch: refs/heads/DEPMGMT-IMPORT Commit: 77039555e2a6f329f63c1e26966ddb26f940af35 Parents: a737ac8 Author: Christian Schulte Authored: Tue Jan 31 03:17:58 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 6fc5a73..d313f80 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index e3943c9..b13482b 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 39eb161..5eb7903 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 2b205f7..b06d3f3 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 0e20235..71f09c0 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 30ad2ce..66e09a3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 0dd08ac..859f0b3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 41cf168..aabb25d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/77039555/maven-plugin-api/pom.xml
[5/5] maven git commit: [MNG-4463] Dependency management import should support version ranges.
[MNG-4463] Dependency management import should support version ranges. Closes #64 without merging. ITs are pending to be committed. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/d0911ac5 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/d0911ac5 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/d0911ac5 Branch: refs/heads/DEPMGMT-IMPORT Commit: d0911ac57dccb758435cdfd3495121ec9f0ae1b4 Parents: 34afec6 Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:40:30 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/d0911ac5/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 4ebb033..3699bd9 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 @@ -1213,7 +1213,25 @@ public class DefaultModelBuilder final ModelSource importSource; try { -importSource = modelResolver.resolveModel( groupId, artifactId, version ); +dependency = dependency.clone(); +importSource = modelResolver.resolveModel( dependency ); +final String resolvedId = +dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); + +if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) +{ +// A version range has been resolved to a cycle. +String message = "The dependencies of type=pom and with scope=import form a cycle: "; +for ( String modelId : importIds ) +{ +message += modelId + " -> "; +} +message += resolvedId; +problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). +setMessage( message ) ); + +continue; +} } catch ( UnresolvableModelException e ) {
[maven] Git Push Summary
Repository: maven Updated Branches: refs/heads/MNG-6183 [deleted] 34afec69c
maven git commit: [MNG-6183] Dependency management debug message enhancements.
Repository: maven Updated Branches: refs/heads/master ab800b0cf -> 34afec69c [MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/master Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[2/2] maven git commit: [MNG-6183] Dependency management debug message enhancements.
[MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34afec69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34afec69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34afec69 Branch: refs/heads/MNG-6183 Commit: 34afec69c866f731f3f9d9b3606bbc31b51d64e7 Parents: ab800b0 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:37:31 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/34afec69/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[1/2] maven git commit: [MNG-6182] ModelResolver interface enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/MNG-6183 a69e7550f -> 34afec69c (forced update) [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/MNG-6183 Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroupId(), parent
[maven] Git Push Summary
Repository: maven Updated Branches: refs/heads/MNG-6182 [deleted] ab800b0cf
maven git commit: [MNG-6182] ModelResolver interface enhancements.
Repository: maven Updated Branches: refs/heads/master 114ef6c5a -> ab800b0cf [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/master Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroupId(), parent.getArtifactId(), p
maven git commit: [MNG-6183] Dependency management debug message enhancements.
Repository: maven Updated Branches: refs/heads/MNG-6183 [created] a69e7550f [MNG-6183] Dependency management debug message enhancements. o Updated to add debug log messages about optional flag management. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/a69e7550 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/a69e7550 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/a69e7550 Branch: refs/heads/MNG-6183 Commit: a69e7550f4501e18d978fcf45d9be1aa95ff1876 Parents: 114ef6c Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 19:20:29 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven/blob/a69e7550/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else {
[12/15] maven git commit: [MNG-6135] Maven plugins and core extensions are not dependencies, they should be resolved the same way as projects.
[MNG-6135] Maven plugins and core extensions are not dependencies, they should be resolved the same way as projects. o Updated to use the '' element to decide the style of resolution as discussed on dev@. Plugins with prerequisites >= 3.6 get the correct resolution, all other plugins will be resolved with direct 'test' and 'provided' dependencies ignored but direct 'optional' dependencies. o During working on MNG-6135, it turned out that plugin dependency management also is applied to the dependencies declared for a plugin using the 'plugins/plugin/dependencies/dependency' element. Dependencies declared that way must not be overridden by any management. I added management for 'plexus-utils' in the core IT suite. This immediately made the ITs for MNG-4276 and MNG-4274 fail, because 'plexus-utils' got subject to management although a different version has been declared in the plugin declaration. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/3845f5c3 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/3845f5c3 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/3845f5c3 Branch: refs/heads/DEPMGMT Commit: 3845f5c359330cfd59e72aa2b36948e2c65b06f7 Parents: 83f13a2 Author: Christian Schulte Authored: Sat Dec 17 03:07:04 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:40:25 2017 +0100 -- .../java/org/apache/maven/RepositoryUtils.java | 12 +- .../DefaultPluginDependenciesResolver.java | 370 --- .../plugin/internal/PlexusUtilsInjector.java| 30 +- .../maven/plugin/internal/WagonExcluder.java| 14 +- 4 files changed, 344 insertions(+), 82 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/3845f5c3/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java -- 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 52442b7..08749ea 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -114,12 +114,16 @@ public class RepositoryUtils List nodeTrail = new ArrayList<>( trail.size() + 1 ); nodeTrail.addAll( trail ); -nodeTrail.add( artifact.getId() ); -if ( filter == null || filter.accept( node, Collections.emptyList() ) ) +if ( artifact != null ) { -artifact.setDependencyTrail( nodeTrail ); -artifacts.add( artifact ); +nodeTrail.add( artifact.getId() ); + +if ( filter == null || filter.accept( node, Collections.emptyList() ) ) +{ +artifact.setDependencyTrail( nodeTrail ); +artifacts.add( artifact ); +} } toArtifacts( artifacts, node.getChildren(), nodeTrail, filter ); http://git-wip-us.apache.org/repos/asf/maven/blob/3845f5c3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java -- 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 b79b15f..80fd80d 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 @@ -20,10 +20,11 @@ package org.apache.maven.plugin.internal; */ import java.util.LinkedHashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; - import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.versioning.ComparableVersion; import org.apache.maven.model.Dependency; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.PluginResolutionException; @@ -37,8 +38,11 @@ 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.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.collection.DependencyManagement; +import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyN
[01/15] maven git commit: [MNG-6182] ModelResolver interface enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/DEPMGMT bafdaec25 -> 3845f5c35 (forced update) [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/DEPMGMT Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroupId(), parent.g
[07/15] maven git commit: [MNG-5971] Imported dependencies should be available to inheritance processing
[MNG-5971] Imported dependencies should be available to inheritance processing o Updated the 'DefaultDependencyManagementImporter' to stop ignoring import dependency conflicts silently. Such conflicts need to be resolved manually by adding the conflicting dependency to the pom manually. o Updated to add support for an 'include' scope in dependency management processed before inheritance and interpolation. o Re-formatted 'DefaultModelBuilder'. o Documentation updates. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/5d59c0ad Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/5d59c0ad Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/5d59c0ad Branch: refs/heads/DEPMGMT Commit: 5d59c0add624c47abf81405670bfe85b102c617d Parents: 7cff181 Author: Christian Schulte Authored: Thu Feb 18 14:07:02 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:39:52 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 384 ++- .../building/DefaultModelBuildingResult.java| 26 +- .../model/building/ModelBuildingResult.java | 12 + .../DefaultDependencyManagementImporter.java| 213 +- maven-model-builder/src/site/apt/index.apt | 12 +- 5 files changed, 528 insertions(+), 119 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/5d59c0ad/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 6d0b4a9..a010db5 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; @@ -84,6 +85,7 @@ import static org.apache.maven.model.building.Result.newResult; public class DefaultModelBuilder implements ModelBuilder { + @Requirement private ModelProcessor modelProcessor; @@ -250,8 +252,8 @@ public class DefaultModelBuilder DefaultProfileActivationContext profileActivationContext = getProfileActivationContext( request ); problems.setSource( "(external profiles)" ); -List activeExternalProfiles = profileSelector.getActiveProfiles( request.getProfiles(), - profileActivationContext, problems ); +List activeExternalProfiles = +profileSelector.getActiveProfiles( request.getProfiles(), profileActivationContext, problems ); result.setActiveExternalProfiles( activeExternalProfiles ); @@ -298,8 +300,9 @@ public class DefaultModelBuilder profileActivationContext.setProjectProperties( tmpModel.getProperties() ); -List activePomProfiles = profileSelector.getActiveProfiles( rawModel.getProfiles(), - profileActivationContext, problems ); +List activePomProfiles = +profileSelector.getActiveProfiles( rawModel.getProfiles(), profileActivationContext, problems ); + currentData.setActiveProfiles( activePomProfiles ); Map interpolatedActivations = getProfileActivations( rawModel, false ); @@ -334,13 +337,13 @@ public class DefaultModelBuilder } else if ( currentData == resultData ) { // First iteration - add initial id after version resolution. -currentData.setGroupId( currentData.getRawModel().getGroupId() == null ? parentData.getGroupId() - : currentData.getRawModel() - .getGroupId() ); +currentData.setGroupId( currentData.getRawModel().getGroupId() == null +? parentData.getGroupId() +: currentData.getRawModel().getGroupId() ); -currentData.setVersion( currentData.getRawModel().getVersion() == null ? parentData.getVersion() - : currentData.getRawModel() -
[11/15] maven git commit: o Updated to Maven Resolver 1.2.0-SNAPSHOT.
o Updated to Maven Resolver 1.2.0-SNAPSHOT. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/1dd6f83f Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/1dd6f83f Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/1dd6f83f Branch: refs/heads/DEPMGMT Commit: 1dd6f83f5eac01d1030c9b33c397723b6a63094a Parents: 4c9d6a0 Author: Christian Schulte Authored: Tue Jan 31 20:22:42 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:40:25 2017 +0100 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/1dd6f83f/pom.xml -- diff --git a/pom.xml b/pom.xml index 45fe5d1..868841a 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ under the License. 1.7 1.8.3 1.3 -1.0.3 +1.2.0-SNAPSHOT 1.7.22 true
[08/15] maven git commit: [MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile modifications from settings.xml
[MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile modifications from settings.xml o Updated the 'DefaultModelResolver' to handle replacing repositories the same way the 'DefaultDependencyCollector' does. When the 'DefaultDependencyCollector' finds a repository in a child node with an id matching a repository already in use, it will only merge any mirror definitions but never change the repository already in use. The 'DefaultModelResolver' needs to follow the same logic. What has been provided must not change for consistency. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/fb32b722 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/fb32b722 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/fb32b722 Branch: refs/heads/DEPMGMT Commit: fb32b72263e7d1719631091e08130331d8ecb69e Parents: 1da33ef Author: Christian Schulte Authored: Tue Dec 13 03:30:32 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:39:52 2017 +0100 -- .../maven/repository/internal/DefaultModelResolver.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/fb32b722/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java index 3e82eb9..3be37d0 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java @@ -71,6 +71,8 @@ class DefaultModelResolver private final List externalRepositories; +private final Set externalRepositoryIds; + private final ArtifactResolver resolver; private final VersionRangeResolver versionRangeResolver; @@ -93,8 +95,13 @@ class DefaultModelResolver List externalRepositories = new ArrayList<>(); externalRepositories.addAll( repositories ); this.externalRepositories = Collections.unmodifiableList( externalRepositories ); - this.repositoryIds = new HashSet<>(); +this.externalRepositoryIds = new HashSet<>(); +for ( final RemoteRepository repository : this.repositories ) +{ +this.repositoryIds.add( repository.getId() ); +this.externalRepositoryIds.add( repository.getId() ); +} } private DefaultModelResolver( DefaultModelResolver original ) @@ -108,6 +115,7 @@ class DefaultModelResolver this.repositories = new ArrayList<>( original.repositories ); this.externalRepositories = original.externalRepositories; this.repositoryIds = new HashSet<>( original.repositoryIds ); +this.externalRepositoryIds = new HashSet<>( original.externalRepositoryIds ); } @Override @@ -128,7 +136,7 @@ class DefaultModelResolver if ( !repositoryIds.add( repository.getId() ) ) { -if ( !replace ) +if ( !replace || this.externalRepositoryIds.contains( repository.getId() ) ) { return; }
[03/15] maven git commit: [MNG-5527] Dependency management import should support relocations.
[MNG-5527] Dependency management import should support relocations. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/9465aa69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/9465aa69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/9465aa69 Branch: refs/heads/DEPMGMT Commit: 9465aa6958646079906f126fad0a84986069ab72 Parents: c0b0b8b Author: Christian Schulte Authored: Tue Jun 21 21:35:40 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 18:34:33 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 191 --- 1 file changed, 126 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/9465aa69/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 3699bd9..e3beb2c 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 @@ -1119,8 +1119,6 @@ public class DefaultModelBuilder final WorkspaceModelResolver workspaceResolver = request.getWorkspaceModelResolver(); final ModelResolver modelResolver = request.getModelResolver(); -ModelBuildingRequest importRequest = null; - List importMgmts = null; for ( Iterator it = depMgmt.getDependencies().iterator(); it.hasNext(); ) @@ -1207,75 +1205,15 @@ public class DefaultModelBuilder } } -// no workspace resolver or workspace resolver returned null (i.e. model not in workspace) if ( importModel == null ) { -final ModelSource importSource; -try -{ -dependency = dependency.clone(); -importSource = modelResolver.resolveModel( dependency ); -final String resolvedId = -dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); - -if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) -{ -// A version range has been resolved to a cycle. -String message = "The dependencies of type=pom and with scope=import form a cycle: "; -for ( String modelId : importIds ) -{ -message += modelId + " -> "; -} -message += resolvedId; -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). -setMessage( message ) ); - -continue; -} -} -catch ( UnresolvableModelException e ) -{ -StringBuilder buffer = new StringBuilder( 256 ); -buffer.append( "Non-resolvable import POM" ); -if ( !containsCoordinates( e.getMessage(), groupId, artifactId, version ) ) -{ -buffer.append( ' ' ).append( ModelProblemUtils.toId( groupId, artifactId, version ) ); -} -buffer.append( ": " ).append( e.getMessage() ); - -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) -.setMessage( buffer.toString() ).setLocation( dependency.getLocation( "" ) ) -.setException( e ) ); -continue; -} - -if ( importRequest == null ) -{ -importRequest = new DefaultModelBuildingRequest(); -importRequest.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); -importRequest.setModelCache( request.getModelCache() ); -importRequest.setSystemProperties( request.getSystemProperties() ); -importRequest.setUserProperties( request.getUserProperties() ); -importRequest.setLocationTracking( request.isLocationTracking() ); -} - -importRequest.setModelSource( importSource ); -
[14/15] maven git commit: [MNG-5227] The 'optional' flag of a dependency should be manageable.
[MNG-5227] The 'optional' flag of a dependency should be manageable. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/c94be27d Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/c94be27d Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/c94be27d Branch: refs/heads/DEPMGMT Commit: c94be27dea29d353efb5bda7fdd323cf76c01699 Parents: 1dd6f83 Author: Christian Schulte Authored: Wed Jan 27 03:46:11 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:40:25 2017 +0100 -- .../maven/project/DefaultProjectDependenciesResolver.java| 8 .../management/DefaultDependencyManagementInjector.java | 7 --- 2 files changed, 8 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/c94be27d/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java -- 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 16b60c2..21dfaa2 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 @@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver appendManagementSource( buffer, art, "version" ); buffer.append( ')' ); } + +Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node ); +if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional() ) ) +{ +buffer.append( " (optionality managed from " ).append( premanagedOptional ); +appendManagementSource( buffer, art, "optional" ); +buffer.append( ')' ); +} } else { http://git-wip-us.apache.org/repos/asf/maven/blob/c94be27d/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java index e611973..731cdd8 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java @@ -82,13 +82,6 @@ public class DefaultDependencyManagementInjector } @Override -protected void mergeDependency_Optional( Dependency target, Dependency source, boolean sourceDominant, - Map context ) -{ -// optional flag is not managed -} - -@Override protected void mergeDependency_Exclusions( Dependency target, Dependency source, boolean sourceDominant, Map context ) {
[10/15] maven git commit: [MNG-1577] dependencyManagement does not work for transitive dependencies
[MNG-1577] dependencyManagement does not work for transitive dependencies o Updated to correct an incorrect test case. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/63f5777b Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/63f5777b Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/63f5777b Branch: refs/heads/DEPMGMT Commit: 63f5777b8432d9fbb3f69352c151a0177d5e85d3 Parents: 7b36bea Author: Christian Schulte Authored: Wed Feb 3 19:17:02 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:40:25 2017 +0100 -- maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml | 2 -- maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml| 2 -- 2 files changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/63f5777b/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml -- diff --git a/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml b/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml index 4686219..2ac9544 100644 --- a/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml +++ b/maven-compat/src/test/resources/inheritance-repo/t06/p0/p1/pom.xml @@ -24,8 +24,6 @@ maven-test t06-d 1.0 -test -false http://git-wip-us.apache.org/repos/asf/maven/blob/63f5777b/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml -- diff --git a/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml b/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml index 60c540c..6a66cd1 100644 --- a/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml +++ b/maven-compat/src/test/resources/inheritance-repo/t06/p0/pom.xml @@ -29,8 +29,6 @@ maven-test t06-d 1.2 -test -false
[05/15] maven git commit: o Updated to 3.5.1-SNAPSHOT to make the ITs run.
o Updated to 3.5.1-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/1da33efe Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/1da33efe Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/1da33efe Branch: refs/heads/DEPMGMT Commit: 1da33efe7552bb45256759e4266e4ed9705ec831 Parents: aa0abff Author: Christian Schulte Authored: Tue Jan 31 03:17:58 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:36:12 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 6fc5a73..d313f80 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index e3943c9..b13482b 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 39eb161..5eb7903 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 2b205f7..b06d3f3 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 0e20235..71f09c0 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 30ad2ce..66e09a3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 0dd08ac..859f0b3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 41cf168..aabb25d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-plugin-api/pom.xml ---
[04/15] maven git commit: [MNG-5600] Dependency management import should support exclusions.
[MNG-5600] Dependency management import should support exclusions. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/aa0abff9 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/aa0abff9 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/aa0abff9 Branch: refs/heads/DEPMGMT Commit: aa0abff932f18120b7d256655205fa898f770c67 Parents: 9465aa6 Author: Christian Schulte Authored: Sun Jun 19 16:32:25 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 18:36:06 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 57 +++- 1 file changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/aa0abff9/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index e3beb2c..6d0b4a9 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 @@ -19,6 +19,16 @@ package org.apache.maven.model.building; * under the License. */ +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; import org.apache.commons.lang3.Validate; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; @@ -28,6 +38,7 @@ import org.apache.maven.model.Activation; import org.apache.maven.model.Build; import org.apache.maven.model.Dependency; import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Exclusion; import org.apache.maven.model.InputLocation; import org.apache.maven.model.InputSource; import org.apache.maven.model.Model; @@ -63,17 +74,6 @@ import org.apache.maven.model.validation.ModelValidator; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; - import static org.apache.maven.model.building.Result.error; import static org.apache.maven.model.building.Result.newResult; @@ -1223,7 +1223,40 @@ public class DefaultModelBuilder importMgmt = new DependencyManagement(); } -putCache( request.getModelCache(), groupId, artifactId, version, ModelCacheTag.IMPORT, importMgmt ); +// [MNG-5600] Dependency management import should support exclusions. +if ( !dependency.getExclusions().isEmpty() ) +{ +for ( final Exclusion exclusion : dependency.getExclusions() ) +{ +if ( exclusion.getGroupId() != null && exclusion.getArtifactId() != null ) +{ +for ( final Iterator dependencies = importMgmt.getDependencies().iterator(); + dependencies.hasNext(); ) +{ +final Dependency candidate = dependencies.next(); + +if ( ( exclusion.getGroupId().equals( "*" ) + || exclusion.getGroupId().equals( candidate.getGroupId() ) ) + && ( exclusion.getArtifactId().equals( "*" ) + || exclusion.getArtifactId().equals( candidate.getArtifactId() ) ) ) +{ +// Dependency excluded from import. +dependencies.remove(); +} +} +} +} + +for ( final Dependency includedDependency : importMgmt.getDependencies() ) +{ +includedDependency.getExclusions().addAll( dependency.getExclusions() ); +} +} +else +{ +// Only dependency managements without exclusion processing applied can be cached. +putCache( request.getMode
[02/15] maven git commit: [MNG-4463] Dependency management import should support version ranges.
[MNG-4463] Dependency management import should support version ranges. Closes #64 without merging. ITs are pending to be committed. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/c0b0b8b3 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/c0b0b8b3 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/c0b0b8b3 Branch: refs/heads/DEPMGMT Commit: c0b0b8b384fc95f4c7e667f9b5d531c85836a4be Parents: ab800b0 Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:34:21 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/c0b0b8b3/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 4ebb033..3699bd9 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 @@ -1213,7 +1213,25 @@ public class DefaultModelBuilder final ModelSource importSource; try { -importSource = modelResolver.resolveModel( groupId, artifactId, version ); +dependency = dependency.clone(); +importSource = modelResolver.resolveModel( dependency ); +final String resolvedId = +dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); + +if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) +{ +// A version range has been resolved to a cycle. +String message = "The dependencies of type=pom and with scope=import form a cycle: "; +for ( String modelId : importIds ) +{ +message += modelId + " -> "; +} +message += resolvedId; +problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). +setMessage( message ) ); + +continue; +} } catch ( UnresolvableModelException e ) {
[13/15] maven git commit: [MNG-5761] Dependency management is not transitive.
[MNG-5761] Dependency management is not transitive. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/83f13a2a Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/83f13a2a Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/83f13a2a Branch: refs/heads/DEPMGMT Commit: 83f13a2ae8ee85b7e2b0a6c836b99e0f438a2cec Parents: 63f5777 Author: Christian Schulte Authored: Tue Dec 13 22:35:13 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:40:25 2017 +0100 -- .../maven/artifact/AbstractArtifactComponentTestCase.java | 4 ++-- .../maven/repository/internal/MavenRepositorySystemUtils.java | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/83f13a2a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java -- 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 0cdea19..8e054e5 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 @@ -39,7 +39,7 @@ 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.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; @@ -349,7 +349,7 @@ public abstract class AbstractArtifactComponentTestCase DependencyTraverser depTraverser = new FatArtifactTraverser(); session.setDependencyTraverser( depTraverser ); -DependencyManager depManager = new ClassicDependencyManager(); +DependencyManager depManager = new TransitiveDependencyManager(); session.setDependencyManager( depManager ); DependencySelector depFilter = new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ), http://git-wip-us.apache.org/repos/asf/maven/blob/83f13a2a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index 1b11cb3..f6aeb11 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -20,7 +20,6 @@ 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; @@ -33,7 +32,7 @@ import org.eclipse.aether.impl.MetadataGeneratorFactory; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.util.artifact.DefaultArtifactTypeRegistry; -import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; @@ -95,7 +94,7 @@ public final class MavenRepositorySystemUtils DependencyTraverser depTraverser = new FatArtifactTraverser(); session.setDependencyTraverser( depTraverser ); -DependencyManager depManager = new ClassicDependencyManager(); +DependencyManager depManager = new TransitiveDependencyManager(); session.setDependencyManager( depManager ); DependencySelector depFilter =
[09/15] maven git commit: [MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter}
[MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter} o Updated to stop replacing external repositories when repository merging is set to REQUEST_DOMINANT. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/7cff1811 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/7cff1811 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/7cff1811 Branch: refs/heads/DEPMGMT Commit: 7cff1811a5765c206c5730ad15afbf55986ba851 Parents: fb32b72 Author: Christian Schulte Authored: Tue Dec 13 20:16:20 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:39:52 2017 +0100 -- .../project/DefaultProjectBuildingRequest.java | 19 +++ .../maven/project/ProjectModelResolver.java | 12 +++- 2 files changed, 22 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/7cff1811/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java -- 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 dafbefd..d42da04 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 @@ -80,22 +80,25 @@ public class DefaultProjectBuildingRequest pluginArtifactRepositories = new ArrayList<>(); } +@SuppressWarnings( "deprecation" ) public DefaultProjectBuildingRequest( ProjectBuildingRequest request ) { this(); -setProcessPlugins( request.isProcessPlugins() ); -setProfiles( request.getProfiles() ); setActiveProfileIds( request.getActiveProfileIds() ); +setBuildStartTime( request.getBuildStartTime() ); setInactiveProfileIds( request.getInactiveProfileIds() ); -setSystemProperties( request.getSystemProperties() ); -setUserProperties( request.getUserProperties() ); -setRemoteRepositories( request.getRemoteRepositories() ); -setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); -setRepositorySession( request.getRepositorySession() ); setLocalRepository( request.getLocalRepository() ); -setBuildStartTime( request.getBuildStartTime() ); +setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); +setProcessPlugins( request.isProcessPlugins() ); +setProfiles( request.getProfiles() ); setProject( request.getProject() ); +setRemoteRepositories( request.getRemoteRepositories() ); +setRepositoryMerging( request.getRepositoryMerging() ); +setRepositorySession( request.getRepositorySession() ); setResolveDependencies( request.isResolveDependencies() ); +setResolveVersionRanges( request.isResolveVersionRanges() ); +setSystemProperties( request.getSystemProperties() ); +setUserProperties( request.getUserProperties() ); setValidationLevel( request.getValidationLevel() ); } http://git-wip-us.apache.org/repos/asf/maven/blob/7cff1811/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 3a31d33..531ae0b 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 @@ -78,6 +78,8 @@ public class ProjectModelResolver private final Set repositoryIds; +private final Set externalRepositoryIds; + private final ReactorModelPool modelPool; private final ProjectBuildingRequest.RepositoryMerging repositoryMerging; @@ -99,7 +101,13 @@ public class ProjectModelResolver this.repositories.addAll( externalRepositories ); this.repositoryMerging = repositoryMerging; this.repositoryIds = new HashSet<>(); +this.externalRepositoryIds = new HashSet<>(); this.modelPool = modelPool; +for ( final RemoteRepository repository : repositories ) +{ +this.repositoryIds.add( repository.getId() ); +this.externalRepositoryIds.add( repository.getId() ); +} } private ProjectModelResolver( ProjectModelResolver original ) @@ -113,6 +121,7 @@ public class ProjectModelResolver this.repositories = new ArrayList<>( original.repositories ); t
[15/15] maven git commit: [MNG-5935] Optional true getting lost in managed dependencies when transitive
[MNG-5935] Optional true getting lost in managed dependencies when transitive Updated to correctly map the optional flag of Maven model dependencies to Aether dependencies. Prior to this change all managed dependencies implicitly had the optional flag set to 'false' leading to Aether managing that flag to 'false' on all managed dependencies when transitive. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/7b36bea8 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/7b36bea8 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/7b36bea8 Branch: refs/heads/DEPMGMT Commit: 7b36bea814fa7a8583eb31db42572676fde969ee Parents: c94be27 Author: Christian Schulte Authored: Thu Feb 11 08:45:19 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:40:25 2017 +0100 -- .../src/main/java/org/apache/maven/RepositoryUtils.java | 7 ++- .../repository/internal/ArtifactDescriptorReaderDelegate.java | 6 +- 2 files changed, 11 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/7b36bea8/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java -- 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 86eab4e..52442b7 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -316,7 +316,12 @@ public class RepositoryUtils exclusions.add( toExclusion( exclusion ) ); } -Dependency result = new Dependency( artifact, dependency.getScope(), dependency.isOptional(), exclusions ); +Dependency result = new Dependency( artifact, +dependency.getScope(), +dependency.getOptional() != null +? dependency.isOptional() +: null, +exclusions ); return result; } http://git-wip-us.apache.org/repos/asf/maven/blob/7b36bea8/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java index 53c0475..a5e2ffd 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java @@ -124,7 +124,11 @@ public class ArtifactDescriptorReaderDelegate exclusions.add( convert( exclusion ) ); } -Dependency result = new Dependency( artifact, dependency.getScope(), dependency.isOptional(), exclusions ); +Dependency result = new Dependency( artifact, dependency.getScope(), +dependency.getOptional() != null +? dependency.isOptional() +: null, +exclusions ); return result; }
[06/15] maven git commit: o Updated version to 3.6.0-SNAPSHOT to make the ITs run.
o Updated version to 3.6.0-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/4c9d6a0e Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/4c9d6a0e Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/4c9d6a0e Branch: refs/heads/DEPMGMT Commit: 4c9d6a0e8eca9e6f4bb8a18c4129c4bf9cc838b0 Parents: 5d59c0a Author: Christian Schulte Authored: Tue Jan 31 03:15:47 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:39:52 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index d313f80..2c52eb0 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index b13482b..089f4ac 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 5eb7903..6ca5ca2 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index b06d3f3..d4f53bd 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 71f09c0..053aafc 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 66e09a3..918d7d3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 859f0b3..f62e640 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index aabb25d..0ed9879 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-plugin-api/pom.xml ---
[4/9] maven git commit: [MNG-5600] Dependency management import should support exclusions.
[MNG-5600] Dependency management import should support exclusions. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/aa0abff9 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/aa0abff9 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/aa0abff9 Branch: refs/heads/DEPMGMT-INCLUDE Commit: aa0abff932f18120b7d256655205fa898f770c67 Parents: 9465aa6 Author: Christian Schulte Authored: Sun Jun 19 16:32:25 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 18:36:06 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 57 +++- 1 file changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/aa0abff9/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index e3beb2c..6d0b4a9 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 @@ -19,6 +19,16 @@ package org.apache.maven.model.building; * under the License. */ +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; import org.apache.commons.lang3.Validate; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; @@ -28,6 +38,7 @@ import org.apache.maven.model.Activation; import org.apache.maven.model.Build; import org.apache.maven.model.Dependency; import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Exclusion; import org.apache.maven.model.InputLocation; import org.apache.maven.model.InputSource; import org.apache.maven.model.Model; @@ -63,17 +74,6 @@ import org.apache.maven.model.validation.ModelValidator; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; - import static org.apache.maven.model.building.Result.error; import static org.apache.maven.model.building.Result.newResult; @@ -1223,7 +1223,40 @@ public class DefaultModelBuilder importMgmt = new DependencyManagement(); } -putCache( request.getModelCache(), groupId, artifactId, version, ModelCacheTag.IMPORT, importMgmt ); +// [MNG-5600] Dependency management import should support exclusions. +if ( !dependency.getExclusions().isEmpty() ) +{ +for ( final Exclusion exclusion : dependency.getExclusions() ) +{ +if ( exclusion.getGroupId() != null && exclusion.getArtifactId() != null ) +{ +for ( final Iterator dependencies = importMgmt.getDependencies().iterator(); + dependencies.hasNext(); ) +{ +final Dependency candidate = dependencies.next(); + +if ( ( exclusion.getGroupId().equals( "*" ) + || exclusion.getGroupId().equals( candidate.getGroupId() ) ) + && ( exclusion.getArtifactId().equals( "*" ) + || exclusion.getArtifactId().equals( candidate.getArtifactId() ) ) ) +{ +// Dependency excluded from import. +dependencies.remove(); +} +} +} +} + +for ( final Dependency includedDependency : importMgmt.getDependencies() ) +{ +includedDependency.getExclusions().addAll( dependency.getExclusions() ); +} +} +else +{ +// Only dependency managements without exclusion processing applied can be cached. +putCache( request
[2/9] maven git commit: [MNG-4463] Dependency management import should support version ranges.
[MNG-4463] Dependency management import should support version ranges. Closes #64 without merging. ITs are pending to be committed. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/c0b0b8b3 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/c0b0b8b3 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/c0b0b8b3 Branch: refs/heads/DEPMGMT-INCLUDE Commit: c0b0b8b384fc95f4c7e667f9b5d531c85836a4be Parents: ab800b0 Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:34:21 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/c0b0b8b3/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 4ebb033..3699bd9 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 @@ -1213,7 +1213,25 @@ public class DefaultModelBuilder final ModelSource importSource; try { -importSource = modelResolver.resolveModel( groupId, artifactId, version ); +dependency = dependency.clone(); +importSource = modelResolver.resolveModel( dependency ); +final String resolvedId = +dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); + +if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) +{ +// A version range has been resolved to a cycle. +String message = "The dependencies of type=pom and with scope=import form a cycle: "; +for ( String modelId : importIds ) +{ +message += modelId + " -> "; +} +message += resolvedId; +problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). +setMessage( message ) ); + +continue; +} } catch ( UnresolvableModelException e ) {
[1/9] maven git commit: [MNG-6182] ModelResolver interface enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/DEPMGMT-INCLUDE 603ecd2a0 -> 4c9d6a0e8 (forced update) [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/DEPMGMT-INCLUDE Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGro
[9/9] maven git commit: [MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile modifications from settings.xml
[MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile modifications from settings.xml o Updated the 'DefaultModelResolver' to handle replacing repositories the same way the 'DefaultDependencyCollector' does. When the 'DefaultDependencyCollector' finds a repository in a child node with an id matching a repository already in use, it will only merge any mirror definitions but never change the repository already in use. The 'DefaultModelResolver' needs to follow the same logic. What has been provided must not change for consistency. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/fb32b722 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/fb32b722 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/fb32b722 Branch: refs/heads/DEPMGMT-INCLUDE Commit: fb32b72263e7d1719631091e08130331d8ecb69e Parents: 1da33ef Author: Christian Schulte Authored: Tue Dec 13 03:30:32 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:39:52 2017 +0100 -- .../maven/repository/internal/DefaultModelResolver.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/fb32b722/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java -- diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java index 3e82eb9..3be37d0 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java @@ -71,6 +71,8 @@ class DefaultModelResolver private final List externalRepositories; +private final Set externalRepositoryIds; + private final ArtifactResolver resolver; private final VersionRangeResolver versionRangeResolver; @@ -93,8 +95,13 @@ class DefaultModelResolver List externalRepositories = new ArrayList<>(); externalRepositories.addAll( repositories ); this.externalRepositories = Collections.unmodifiableList( externalRepositories ); - this.repositoryIds = new HashSet<>(); +this.externalRepositoryIds = new HashSet<>(); +for ( final RemoteRepository repository : this.repositories ) +{ +this.repositoryIds.add( repository.getId() ); +this.externalRepositoryIds.add( repository.getId() ); +} } private DefaultModelResolver( DefaultModelResolver original ) @@ -108,6 +115,7 @@ class DefaultModelResolver this.repositories = new ArrayList<>( original.repositories ); this.externalRepositories = original.externalRepositories; this.repositoryIds = new HashSet<>( original.repositoryIds ); +this.externalRepositoryIds = new HashSet<>( original.externalRepositoryIds ); } @Override @@ -128,7 +136,7 @@ class DefaultModelResolver if ( !repositoryIds.add( repository.getId() ) ) { -if ( !replace ) +if ( !replace || this.externalRepositoryIds.contains( repository.getId() ) ) { return; }
[5/9] maven git commit: o Updated to 3.5.1-SNAPSHOT to make the ITs run.
o Updated to 3.5.1-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/1da33efe Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/1da33efe Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/1da33efe Branch: refs/heads/DEPMGMT-INCLUDE Commit: 1da33efe7552bb45256759e4266e4ed9705ec831 Parents: aa0abff Author: Christian Schulte Authored: Tue Jan 31 03:17:58 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:36:12 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 6fc5a73..d313f80 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index e3943c9..b13482b 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 39eb161..5eb7903 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 2b205f7..b06d3f3 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 0e20235..71f09c0 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 30ad2ce..66e09a3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 0dd08ac..859f0b3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 41cf168..aabb25d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-plugin-api/pom.xml ---
[7/9] maven git commit: o Updated version to 3.6.0-SNAPSHOT to make the ITs run.
o Updated version to 3.6.0-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/4c9d6a0e Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/4c9d6a0e Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/4c9d6a0e Branch: refs/heads/DEPMGMT-INCLUDE Commit: 4c9d6a0e8eca9e6f4bb8a18c4129c4bf9cc838b0 Parents: 5d59c0a Author: Christian Schulte Authored: Tue Jan 31 03:15:47 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:39:52 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index d313f80..2c52eb0 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index b13482b..089f4ac 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 5eb7903..6ca5ca2 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index b06d3f3..d4f53bd 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 71f09c0..053aafc 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 66e09a3..918d7d3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 859f0b3..f62e640 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index aabb25d..0ed9879 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.1-SNAPSHOT +3.6.0-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/4c9d6a0e/maven-plugin-api/pom
[6/9] maven git commit: [MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter}
[MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter} o Updated to stop replacing external repositories when repository merging is set to REQUEST_DOMINANT. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/7cff1811 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/7cff1811 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/7cff1811 Branch: refs/heads/DEPMGMT-INCLUDE Commit: 7cff1811a5765c206c5730ad15afbf55986ba851 Parents: fb32b72 Author: Christian Schulte Authored: Tue Dec 13 20:16:20 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:39:52 2017 +0100 -- .../project/DefaultProjectBuildingRequest.java | 19 +++ .../maven/project/ProjectModelResolver.java | 12 +++- 2 files changed, 22 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/7cff1811/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java -- 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 dafbefd..d42da04 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 @@ -80,22 +80,25 @@ public class DefaultProjectBuildingRequest pluginArtifactRepositories = new ArrayList<>(); } +@SuppressWarnings( "deprecation" ) public DefaultProjectBuildingRequest( ProjectBuildingRequest request ) { this(); -setProcessPlugins( request.isProcessPlugins() ); -setProfiles( request.getProfiles() ); setActiveProfileIds( request.getActiveProfileIds() ); +setBuildStartTime( request.getBuildStartTime() ); setInactiveProfileIds( request.getInactiveProfileIds() ); -setSystemProperties( request.getSystemProperties() ); -setUserProperties( request.getUserProperties() ); -setRemoteRepositories( request.getRemoteRepositories() ); -setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); -setRepositorySession( request.getRepositorySession() ); setLocalRepository( request.getLocalRepository() ); -setBuildStartTime( request.getBuildStartTime() ); +setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); +setProcessPlugins( request.isProcessPlugins() ); +setProfiles( request.getProfiles() ); setProject( request.getProject() ); +setRemoteRepositories( request.getRemoteRepositories() ); +setRepositoryMerging( request.getRepositoryMerging() ); +setRepositorySession( request.getRepositorySession() ); setResolveDependencies( request.isResolveDependencies() ); +setResolveVersionRanges( request.isResolveVersionRanges() ); +setSystemProperties( request.getSystemProperties() ); +setUserProperties( request.getUserProperties() ); setValidationLevel( request.getValidationLevel() ); } http://git-wip-us.apache.org/repos/asf/maven/blob/7cff1811/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 3a31d33..531ae0b 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 @@ -78,6 +78,8 @@ public class ProjectModelResolver private final Set repositoryIds; +private final Set externalRepositoryIds; + private final ReactorModelPool modelPool; private final ProjectBuildingRequest.RepositoryMerging repositoryMerging; @@ -99,7 +101,13 @@ public class ProjectModelResolver this.repositories.addAll( externalRepositories ); this.repositoryMerging = repositoryMerging; this.repositoryIds = new HashSet<>(); +this.externalRepositoryIds = new HashSet<>(); this.modelPool = modelPool; +for ( final RemoteRepository repository : repositories ) +{ +this.repositoryIds.add( repository.getId() ); +this.externalRepositoryIds.add( repository.getId() ); +} } private ProjectModelResolver( ProjectModelResolver original ) @@ -113,6 +121,7 @@ public class ProjectModelResolver this.repositories = new ArrayList<>( original.repositories );
[3/9] maven git commit: [MNG-5527] Dependency management import should support relocations.
[MNG-5527] Dependency management import should support relocations. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/9465aa69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/9465aa69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/9465aa69 Branch: refs/heads/DEPMGMT-INCLUDE Commit: 9465aa6958646079906f126fad0a84986069ab72 Parents: c0b0b8b Author: Christian Schulte Authored: Tue Jun 21 21:35:40 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 18:34:33 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 191 --- 1 file changed, 126 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/9465aa69/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 3699bd9..e3beb2c 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 @@ -1119,8 +1119,6 @@ public class DefaultModelBuilder final WorkspaceModelResolver workspaceResolver = request.getWorkspaceModelResolver(); final ModelResolver modelResolver = request.getModelResolver(); -ModelBuildingRequest importRequest = null; - List importMgmts = null; for ( Iterator it = depMgmt.getDependencies().iterator(); it.hasNext(); ) @@ -1207,75 +1205,15 @@ public class DefaultModelBuilder } } -// no workspace resolver or workspace resolver returned null (i.e. model not in workspace) if ( importModel == null ) { -final ModelSource importSource; -try -{ -dependency = dependency.clone(); -importSource = modelResolver.resolveModel( dependency ); -final String resolvedId = -dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); - -if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) -{ -// A version range has been resolved to a cycle. -String message = "The dependencies of type=pom and with scope=import form a cycle: "; -for ( String modelId : importIds ) -{ -message += modelId + " -> "; -} -message += resolvedId; -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). -setMessage( message ) ); - -continue; -} -} -catch ( UnresolvableModelException e ) -{ -StringBuilder buffer = new StringBuilder( 256 ); -buffer.append( "Non-resolvable import POM" ); -if ( !containsCoordinates( e.getMessage(), groupId, artifactId, version ) ) -{ -buffer.append( ' ' ).append( ModelProblemUtils.toId( groupId, artifactId, version ) ); -} -buffer.append( ": " ).append( e.getMessage() ); - -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) -.setMessage( buffer.toString() ).setLocation( dependency.getLocation( "" ) ) -.setException( e ) ); -continue; -} - -if ( importRequest == null ) -{ -importRequest = new DefaultModelBuildingRequest(); -importRequest.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); -importRequest.setModelCache( request.getModelCache() ); -importRequest.setSystemProperties( request.getSystemProperties() ); -importRequest.setUserProperties( request.getUserProperties() ); -importRequest.setLocationTracking( request.isLocationTracking() ); -} - -importRequest.setModelSource( importSour
[8/9] maven git commit: [MNG-5971] Imported dependencies should be available to inheritance processing
[MNG-5971] Imported dependencies should be available to inheritance processing o Updated the 'DefaultDependencyManagementImporter' to stop ignoring import dependency conflicts silently. Such conflicts need to be resolved manually by adding the conflicting dependency to the pom manually. o Updated to add support for an 'include' scope in dependency management processed before inheritance and interpolation. o Re-formatted 'DefaultModelBuilder'. o Documentation updates. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/5d59c0ad Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/5d59c0ad Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/5d59c0ad Branch: refs/heads/DEPMGMT-INCLUDE Commit: 5d59c0add624c47abf81405670bfe85b102c617d Parents: 7cff181 Author: Christian Schulte Authored: Thu Feb 18 14:07:02 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:39:52 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 384 ++- .../building/DefaultModelBuildingResult.java| 26 +- .../model/building/ModelBuildingResult.java | 12 + .../DefaultDependencyManagementImporter.java| 213 +- maven-model-builder/src/site/apt/index.apt | 12 +- 5 files changed, 528 insertions(+), 119 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/5d59c0ad/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 6d0b4a9..a010db5 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; @@ -84,6 +85,7 @@ import static org.apache.maven.model.building.Result.newResult; public class DefaultModelBuilder implements ModelBuilder { + @Requirement private ModelProcessor modelProcessor; @@ -250,8 +252,8 @@ public class DefaultModelBuilder DefaultProfileActivationContext profileActivationContext = getProfileActivationContext( request ); problems.setSource( "(external profiles)" ); -List activeExternalProfiles = profileSelector.getActiveProfiles( request.getProfiles(), - profileActivationContext, problems ); +List activeExternalProfiles = +profileSelector.getActiveProfiles( request.getProfiles(), profileActivationContext, problems ); result.setActiveExternalProfiles( activeExternalProfiles ); @@ -298,8 +300,9 @@ public class DefaultModelBuilder profileActivationContext.setProjectProperties( tmpModel.getProperties() ); -List activePomProfiles = profileSelector.getActiveProfiles( rawModel.getProfiles(), - profileActivationContext, problems ); +List activePomProfiles = +profileSelector.getActiveProfiles( rawModel.getProfiles(), profileActivationContext, problems ); + currentData.setActiveProfiles( activePomProfiles ); Map interpolatedActivations = getProfileActivations( rawModel, false ); @@ -334,13 +337,13 @@ public class DefaultModelBuilder } else if ( currentData == resultData ) { // First iteration - add initial id after version resolution. -currentData.setGroupId( currentData.getRawModel().getGroupId() == null ? parentData.getGroupId() - : currentData.getRawModel() - .getGroupId() ); +currentData.setGroupId( currentData.getRawModel().getGroupId() == null +? parentData.getGroupId() +: currentData.getRawModel().getGroupId() ); -currentData.setVersion( currentData.getRawModel().getVersion() == null ? parentData.getVersion() - : currentData.getRawModel() -
[1/5] maven git commit: [MNG-6182] ModelResolver interface enhancements. [Forced Update!]
Repository: maven Updated Branches: refs/heads/DEPMGMT-IMPORT b14c67a3f -> 1da33efe7 (forced update) [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/DEPMGMT-IMPORT Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroup
[3/5] maven git commit: [MNG-5527] Dependency management import should support relocations.
[MNG-5527] Dependency management import should support relocations. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/9465aa69 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/9465aa69 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/9465aa69 Branch: refs/heads/DEPMGMT-IMPORT Commit: 9465aa6958646079906f126fad0a84986069ab72 Parents: c0b0b8b Author: Christian Schulte Authored: Tue Jun 21 21:35:40 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 18:34:33 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 191 --- 1 file changed, 126 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/9465aa69/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 3699bd9..e3beb2c 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 @@ -1119,8 +1119,6 @@ public class DefaultModelBuilder final WorkspaceModelResolver workspaceResolver = request.getWorkspaceModelResolver(); final ModelResolver modelResolver = request.getModelResolver(); -ModelBuildingRequest importRequest = null; - List importMgmts = null; for ( Iterator it = depMgmt.getDependencies().iterator(); it.hasNext(); ) @@ -1207,75 +1205,15 @@ public class DefaultModelBuilder } } -// no workspace resolver or workspace resolver returned null (i.e. model not in workspace) if ( importModel == null ) { -final ModelSource importSource; -try -{ -dependency = dependency.clone(); -importSource = modelResolver.resolveModel( dependency ); -final String resolvedId = -dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); - -if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) -{ -// A version range has been resolved to a cycle. -String message = "The dependencies of type=pom and with scope=import form a cycle: "; -for ( String modelId : importIds ) -{ -message += modelId + " -> "; -} -message += resolvedId; -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). -setMessage( message ) ); - -continue; -} -} -catch ( UnresolvableModelException e ) -{ -StringBuilder buffer = new StringBuilder( 256 ); -buffer.append( "Non-resolvable import POM" ); -if ( !containsCoordinates( e.getMessage(), groupId, artifactId, version ) ) -{ -buffer.append( ' ' ).append( ModelProblemUtils.toId( groupId, artifactId, version ) ); -} -buffer.append( ": " ).append( e.getMessage() ); - -problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) -.setMessage( buffer.toString() ).setLocation( dependency.getLocation( "" ) ) -.setException( e ) ); -continue; -} - -if ( importRequest == null ) -{ -importRequest = new DefaultModelBuildingRequest(); -importRequest.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); -importRequest.setModelCache( request.getModelCache() ); -importRequest.setSystemProperties( request.getSystemProperties() ); -importRequest.setUserProperties( request.getUserProperties() ); -importRequest.setLocationTracking( request.isLocationTracking() ); -} - -importRequest.setModelSource( importSourc
[5/5] maven git commit: o Updated to 3.5.1-SNAPSHOT to make the ITs run.
o Updated to 3.5.1-SNAPSHOT to make the ITs run. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/1da33efe Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/1da33efe Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/1da33efe Branch: refs/heads/DEPMGMT-IMPORT Commit: 1da33efe7552bb45256759e4266e4ed9705ec831 Parents: aa0abff Author: Christian Schulte Authored: Tue Jan 31 03:17:58 2017 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:36:12 2017 +0100 -- apache-maven/pom.xml | 2 +- maven-artifact/pom.xml| 2 +- maven-builder-support/pom.xml | 2 +- maven-compat/pom.xml | 2 +- maven-core/pom.xml| 2 +- maven-embedder/pom.xml| 2 +- maven-model-builder/pom.xml | 2 +- maven-model/pom.xml | 2 +- maven-plugin-api/pom.xml | 2 +- maven-repository-metadata/pom.xml | 2 +- maven-resolver-provider/pom.xml | 2 +- maven-settings-builder/pom.xml| 2 +- maven-settings/pom.xml| 2 +- maven-slf4j-provider/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/apache-maven/pom.xml -- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 6fc5a73..d313f80 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT apache-maven http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-artifact/pom.xml -- diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml index e3943c9..b13482b 100644 --- a/maven-artifact/pom.xml +++ b/maven-artifact/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-artifact http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-builder-support/pom.xml -- diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml index 39eb161..5eb7903 100644 --- a/maven-builder-support/pom.xml +++ b/maven-builder-support/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-builder-support http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-compat/pom.xml -- diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index 2b205f7..b06d3f3 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-compat http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-core/pom.xml -- diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 0e20235..71f09c0 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-core http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-embedder/pom.xml -- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index 30ad2ce..66e09a3 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-embedder http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-model-builder/pom.xml -- diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 0dd08ac..859f0b3 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model-builder http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-model/pom.xml -- diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 41cf168..aabb25d 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven maven -3.5.0-SNAPSHOT +3.5.1-SNAPSHOT maven-model http://git-wip-us.apache.org/repos/asf/maven/blob/1da33efe/maven-plugin-api/pom.xml
[4/5] maven git commit: [MNG-5600] Dependency management import should support exclusions.
[MNG-5600] Dependency management import should support exclusions. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/aa0abff9 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/aa0abff9 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/aa0abff9 Branch: refs/heads/DEPMGMT-IMPORT Commit: aa0abff932f18120b7d256655205fa898f770c67 Parents: 9465aa6 Author: Christian Schulte Authored: Sun Jun 19 16:32:25 2016 +0200 Committer: Christian Schulte Committed: Wed Mar 8 18:36:06 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 57 +++- 1 file changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/aa0abff9/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index e3beb2c..6d0b4a9 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 @@ -19,6 +19,16 @@ package org.apache.maven.model.building; * under the License. */ +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; import org.apache.commons.lang3.Validate; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; @@ -28,6 +38,7 @@ import org.apache.maven.model.Activation; import org.apache.maven.model.Build; import org.apache.maven.model.Dependency; import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Exclusion; import org.apache.maven.model.InputLocation; import org.apache.maven.model.InputSource; import org.apache.maven.model.Model; @@ -63,17 +74,6 @@ import org.apache.maven.model.validation.ModelValidator; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; - import static org.apache.maven.model.building.Result.error; import static org.apache.maven.model.building.Result.newResult; @@ -1223,7 +1223,40 @@ public class DefaultModelBuilder importMgmt = new DependencyManagement(); } -putCache( request.getModelCache(), groupId, artifactId, version, ModelCacheTag.IMPORT, importMgmt ); +// [MNG-5600] Dependency management import should support exclusions. +if ( !dependency.getExclusions().isEmpty() ) +{ +for ( final Exclusion exclusion : dependency.getExclusions() ) +{ +if ( exclusion.getGroupId() != null && exclusion.getArtifactId() != null ) +{ +for ( final Iterator dependencies = importMgmt.getDependencies().iterator(); + dependencies.hasNext(); ) +{ +final Dependency candidate = dependencies.next(); + +if ( ( exclusion.getGroupId().equals( "*" ) + || exclusion.getGroupId().equals( candidate.getGroupId() ) ) + && ( exclusion.getArtifactId().equals( "*" ) + || exclusion.getArtifactId().equals( candidate.getArtifactId() ) ) ) +{ +// Dependency excluded from import. +dependencies.remove(); +} +} +} +} + +for ( final Dependency includedDependency : importMgmt.getDependencies() ) +{ +includedDependency.getExclusions().addAll( dependency.getExclusions() ); +} +} +else +{ +// Only dependency managements without exclusion processing applied can be cached. +putCache( request.
[2/5] maven git commit: [MNG-4463] Dependency management import should support version ranges.
[MNG-4463] Dependency management import should support version ranges. Closes #64 without merging. ITs are pending to be committed. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/c0b0b8b3 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/c0b0b8b3 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/c0b0b8b3 Branch: refs/heads/DEPMGMT-IMPORT Commit: c0b0b8b384fc95f4c7e667f9b5d531c85836a4be Parents: ab800b0 Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:34:21 2017 +0100 -- .../model/building/DefaultModelBuilder.java | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/c0b0b8b3/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java -- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 4ebb033..3699bd9 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 @@ -1213,7 +1213,25 @@ public class DefaultModelBuilder final ModelSource importSource; try { -importSource = modelResolver.resolveModel( groupId, artifactId, version ); +dependency = dependency.clone(); +importSource = modelResolver.resolveModel( dependency ); +final String resolvedId = +dependency.getGroupId() + ':' + dependency.getArtifactId() + ':' + dependency.getVersion(); + +if ( !imported.equals( resolvedId ) && importIds.contains( resolvedId ) ) +{ +// A version range has been resolved to a cycle. +String message = "The dependencies of type=pom and with scope=import form a cycle: "; +for ( String modelId : importIds ) +{ +message += modelId + " -> "; +} +message += resolvedId; +problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ). +setMessage( message ) ); + +continue; +} } catch ( UnresolvableModelException e ) {
maven git commit: [MNG-6182] ModelResolver interface enhancements.
Repository: maven Updated Branches: refs/heads/MNG-6182 [created] ab800b0cf [MNG-6182] ModelResolver interface enhancements. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ab800b0c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ab800b0c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ab800b0c Branch: refs/heads/MNG-6182 Commit: ab800b0cfae4e3ca9453304e3b9727ba4a4b712b Parents: 114ef6c Author: Christian Schulte Authored: Sat Jan 30 19:17:34 2016 +0100 Committer: Christian Schulte Committed: Wed Mar 8 18:24:18 2017 +0100 -- .../maven/project/ProjectModelResolver.java | 84 +++ .../maven/model/resolution/ModelResolver.java | 32 .../internal/DefaultModelResolver.java | 85 3 files changed, 167 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/ab800b0c/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java -- 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 7b93217..3a31d33 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 @@ -28,7 +28,7 @@ import java.util.Set; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; - +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -203,24 +203,26 @@ public class ProjectModelResolver return new FileModelSource( pomFile ); } -public ModelSource resolveModel( Parent parent ) +@Override +public ModelSource resolveModel( final Parent parent ) throws UnresolvableModelException { -Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", - parent.getVersion() ); - -VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); -versionRangeRequest.setTrace( trace ); - try { -VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); +final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + +final VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); +versionRangeRequest.setTrace( trace ); + +final VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); if ( versionRangeResult.getHighestVersion() == null ) { -throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() - + "'", parent.getGroupId(), parent.getArtifactId(), - parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "No versions matched the requested parent version range '%s'", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } @@ -229,21 +231,69 @@ public class ProjectModelResolver && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) { // Message below is checked for in the MNG-2199 core IT. -throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() - + "' does not specify an upper bound", parent.getGroupId(), - parent.getArtifactId(), parent.getVersion() ); +throw new UnresolvableModelException( +String.format( "The requested parent version range '%s' does not specify an upper bound", + parent.getVersion() ), +parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); } parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + +return resolveModel( parent.getGroupId(), parent.getArtifactId(),
[28/46] maven git commit: [MNG-6171] always show WARNING about usage of a non threadsafe plugin
[MNG-6171] always show WARNING about usage of a non threadsafe plugin Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/3982c195 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/3982c195 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/3982c195 Branch: refs/heads/MNG-5984 Commit: 3982c195e91e3ea0f73ce9e61c6ddc57137726e9 Parents: f1cc1d4 Author: Hervé Boutemy Authored: Sat Feb 18 17:36:38 2017 +0100 Committer: Hervé Boutemy Committed: Sat Feb 18 17:36:38 2017 +0100 -- .../org/apache/maven/lifecycle/internal/builder/BuilderCommon.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/3982c195/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java -- diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java index f770670..f5c8e3e 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java @@ -101,7 +101,7 @@ public class BuilderCommon if ( session.getRequest().getDegreeOfConcurrency() > 1 ) { final Set unsafePlugins = executionPlan.getNonThreadSafePlugins(); -if ( !unsafePlugins.isEmpty() && logger.isDebugEnabled() ) +if ( !unsafePlugins.isEmpty() ) { logger.warn( "*" ); logger.warn( "* Your build is requesting parallel execution, but project *" );
[20/46] maven git commit: [MNG-5934] String handling issues identified by PMD
[MNG-5934] String handling issues identified by PMD Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/8d91726f Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/8d91726f Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/8d91726f Branch: refs/heads/MNG-5984 Commit: 8d91726f7872f4462d9fa085ef5b6f32bfd0a2e1 Parents: 0514c1b Author: Alex Henrie Authored: Tue Jan 19 20:04:59 2016 +0100 Committer: Michael Osipov Committed: Sat Feb 11 14:08:24 2017 +0100 -- .../apache/maven/artifact/DefaultArtifact.java | 12 +-- .../repository/ArtifactRepositoryPolicy.java| 2 +- .../AbstractArtifactResolutionException.java| 10 - .../MultipleArtifactsNotFoundException.java | 3 ++- .../versioning/DefaultArtifactVersion.java | 2 +- .../maven/artifact/versioning/Restriction.java | 6 +++--- .../maven/artifact/versioning/VersionRange.java | 6 +++--- .../apache/maven/building/DefaultProblem.java | 2 +- .../repository/DefaultArtifactRepository.java | 8 +++ .../artifact/versioning/ManagedVersionMap.java | 4 ++-- .../validation/ModelValidationResult.java | 2 +- .../repository/MetadataResolutionResult.java| 22 +--- .../repository/metadata/MetadataGraph.java | 6 +++--- .../metadata/MetadataGraphVertex.java | 8 +++ .../project/LegacyLocalRepositoryManager.java | 2 +- .../AbstractProjectInheritanceTestCase.java | 2 +- .../repository/MavenArtifactRepository.java | 14 ++--- .../metadata/AbstractRepositoryMetadata.java| 2 +- .../resolver/ArtifactResolutionResult.java | 8 +++ .../maven/lifecycle/mapping/LifecyclePhase.java | 2 +- .../org/apache/maven/plugin/MojoExecution.java | 2 +- .../maven/plugin/PluginParameterException.java | 6 +++--- .../PluginParameterExpressionEvaluator.java | 16 +++--- .../DefaultProjectDependenciesResolver.java | 4 ++-- .../org/apache/maven/project/MavenProject.java | 4 ++-- .../maven/repository/ArtifactTransferEvent.java | 10 - .../metadata/AbstractArtifactMetadata.java | 2 +- .../project/LegacyLocalRepositoryManager.java | 2 +- .../org/apache/maven/cli/CLIReportingUtils.java | 2 +- .../java/org/apache/maven/cli/MavenCli.java | 2 +- .../maven/cli/event/ExecutionEventLogger.java | 4 ++-- .../UnsupportedSlf4jBindingConfiguration.java | 2 +- .../maven/cli/CLIManagerDocumentationTest.java | 2 +- .../model/building/DefaultModelBuilder.java | 8 +++ .../model/building/DefaultModelProblem.java | 2 +- .../maven/model/building/ModelProblemUtils.java | 2 +- .../maven/plugin/MojoNotFoundException.java | 2 +- .../building/DefaultSettingsProblem.java| 2 +- 38 files changed, 98 insertions(+), 99 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/8d91726f/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java -- diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java b/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java index 147e88e..bd2e8ed 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java @@ -230,7 +230,7 @@ public class DefaultArtifact { StringBuilder sb = new StringBuilder( 128 ); sb.append( getGroupId() ); -sb.append( ":" ); +sb.append( ':' ); appendArtifactTypeClassifierString( sb ); return sb.toString(); } @@ -238,11 +238,11 @@ public class DefaultArtifact private void appendArtifactTypeClassifierString( StringBuilder sb ) { sb.append( getArtifactId() ); -sb.append( ":" ); +sb.append( ':' ); sb.append( getType() ); if ( hasClassifier() ) { -sb.append( ":" ); +sb.append( ':' ); sb.append( getClassifier() ); } } @@ -285,10 +285,10 @@ public class DefaultArtifact if ( getGroupId() != null ) { sb.append( getGroupId() ); -sb.append( ":" ); +sb.append( ':' ); } appendArtifactTypeClassifierString( sb ); -sb.append( ":" ); +sb.append( ':' ); if ( getBaseVersionInternal() != null ) { sb.append( getBaseVersionInternal() ); @@ -299,7 +299,7 @@ public class DefaultArtifact } if ( scope != null ) { -sb.append( ":" ); +sb.append( ':' ); sb.append( scope ); } return sb.toString(); http://git-wip-us.apache.org/repos/as
[23/46] maven git commit: [MNG-5297] improved explanations on prerequisites.maven in Maven 3
[MNG-5297] improved explanations on prerequisites.maven in Maven 3 Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/19d5b9df Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/19d5b9df Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/19d5b9df Branch: refs/heads/MNG-5984 Commit: 19d5b9dfa108a94c0825215a013ac21253cb0a17 Parents: 0284dda Author: Hervé Boutemy Authored: Sun Sep 18 23:57:24 2016 +0200 Committer: Hervé Boutemy Committed: Tue Feb 14 01:37:31 2017 +0100 -- maven-model/src/main/mdo/maven.mdo | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/19d5b9df/maven-model/src/main/mdo/maven.mdo -- diff --git a/maven-model/src/main/mdo/maven.mdo b/maven-model/src/main/mdo/maven.mdo index 1187b11..945ae03 100644 --- a/maven-model/src/main/mdo/maven.mdo +++ b/maven-model/src/main/mdo/maven.mdo @@ -3483,12 +3483,12 @@ String 2.0 false
[39/46] maven git commit: [MNG-6177] The --file command line option of the Windows and Unix launchers does not work for directory names like "Spaces & Special Char"
[MNG-6177] The --file command line option of the Windows and Unix launchers does not work for directory names like "Spaces & Special Char" Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/0b9a30f3 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/0b9a30f3 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/0b9a30f3 Branch: refs/heads/MNG-5984 Commit: 0b9a30f350f159a190e87c78e520ba7a7ae0642b Parents: 0db5e32 Author: Christian Schulte Authored: Thu Feb 23 03:14:21 2017 +0100 Committer: Christian Schulte Committed: Fri Feb 24 00:55:29 2017 +0100 -- apache-maven/src/bin/mvn | 6 +++--- apache-maven/src/bin/mvn.cmd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/0b9a30f3/apache-maven/src/bin/mvn -- diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn index 95a407d..cfb39b0 100755 --- a/apache-maven/src/bin/mvn +++ b/apache-maven/src/bin/mvn @@ -141,9 +141,9 @@ find_file_argument_basedir() { found_file_switch=0 for arg in "$@"; do if [ ${found_file_switch} -eq 1 ]; then - if [ -f ${arg} ]; then -basedir=$(dirname $(readlink -f "${arg}")) -if [ ! -d ${basedir} ]; then + if [ -f "${arg}" ]; then +basedir=$(dirname "$(readlink -f "${arg}")") +if [ ! -d "${basedir}" ]; then echo "Directory ${basedir} extracted from the -f/--file command-line argument ${arg} does not exist" >&2 exit 1 fi http://git-wip-us.apache.org/repos/asf/maven/blob/0b9a30f3/apache-maven/src/bin/mvn.cmd -- diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd index e527188..c86662b 100644 --- a/apache-maven/src/bin/mvn.cmd +++ b/apache-maven/src/bin/mvn.cmd @@ -120,7 +120,7 @@ if not exist "%FILE_ARG%" ( echo POM file %FILE_ARG% specified the -f/--file command-line argument does not exist >&2 goto error ) -call :get_directory_from_file %FILE_ARG% +call :get_directory_from_file "%FILE_ARG%" if not exist "%POM_DIR%" ( echo Directory %POM_DIR% extracted from the -f/--file command-line argument %FILE_ARG% does not exist >&2 goto error
[12/45] maven git commit: [MNG-6146] Several small stylistic and spelling improvements to code and documentation
http://git-wip-us.apache.org/repos/asf/maven/blob/17402659/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/sub/pom.xml -- diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/sub/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/sub/pom.xml new file mode 100644 index 000..bf777db --- /dev/null +++ b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mgmt/sub/pom.xml @@ -0,0 +1,71 @@ + + + + + + 4.0.0 + + +org.apache.maven.its.mng3925 +parent +0.1 + + + child + + Maven Integration Test :: MNG-3925 + +Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with +parent executions. + + + + + +org.apache.maven.its.plugins +maven-it-plugin-a +1.0-SNAPSHOT + + +child-1 +validate + + child-1 + + + +child-2 +validate + + child-2 + + + + +validate + + child-default + + + + + + + http://git-wip-us.apache.org/repos/asf/maven/blob/17402659/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml -- diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml deleted file mode 100644 index a816975..000 --- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 4.0.0 - - org.apache.maven.its.mng3925 - parent - 0.1 - pom - - Maven Integration Test :: MNG-3925 - -Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with -parent executions. - - - - - - -org.apache.maven.its.plugins -maven-it-plugin-a -1.0-SNAPSHOT - - -parent-1 -validate - - parent-1 - - - -parent-2 -validate - - parent-2 - - - - -validate - - parent-default - - - - - - - http://git-wip-us.apache.org/repos/asf/maven/blob/17402659/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml -- diff --git a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml b/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml deleted file mode 100644 index bf777db..000 --- a/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 4.0.0 - - -org.apache.maven.its.mng3925 -parent -0.1 - - - child - - Maven Integration Test :: MNG-3925 - -Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with -parent executions. - - - - - -org.apache.maven.its.plugins -maven-it-plugin-a -1.0-SNAPSHOT - - -child-1 -validate - - child-1 - - - -child-2 -validate - - child-2 - - - - -validate - - child-default - - - - - - - http://git-wip-us.apache.org/repos/asf/maven/blob/17402659/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mgmt/pom.xml -- diff --git a/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mgmt/pom.xml b/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mgmt/pom.xml new file mode 100644 index 000..2f35071 --- /dev/null +++ b/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mgmt/pom.xml @@ -0,0 +1,62 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4053 + test2 + 1.0-SNAPSHOT + + Maven Integration Test :: MNG-4053 + +Verify that attributes in plugin configuration elements are not erroneously duplicated to other elemen
[41/45] maven git commit: [MNG-6179] Remove WARNING about prerequisites usage
[MNG-6179] Remove WARNING about prerequisites usage Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/748551d0 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/748551d0 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/748551d0 Branch: refs/heads/MNG-6164 Commit: 748551d0274cc2eebfb2f976536d18277e564584 Parents: 529e8a6 Author: Karl Heinz Marbaise Authored: Fri Feb 24 22:49:21 2017 +0100 Committer: Karl Heinz Marbaise Committed: Wed Mar 1 20:05:45 2017 +0100 -- pom.xml | 7 --- 1 file changed, 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/748551d0/pom.xml -- diff --git a/pom.xml b/pom.xml index a085ffa..ba06feb 100644 --- a/pom.xml +++ b/pom.xml @@ -149,13 +149,6 @@ under the License. - - - - -${maven.version} - -
[38/45] maven git commit: fixed documentation errors
fixed documentation errors Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/0db5e32c Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/0db5e32c Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/0db5e32c Branch: refs/heads/MNG-6164 Commit: 0db5e32cf59851086e895f1f541853b61df38121 Parents: dc9c4db Author: Hervé Boutemy Authored: Thu Feb 23 19:07:58 2017 +0100 Committer: Hervé Boutemy Committed: Thu Feb 23 19:07:58 2017 +0100 -- .../src/main/java/org/apache/maven/cli/CLIManager.java | 8 maven-model-builder/src/site/apt/index.apt | 6 -- 2 files changed, 4 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/0db5e32c/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java -- diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java index 673f52d..a9038bf 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java @@ -108,7 +108,7 @@ public class CLIManager { options = new Options(); options.addOption( OptionBuilder.withLongOpt( "help" ).withDescription( "Display help information" ).create( HELP ) ); -options.addOption( OptionBuilder.withLongOpt( "file" ).hasArg().withDescription( "Force the use of an alternate POM file (or directory with pom.xml, disables output color)" ).create( ALTERNATE_POM_FILE ) ); +options.addOption( OptionBuilder.withLongOpt( "file" ).hasArg().withDescription( "Force the use of an alternate POM file (or directory with pom.xml)" ).create( ALTERNATE_POM_FILE ) ); options.addOption( OptionBuilder.withLongOpt( "define" ).hasArg().withDescription( "Define a system property" ).create( SET_SYSTEM_PROPERTY ) ); options.addOption( OptionBuilder.withLongOpt( "offline" ).withDescription( "Work offline" ).create( OFFLINE ) ); options.addOption( OptionBuilder.withLongOpt( "version" ).withDescription( "Display version information" ).create( VERSION ) ); @@ -130,16 +130,16 @@ public class CLIManager options.addOption( OptionBuilder.withLongOpt( "fail-at-end" ).withDescription( "Only fail the build afterwards; allow all non-impacted builds to continue" ).create( FAIL_AT_END ) ); options.addOption( OptionBuilder.withLongOpt( "fail-never" ).withDescription( "NEVER fail the build, regardless of project result" ).create( FAIL_NEVER ) ); options.addOption( OptionBuilder.withLongOpt( "resume-from" ).hasArg().withDescription( "Resume reactor from specified project" ).create( RESUME_FROM ) ); -options.addOption( OptionBuilder.withLongOpt( "projects" ).withDescription( "Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path." ).hasArg().create( PROJECT_LIST ) ); +options.addOption( OptionBuilder.withLongOpt( "projects" ).withDescription( "Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path" ).hasArg().create( PROJECT_LIST ) ); options.addOption( OptionBuilder.withLongOpt( "also-make" ).withDescription( "If project list is specified, also build projects required by the list" ).create( ALSO_MAKE ) ); options.addOption( OptionBuilder.withLongOpt( "also-make-dependents" ).withDescription( "If project list is specified, also build projects that depend on projects on the list" ).create( ALSO_MAKE_DEPENDENTS ) ); -options.addOption( OptionBuilder.withLongOpt( "log-file" ).hasArg().withDescription( "Log file where all build output will go." ).create( LOG_FILE ) ); +options.addOption( OptionBuilder.withLongOpt( "log-file" ).hasArg().withDescription( "Log file where all build output will go (disables output color)" ).create( LOG_FILE ) ); options.addOption( OptionBuilder.withLongOpt( "show-version" ).withDescription( "Display version information WITHOUT stopping build" ).create( SHOW_VERSION ) ); options.addOption( OptionBuilder.withLongOpt( "encrypt-master-password" ).hasOptionalArg().withDescription( "Encrypt master security password" ).create( ENCRYPT_MASTER_PASSWORD ) ); options.addOption( OptionBuilder.withLongOpt( "encrypt-password" ).hasOptionalArg().withDescription( "Encrypt server password" ).create( ENCRYPT_PASSWORD ) ); options.addOption( OptionBuilder.withLongOpt( "threads" ).hasArg().withDescription( "Thread count, for instance 2.0C where C i
[34/45] maven git commit: [MNG-6078] Perform a proper merge of the two sources of command line arguments
[MNG-6078] Perform a proper merge of the two sources of command line arguments - Needed to extend Commons CLI's CommandLine just to perform the merged Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/dc9c4db4 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/dc9c4db4 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/dc9c4db4 Branch: refs/heads/MNG-6164 Commit: dc9c4db4494b62e2231bb67b39678decf6329852 Parents: 5885e70 Author: Stephen Connolly Authored: Tue Feb 21 10:10:21 2017 + Committer: Stephen Connolly Committed: Thu Feb 23 12:44:34 2017 + -- .../java/org/apache/maven/cli/MavenCli.java | 25 +++--- .../org/apache/maven/cli/MergedCommandLine.java | 75 ++ .../java/org/apache/maven/cli/MavenCliTest.java | 83 +++- 3 files changed, 149 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/dc9c4db4/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java -- diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index f788a5f..8d38ab0 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 @@ -383,7 +383,7 @@ public class MavenCli CLIManager cliManager = new CLIManager(); List args = new ArrayList<>(); - +CommandLine mavenConfig = null; try { File configFile = new File( cliRequest.multiModuleProjectDirectory, MVN_MAVEN_CONFIG ); @@ -398,8 +398,8 @@ public class MavenCli } } -CommandLine config = cliManager.parse( args.toArray( new String[args.size()] ) ); -List unrecongized = config.getArgList(); +mavenConfig = cliManager.parse( args.toArray( new String[args.size()] ) ); +List unrecongized = mavenConfig.getArgList(); if ( !unrecongized.isEmpty() ) { throw new ParseException( "Unrecognized maven.config entries: " + unrecongized ); @@ -415,21 +415,14 @@ public class MavenCli try { -int index = 0; -for ( String arg : cliRequest.args ) +if ( mavenConfig == null ) { -if ( arg.startsWith( "-D" ) ) -{ -// a property definition so needs to come last so that the last property wins -args.add( arg ); -} -else -{ -// not a property definition so needs to come first to override maven.config -args.add( index++, arg ); -} +cliRequest.commandLine = cliManager.parse( cliRequest.args ); +} +else +{ +cliRequest.commandLine = new MergedCommandLine( cliManager.parse( cliRequest.args ), mavenConfig ); } -cliRequest.commandLine = cliManager.parse( args.toArray( new String[args.size()] ) ); } catch ( ParseException e ) { http://git-wip-us.apache.org/repos/asf/maven/blob/dc9c4db4/maven-embedder/src/main/java/org/apache/maven/cli/MergedCommandLine.java -- diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MergedCommandLine.java b/maven-embedder/src/main/java/org/apache/maven/cli/MergedCommandLine.java new file mode 100644 index 000..cb0a587 --- /dev/null +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MergedCommandLine.java @@ -0,0 +1,75 @@ +package org.apache.maven.cli; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Option; + +import java.util.ArrayList; +import java.util.L
[25/45] maven git commit: [MNG-6150] Javadoc improvements for 3.5.0
http://git-wip-us.apache.org/repos/asf/maven/blob/b66bdb9c/maven-core/src/main/java/org/apache/maven/project/MavenProject.java -- 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 77206bd..cc35a57 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 @@ -221,7 +221,7 @@ public class MavenProject this.artifact = artifact; } -// @todo I would like to get rid of this. jvz. +// TODO I would like to get rid of this. jvz. public Model getModel() { return model; @@ -352,7 +352,7 @@ public class MavenProject { if ( a.getArtifactHandler().isAddedToClasspath() ) { -// TODO: let the scope handler deal with this +// TODO let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { @@ -364,7 +364,7 @@ public class MavenProject return list; } -// TODO: this checking for file == null happens because the resolver has been confused about the root +// TODO this checking for file == null happens because the resolver has been confused about the root // artifact or not. things like the stupid dummy artifact coming from surefire. public List getTestClasspathElements() throws DependencyResolutionRequiredException @@ -408,7 +408,7 @@ public class MavenProject for ( Artifact a : getArtifacts() ) { if ( a.getArtifactHandler().isAddedToClasspath() -// TODO: let the scope handler deal with this +// TODO let the scope handler deal with this && ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) ) { addArtifactPath( a, list ); @@ -470,7 +470,7 @@ public class MavenProject public String getName() { -// TODO: this should not be allowed to be null. +// TODO this should not be allowed to be null. if ( getModel().getName() != null ) { return getModel().getName(); @@ -1575,10 +1575,10 @@ public class MavenProject for ( Artifact a : getArtifacts() ) { -// TODO: classpath check doesn't belong here - that's the other method +// TODO classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() ) { -// TODO: let the scope handler deal with this +// TODO let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { @@ -1603,7 +1603,7 @@ public class MavenProject for ( Artifact a : getArtifacts() ) { -// TODO: let the scope handler deal with this +// TODO let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { @@ -1629,7 +1629,7 @@ public class MavenProject for ( Artifact a : getArtifacts() ) { -// TODO: classpath check doesn't belong here - that's the other method +// TODO classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() ) { list.add( a ); @@ -1680,7 +1680,7 @@ public class MavenProject for ( Artifact a : getArtifacts() ) { -// TODO: let the scope handler deal with this +// TODO let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) { Dependency dependency = new Dependency(); @@ -1705,9 +1705,9 @@ public class MavenProject for ( Artifact a : getArtifacts() ) { -// TODO: classpath check doesn't belong here - that's the other method +// TODO classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() -// TODO: let the scope handler deal with this +// TODO let the scope handler deal with this && ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) ) {