maven-surefire git commit: [SUREFIRE-1322] Surefire and Failsafe should dump critical errors in dump file and console

2016-12-31 Thread tibordigana
Repository: maven-surefire
Updated Branches:
  refs/heads/master 27fbe2c19 -> 66bc4c083


[SUREFIRE-1322] Surefire and Failsafe should dump critical errors in dump file 
and console


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/66bc4c08
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/66bc4c08
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/66bc4c08

Branch: refs/heads/master
Commit: 66bc4c0839ba11af7a8915930f76abf3cd58ee53
Parents: 27fbe2c
Author: Tibor17 
Authored: Sat Dec 31 10:25:00 2016 +0100
Committer: Tibor17 
Committed: Sat Dec 31 10:25:00 2016 +0100

--
 .../surefire/util/internal/DumpFileUtils.java   |  2 +-
 ...e735ForkFailWithRedirectConsoleOutputIT.java | 32 +---
 2 files changed, 28 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/66bc4c08/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java
--
diff --git 
a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java
 
b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java
index 47a1386..2c110f5 100644
--- 
a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java
+++ 
b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java
@@ -1 +1 @@
-package org.apache.maven.surefire.util.internal;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import org.apache.maven.surefire.report.ReporterConfiguration;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOE
 xception;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Dumps a text or exception in dump file.
 * Each call logs a date when it was written to the dump file.
 *
 * @author mailto:tibordig...@apache.org";>Tibor Digana (tibor17)
 * @since 2.19.2
 */
public final class DumpFileUtils
{
private DumpFileUtils()
{
throw new IllegalStateException( "no instantiable constructor" );
}

/**
 * New dump file. Synchronized object appears in main memory and perfectly 
visible in other threads.
 */
public static synchronized File newDumpFile( String dumpFileName, 
ReporterConfiguration configuration )
{
return new File( configuration.getReportsDirectory(), dumpFileName );
}

public static void dumpException( Throwable t, File dumpFile )
{
dumpException( t, null, dumpFile );
}

public static void dumpException
 ( Throwable t, String msg, File dumpFile )
{
try
{
if ( t != null && dumpFile != null && ( dumpFile.exists() || 
dumpFile.createNewFile() ) )
{
Writer fw = createWriter( dumpFile );
if ( msg != null )
{
fw.append( msg )
.append( StringUtils.NL );
}
PrintWriter pw = new PrintWriter( fw );
t.printStackTrace( pw );
pw.flush();
fw.append( StringUtils.NL )
.append( StringUtils.NL );
fw.flush();
fw.close();
}
}
catch ( Exception e )
{
// do nothing
}
}

public static void dumpText( String msg, File dumpFile )
{
try
{
if ( msg != null && dumpFile != null && ( dumpFile.exists() || 
dumpFile.createNewFile() ) )
{
   
  Writer fw = createWriter( dumpFile )
.append( msg )
.append( StringUtils.NL )
.append( StringUtils.NL );
fw.flush();
fw.close();
}
}
catch ( Exception e )
{
// do nothing
}
 

svn commit: r1776802 - in /maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats: goals.txt invoker.properties

2016-12-31 Thread schulte
Author: schulte
Date: Sat Dec 31 17:29:23 2016
New Revision: 1776802

URL: http://svn.apache.org/viewvc?rev=1776802&view=rev
Log:
o Updated to remove 'goals.txt' file not supported by 
maven-invoker-plugin-3.0.0-SNAPSHOT.


Added:

maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats/invoker.properties
   (with props)
Removed:

maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats/goals.txt

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats/invoker.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats/invoker.properties?rev=1776802&view=auto
==
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats/invoker.properties
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats/invoker.properties
 Sat Dec 31 17:29:23 2016
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.goals=clean 
org.apache.maven.plugins:maven-assembly-plugin:${testVersion}:single

Propchange: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats/invoker.properties
--
svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats/invoker.properties
--
svn:keywords = Author Date Id Revision

Propchange: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/basic-features/formats/invoker.properties
--
svn:mime-type = text/plain




maven-wagon git commit: Adding timestamps to wagon-http Surefire logs

2016-12-31 Thread gboue
Repository: maven-wagon
Updated Branches:
  refs/heads/jetty-8 df0af51bc -> 05d04b298


Adding timestamps to wagon-http Surefire logs

* Be able to measure how long it takes to download the 4Go test file
(and write the downloaded data to disk) in HugeFileDownloadTest.
* Adding log lines before/after the creation of the test file and
download, to measure how much time this actually takes.

Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/05d04b29
Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/05d04b29
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/05d04b29

Branch: refs/heads/jetty-8
Commit: 05d04b298137b9d072fd284f34ade504ec163c9f
Parents: df0af51
Author: Guillaume Boué 
Authored: Sat Dec 31 18:33:32 2016 +0100
Committer: Guillaume Boué 
Committed: Sat Dec 31 18:33:32 2016 +0100

--
 wagon-providers/wagon-http/pom.xml |  2 ++
 .../wagon/providers/http/HugeFileDownloadTest.java | 13 ++---
 2 files changed, 12 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/05d04b29/wagon-providers/wagon-http/pom.xml
--
diff --git a/wagon-providers/wagon-http/pom.xml 
b/wagon-providers/wagon-http/pom.xml
index e32cfcc..27554b9 100644
--- a/wagon-providers/wagon-http/pom.xml
+++ b/wagon-providers/wagon-http/pom.xml
@@ -163,6 +163,8 @@ under the License.
   
 true
 
true
+
true
+
-MM-dd'T'HH:mm:ss.SSS
   
 
   

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/05d04b29/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
--
diff --git 
a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
 
b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
index fba63c4..4489b6b 100644
--- 
a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
+++ 
b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
@@ -29,6 +29,8 @@ import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.servlet.DefaultServlet;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
@@ -46,6 +48,8 @@ public class HugeFileDownloadTest
 extends PlexusTestCase
 {
 
+private static final Logger LOGGER = LoggerFactory.getLogger( 
HugeFileDownloadTest.class );
+
 private static long HUGE_FILE_SIZE =
 Integer.valueOf( Integer.MAX_VALUE ).longValue() + Integer.valueOf( 
Integer.MAX_VALUE ).longValue();
 
@@ -78,9 +82,11 @@ public class HugeFileDownloadTest
 
 dest = File.createTempFile( "huge", "txt" );
 
+LOGGER.info( "Fetching 'hugefile.txt' with content length" );
 wagon.get( "hugefile.txt", dest );
 
 Assert.assertTrue( dest.length() >= HUGE_FILE_SIZE );
+LOGGER.info( "The file was successfully fetched" );
 
 wagon.disconnect();
 }
@@ -91,7 +97,6 @@ public class HugeFileDownloadTest
 hugeFile.delete();
 }
 
-
 }
 
 public void testDownloadHugeFileWithChunked()
@@ -137,9 +142,11 @@ public class HugeFileDownloadTest
 
 dest = File.createTempFile( "huge", "txt" );
 
+LOGGER.info( "Fetching 'hugefile.txt' in chunks" );
 wagon.get( "hugefile.txt", dest );
 
 Assert.assertTrue( dest.length() >= HUGE_FILE_SIZE );
+LOGGER.info( "The file was successfully fetched" );
 
 wagon.disconnect();
 }
@@ -150,10 +157,8 @@ public class HugeFileDownloadTest
 hugeFile.delete();
 }
 
-
 }
 
-
 protected Wagon getWagon()
 throws Exception
 {
@@ -169,6 +174,7 @@ public class HugeFileDownloadTest
 private void makeHugeFile( File hugeFile )
 throws Exception
 {
+LOGGER.info( "Creating test file" );
 if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
 {
 Process p = new ProcessBuilder( "fsutil", "file", "createnew", 
hugeFile.getAbsolutePath(),
@@ -183,6 +189,7 @@ public class HugeFileDownloadTest
 ra.write( 1 );
 ra.close();
 }
+LOGGER.info( "Test file created" );
 }
 
 }



maven-resolver git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management. [MNG-6139] Addition of command line option 'legacy-dependency-management'.

2016-12-31 Thread schulte
Repository: maven-resolver
Updated Branches:
  refs/heads/master 763cac233 -> 8cec8a788


[MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency 
management.
[MNG-6139] Addition of command line option 'legacy-dependency-management'.

This reverts commit 763cac233d37e2240e43dfaf72023ba1f8ffd139.
There will be no such command line option following the discussion on dev@.


Project: http://git-wip-us.apache.org/repos/asf/maven-resolver/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-resolver/commit/8cec8a78
Tree: http://git-wip-us.apache.org/repos/asf/maven-resolver/tree/8cec8a78
Diff: http://git-wip-us.apache.org/repos/asf/maven-resolver/diff/8cec8a78

Branch: refs/heads/master
Commit: 8cec8a788c59fd62a2c8486073412f5b3efd47a5
Parents: 763cac2
Author: Christian Schulte 
Authored: Sat Dec 31 19:24:17 2016 +0100
Committer: Christian Schulte 
Committed: Sat Dec 31 19:45:43 2016 +0100

--
 .../aether/internal/impl/DefaultDependencyCollector.java | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/8cec8a78/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
--
diff --git 
a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
 
b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
index aaf5865..0c98ef4 100644
--- 
a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
+++ 
b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
@@ -369,22 +369,13 @@ public class DefaultDependencyCollector
 DependencyTraverser depTraverser, 
VersionFilter verFilter, Dependency dependency,
 List relocations, boolean 
disableVersionManagement )
 {
-if ( args.session.getData().get( "maven.legacyDependencyManagement" ) 
!= null
- && depSelector != null && !depSelector.selectDependency( 
dependency ) )
-{
-// Legacy behaviour before MRESOLVER-9.
-return;
-}
-
 PremanagedDependency preManaged =
 PremanagedDependency.create( depManager, dependency, 
disableVersionManagement, args.premanagedState );
 
 dependency = preManaged.managedDependency;
 
-if ( args.session.getData().get( "maven.legacyDependencyManagement" ) 
== null
- && depSelector != null && !depSelector.selectDependency( 
dependency ) )
+if ( depSelector != null && !depSelector.selectDependency( dependency 
) )
 {
-// Corrected behaviour after MRESOLVER-9.
 return;
 }
 



maven-integration-testing git commit: [MNG-6139] Addition of command line option 'legacy-dependency-management'.

2016-12-31 Thread schulte
Repository: maven-integration-testing
Updated Branches:
  refs/heads/master 37d46fcad -> 788c69563


[MNG-6139] Addition of command line option 'legacy-dependency-management'.

This reverts commit 683e932eec9b021519824d4600f3ebf7dcbd6f28.
There will be no such command line option following the discussion on dev@.


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/788c6956
Tree: 
http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/788c6956
Diff: 
http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/788c6956

Branch: refs/heads/master
Commit: 788c695631e44de0a1d65ae8a3d52af6637a0eaa
Parents: 37d46fc
Author: Christian Schulte 
Authored: Sat Dec 31 19:21:20 2016 +0100
Committer: Christian Schulte 
Committed: Sat Dec 31 19:21:20 2016 +0100

--
 ...ependencyManagementExclusionMerge34Test.java | 31 -
 ...227DependencyOptionalFlagManagementTest.java | 48 
 2 files changed, 79 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/788c6956/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMerge34Test.java
--
diff --git 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMerge34Test.java
 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMerge34Test.java
index fc353d5..acf05c7 100644
--- 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMerge34Test.java
+++ 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMerge34Test.java
@@ -67,35 +67,4 @@ public class 
MavenITmng4720DependencyManagementExclusionMerge34Test
 assertFalse( classpath.toString(), classpath.contains( "d-0.1.jar" ) );
 }
 
-/**
- * Verify the effective exclusions applied during transitive dependency 
resolution when both the regular
- * dependency section and dependency management declare exclusions for a 
particular dependency.
- */
-public void testitLegacy()
-throws Exception
-{
-File testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/mng-4720" );
-
-Verifier verifier = newVerifier( testDir.getAbsolutePath() );
-verifier.setAutoclean( false );
-verifier.deleteArtifacts( "org.apache.maven.its.mng4720" );
-verifier.addCliOption( "-s" );
-verifier.addCliOption( "settings.xml" );
-verifier.addCliOption( "-ldm" );
-verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", 
verifier.newDefaultFilterProperties() );
-verifier.executeGoal( "validate" );
-verifier.verifyErrorFreeLog();
-verifier.resetStreams();
-
-List classpath = verifier.loadLines( "target/classpath.txt", 
"UTF-8" );
-
-assertTrue( classpath.toString(), classpath.contains( "a-0.1.jar" ) );
-assertTrue( classpath.toString(), classpath.contains( "c-0.1.jar" ) );
-
-assertFalse( classpath.toString(), classpath.contains( "b-0.1.jar" ) );
-
-// should better have been excluded as well, now it's a matter of 
backward-compat (-ldm)
-assertTrue( classpath.toString(), classpath.contains( "d-0.1.jar" ) );
-}
-
 }

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/788c6956/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5227DependencyOptionalFlagManagementTest.java
--
diff --git 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5227DependencyOptionalFlagManagementTest.java
 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5227DependencyOptionalFlagManagementTest.java
index 8371dfe..3dc0ad8 100644
--- 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5227DependencyOptionalFlagManagementTest.java
+++ 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5227DependencyOptionalFlagManagementTest.java
@@ -86,52 +86,4 @@ public class 
MavenITmng5227DependencyOptionalFlagManagementTest
 assertFalse( classpath.toString(), classpath.contains( 
"transitive-0.1.jar" ) );
 }
 
-/**
- * Verify that a dependency's optional flag is not subject to dependency 
management. This part of the test checks
- * the effective model.
- */
-public void testitLegacyModel()
-throws Exception
-{
-File testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/mng-4600/model" );
-
-Verifier verifier = newVerifier( testDir.getAbsolutePath() );
-verifier.setAutoclean( false );
-verifier.de

[1/2] maven git commit: [MNG-6135] Maven plugins and core extensions are not dependencies, they should be resolved the same way as projects.

2016-12-31 Thread schulte
Repository: maven
Updated Branches:
  refs/heads/master 1a94cd4a7 -> ae9c2269e


[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.4 get the
  correct resolution, all other plugins will be resolved with direct 'test' and
  'provided' dependencies ignored but direct 'optional' dependencies.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/6d68777c
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/6d68777c
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/6d68777c

Branch: refs/heads/master
Commit: 6d68777c7ed6de2ad8fca6495b65b138bc1f7085
Parents: 1a94cd4
Author: Christian Schulte 
Authored: Sat Dec 31 19:17:33 2016 +0100
Committer: Christian Schulte 
Committed: Sat Dec 31 19:42:38 2016 +0100

--
 .../DefaultPluginDependenciesResolver.java  | 211 +++
 1 file changed, 165 insertions(+), 46 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/maven/blob/6d68777c/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 fed2a45..874ed05 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
@@ -24,6 +24,7 @@ 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;
@@ -57,8 +58,11 @@ import 
org.eclipse.aether.resolution.DependencyResolutionException;
 import org.eclipse.aether.util.artifact.JavaScopes;
 import org.eclipse.aether.util.filter.AndDependencyFilter;
 import org.eclipse.aether.util.filter.ScopeDependencyFilter;
+import org.eclipse.aether.util.graph.manager.ClassicDependencyManager;
 import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
 import org.eclipse.aether.util.graph.selector.AndDependencySelector;
+import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector;
+import org.eclipse.aether.util.graph.selector.OptionalDependencySelector;
 import 
org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
 import org.eclipse.aether.util.graph.visitor.FilteringDependencyVisitor;
 import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator;
@@ -79,6 +83,10 @@ public class DefaultPluginDependenciesResolver
 
 private static final String REPOSITORY_CONTEXT = "plugin";
 
+private static final String DEFAULT_PREREQUISITES = "2.0";
+
+private static final ComparableVersion DEFAULT_RESULTION_PREREQUISITES = 
new ComparableVersion( "3.4" );
+
 @Requirement
 private Logger logger;
 
@@ -91,50 +99,21 @@ public class DefaultPluginDependenciesResolver
 session.getArtifactTypeRegistry().get( 
"maven-plugin" ) );
 }
 
+@Override
 public Artifact resolve( Plugin plugin, List 
repositories, RepositorySystemSession session )
 throws PluginResolutionException
 {
-RequestTrace trace = RequestTrace.newChild( null, plugin );
-
-Artifact pluginArtifact = toArtifact( plugin, session );
-
 try
 {
-DefaultRepositorySystemSession pluginSession = new 
DefaultRepositorySystemSession( session );
-pluginSession.setArtifactDescriptorPolicy( new 
SimpleArtifactDescriptorPolicy( true, false ) );
-
-ArtifactDescriptorRequest request =
-new ArtifactDescriptorRequest( pluginArtifact, repositories, 
REPOSITORY_CONTEXT );
-request.setTrace( trace );
-ArtifactDescriptorResult result = 
repoSystem.readArtifactDescriptor( pluginSession, request );
-
-pluginArtifact = result.getArtifact();
-
-String requiredMavenVersion = (String) result.getProperties().get( 
"prerequisites.maven" );
-if ( requiredMavenVersion != null )
-{
-Map props = new LinkedHashMap<>( 
pluginArtifact.getProperties() );
-props.put( "requiredMavenVersion", requiredMavenVersion );
-pluginArtifact = pluginArtifact.setProperties( props );
-}
+final Ar

[2/2] maven git commit: [MNG-6139] Addition of command line option 'legacy-dependency-management'.

2016-12-31 Thread schulte
[MNG-6139] Addition of command line option 'legacy-dependency-management'.

This reverts commits

  bb8a797c5bef4629c4c9127b1a6d94724b6cc430
  7e70c59e43f112c12282de49d937e870c9545fc9

There will be no such command line option following the discussion on dev@.
Asking me to revert and then complaining about all those revert commits?


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ae9c2269
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ae9c2269
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ae9c2269

Branch: refs/heads/master
Commit: ae9c2269e41c37bfa9e3aae711e827d6efbb6da7
Parents: 6d68777
Author: Christian Schulte 
Authored: Sat Dec 31 19:19:04 2016 +0100
Committer: Christian Schulte 
Committed: Sat Dec 31 19:43:46 2016 +0100

--
 .../java/org/apache/maven/DefaultMaven.java | 43 +---
 .../java/org/apache/maven/RepositoryUtils.java  | 23 ---
 .../execution/DefaultMavenExecutionRequest.java | 26 
 .../maven/execution/MavenExecutionRequest.java  | 11 -
 .../DefaultRepositorySystemSessionFactory.java  |  7 
 .../maven/project/DefaultProjectBuilder.java|  1 -
 .../project/DefaultProjectBuildingRequest.java  | 22 --
 .../maven/project/ProjectBuildingRequest.java   | 10 -
 .../java/org/apache/maven/cli/CLIManager.java   |  3 --
 .../java/org/apache/maven/cli/MavenCli.java |  9 +---
 .../building/DefaultModelBuildingRequest.java   | 21 --
 .../building/FilterModelBuildingRequest.java| 15 +--
 .../model/building/ModelBuildingRequest.java| 10 -
 .../DefaultDependencyManagementInjector.java| 27 ++--
 .../ArtifactDescriptorReaderDelegate.java   | 19 -
 15 files changed, 40 insertions(+), 207 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/maven/blob/ae9c2269/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
--
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java 
b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
index d6f6e17..6954e9b 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
@@ -102,36 +102,31 @@ public class DefaultMaven
 {
 MavenExecutionResult result;
 
-synchronized ( RepositoryUtils.class )
+try
 {
-try
-{
-RepositoryUtils.legacyDependencyManagement = 
request.isLegacyDependencyManagementRequested();
-result = doExecute( request );
-}
-catch ( OutOfMemoryError e )
+result = doExecute( request );
+}
+catch ( OutOfMemoryError e )
+{
+result = addExceptionToResult( new DefaultMavenExecutionResult(), 
e );
+}
+catch ( RuntimeException e )
+{
+// TODO Hack to make the cycle detection the same for the new 
graph builder
+if ( e.getCause() instanceof ProjectCycleException )
 {
-result = addExceptionToResult( new 
DefaultMavenExecutionResult(), e );
+result = addExceptionToResult( new 
DefaultMavenExecutionResult(), e.getCause() );
 }
-catch ( RuntimeException e )
-{
-// TODO Hack to make the cycle detection the same for the new 
graph builder
-if ( e.getCause() instanceof ProjectCycleException )
-{
-result = addExceptionToResult( new 
DefaultMavenExecutionResult(), e.getCause() );
-}
-else
-{
-result = addExceptionToResult( new 
DefaultMavenExecutionResult(),
-   new InternalErrorException( 
"Internal error: " + e, e ) );
-}
-}
-finally
+else
 {
-legacySupport.setSession( null );
-RepositoryUtils.legacyDependencyManagement = false;
+result = addExceptionToResult( new 
DefaultMavenExecutionResult(),
+   new InternalErrorException( 
"Internal error: " + e, e ) );
 }
 }
+finally
+{
+legacySupport.setSession( null );
+}
 
 return result;
 }

http://git-wip-us.apache.org/repos/asf/maven/blob/ae9c2269/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 d844254..087

maven git commit: [MNG-6135] Maven plugins and core extensions are not dependencies, they should be resolved the same way as projects. [MNG-4276] Plugins with indirect dependency on plexus-utils are s

2016-12-31 Thread schulte
Repository: maven
Updated Branches:
  refs/heads/master ae9c2269e -> 859651acf


[MNG-6135] Maven plugins and core extensions are not dependencies, they should 
be resolved the same way as projects.
[MNG-4276] Plugins with indirect dependency on plexus-utils are stuck with 
plexus-utils:1.1
[MNG-4274] Plugins with an undeclared but transitive dependency on plexus-utils 
via a core artifact get wrong version of p-u

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/859651ac
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/859651ac
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/859651ac

Branch: refs/heads/master
Commit: 859651acfc73af2a2afcd044306eaa0e5e5ac51a
Parents: ae9c226
Author: Christian Schulte 
Authored: Sat Dec 31 21:27:00 2016 +0100
Committer: Christian Schulte 
Committed: Sat Dec 31 21:28:47 2016 +0100

--
 .../DefaultPluginDependenciesResolver.java  | 42 ++--
 1 file changed, 20 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/maven/blob/859651ac/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 874ed05..446fd01 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
@@ -150,21 +150,21 @@ public class DefaultPluginDependenciesResolver
 
 private final int depth;
 
-private final DependencyManager defaultManager;
+private final DependencyManager delegate;
 
 private final List exclusions;
 
-PluginDependencyManager()
+PluginDependencyManager( final DependencyManager delegate )
 {
-this( 0, session.getDependencyManager(), new 
LinkedList() );
+this( 0, delegate, new LinkedList() );
 }
 
-private PluginDependencyManager( final int depth, final 
DependencyManager defaultManager,
+private PluginDependencyManager( final int depth, final 
DependencyManager delegate,
  final List exclusions )
 {
 super();
 this.depth = depth;
-this.defaultManager = defaultManager;
+this.delegate = delegate;
 this.exclusions = exclusions;
 }
 
@@ -189,8 +189,8 @@ public class DefaultPluginDependenciesResolver
 }
 }
 
-return !excluded && this.depth >= 2 && this.defaultManager != 
null
-   ? this.defaultManager.manageDependency( dependency )
+return !excluded && this.depth >= 2 && this.delegate != null
+   ? this.delegate.manageDependency( dependency )
: null;
 
 }
@@ -199,8 +199,8 @@ public class DefaultPluginDependenciesResolver
 public DependencyManager deriveChildManager( final 
DependencyCollectionContext context )
 {
 return new PluginDependencyManager( this.depth + 1,
-this.defaultManager != null
-? 
this.defaultManager.deriveChildManager( context )
+this.delegate != null
+? 
this.delegate.deriveChildManager( context )
 : null,
 this.exclusions );
 
@@ -325,13 +325,15 @@ public class DefaultPluginDependenciesResolver
 final DependencyGraphTransformer pluginDependencyGraphTransformer =
 ChainedDependencyGraphTransformer.newInstance( 
session.getDependencyGraphTransformer(), transformer );
 
-final PluginD