You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2017/06/07 17:44:46 UTC

[01/14] maven git commit: Doc improvement in simplelogger.properties [Forced Update!]

Repository: maven
Updated Branches:
  refs/heads/MNG-6069 7e8b0e090 -> 0abc475f7 (forced update)


Doc improvement in simplelogger.properties


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

Branch: refs/heads/MNG-6069
Commit: 3938817fd3e0ad62efe335307406e70bff876834
Parents: c2c6259
Author: Michael Osipov <mi...@apache.org>
Authored: Fri Apr 21 22:50:11 2017 +0200
Committer: Michael Osipov <mi...@apache.org>
Committed: Fri Apr 21 22:50:11 2017 +0200

----------------------------------------------------------------------
 apache-maven/src/conf/logging/simplelogger.properties | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/3938817f/apache-maven/src/conf/logging/simplelogger.properties
----------------------------------------------------------------------
diff --git a/apache-maven/src/conf/logging/simplelogger.properties b/apache-maven/src/conf/logging/simplelogger.properties
index eb3d049..8dea717 100644
--- a/apache-maven/src/conf/logging/simplelogger.properties
+++ b/apache-maven/src/conf/logging/simplelogger.properties
@@ -24,8 +24,8 @@ org.slf4j.simpleLogger.levelInBrackets=true
 org.slf4j.simpleLogger.log.Sisu=info
 org.slf4j.simpleLogger.warnLevelString=WARNING
 
-# MNG-6181: mvn -X also prints all debug logging from http-client
+# MNG-6181: mvn -X also prints all debug logging from HttpClient
 # Be aware that the shaded packages are used
 # org.apache.http -> org.apache.maven.wagon.providers.http.httpclient
 org.slf4j.simpleLogger.log.org.apache.maven.wagon.providers.http.httpclient=off
-org.slf4j.simpleLogger.log.org.apache.maven.wagon.providers.http.httpclient.wire=off
\ No newline at end of file
+org.slf4j.simpleLogger.log.org.apache.maven.wagon.providers.http.httpclient.wire=off


[12/14] maven git commit: [MNG-6084] Support JSR 250 annotations

Posted by kh...@apache.org.
[MNG-6084] Support JSR 250 annotations


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

Branch: refs/heads/MNG-6069
Commit: a7dddcb87626fec256f1b8ccbe957f94cdf401e4
Parents: 66fc74d
Author: Dan Tran <da...@apache.org>
Authored: Sun Sep 11 21:07:39 2016 -0700
Committer: Michael Osipov <mi...@apache.org>
Committed: Thu May 25 20:05:35 2017 +0200

----------------------------------------------------------------------
 maven-core/src/main/resources/META-INF/maven/extension.xml    | 3 +++
 maven-embedder/pom.xml                                        | 4 ++++
 .../src/main/java/org/apache/maven/cli/MavenCli.java          | 7 ++++---
 pom.xml                                                       | 5 +++++
 4 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/a7dddcb8/maven-core/src/main/resources/META-INF/maven/extension.xml
----------------------------------------------------------------------
diff --git a/maven-core/src/main/resources/META-INF/maven/extension.xml b/maven-core/src/main/resources/META-INF/maven/extension.xml
index 1d24d92..1f0b95f 100644
--- a/maven-core/src/main/resources/META-INF/maven/extension.xml
+++ b/maven-core/src/main/resources/META-INF/maven/extension.xml
@@ -98,6 +98,8 @@ under the License.
     <exportedPackage>javax.enterprise.util.*</exportedPackage>
     <exportedPackage>javax.enterprise.inject.*</exportedPackage>
 
+    <!-- javax.annotation (JSR-250) -->
+    <exportedPackage>javax.annotation.*</exportedPackage>
 
     <!-- 
       | We may potentially want to export these, but right now I'm not sure that anything Guice specific needs
@@ -157,6 +159,7 @@ under the License.
     <exportedArtifact>org.apache.maven.resolver:maven-resolver-impl</exportedArtifact>
 
     <exportedArtifact>javax.inject:javax.inject</exportedArtifact>
+    <exportedArtifact>javax.annotation:jsr250-api</exportedArtifact>
     <exportedArtifact>org.slf4j:slf4j-api</exportedArtifact>
     <exportedArtifact>org.fusesource.jansi:jansi</exportedArtifact>
 

http://git-wip-us.apache.org/repos/asf/maven/blob/a7dddcb8/maven-embedder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 52e9c82..7bd2650 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -88,6 +88,10 @@ under the License.
       <artifactId>javax.inject</artifactId>
     </dependency>
     <dependency>
+      <groupId>javax.annotation</groupId>
+      <artifactId>jsr250-api</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/a7dddcb8/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 e1e58c8..641a2a9 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
@@ -601,9 +601,9 @@ public class MavenCli
 
         ClassRealm containerRealm = setupContainerRealm( cliRequest.classWorld, coreRealm, extClassPath, extensions );
 
-        ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld( cliRequest.classWorld ).setRealm(
-            containerRealm ).setClassPathScanning( PlexusConstants.SCANNING_INDEX ).setAutoWiring( true ).setName(
-            "maven" );
+        ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld( cliRequest.classWorld )
+            .setRealm( containerRealm ).setClassPathScanning( PlexusConstants.SCANNING_INDEX ).setAutoWiring( true )
+            .setJSR250Lifecycle( true ).setName( "maven" );
 
         Set<String> exportedArtifacts = new HashSet<>( coreEntry.getExportedArtifacts() );
         Set<String> exportedPackages = new HashSet<>( coreEntry.getExportedPackages() );
@@ -697,6 +697,7 @@ public class MavenCli
                 .setRealm( containerRealm ) //
                 .setClassPathScanning( PlexusConstants.SCANNING_INDEX ) //
                 .setAutoWiring( true ) //
+                .setJSR250Lifecycle( true ) //
                 .setName( "maven" );
 
             DefaultPlexusContainer container = new DefaultPlexusContainer( cc, new AbstractModule()

http://git-wip-us.apache.org/repos/asf/maven/blob/a7dddcb8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5e12e36..d6f165c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -259,6 +259,11 @@ under the License.
         <version>1</version>
       </dependency>
       <dependency>
+        <groupId>javax.annotation</groupId>
+        <artifactId>jsr250-api</artifactId>
+        <version>1.0</version>
+      </dependency>
+      <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-component-annotations</artifactId>
         <version>${plexusVersion}</version>


[14/14] maven git commit: [MNG-6069] Migrate to non deprecated parts of Commons CLI

Posted by kh...@apache.org.
[MNG-6069] Migrate to non deprecated parts of Commons CLI


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

Branch: refs/heads/MNG-6069
Commit: 0abc475f7d95c05f40ad35c73053060f0cdd7982
Parents: eb6b212
Author: Karl Heinz Marbaise <kh...@apache.org>
Authored: Sat Mar 18 18:18:27 2017 +0100
Committer: Karl Heinz Marbaise <kh...@apache.org>
Committed: Wed Jun 7 19:44:34 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/maven/cli/CLIManager.java   | 118 ++++++++++---------
 1 file changed, 60 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/0abc475f/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 a9038bf..20376d9 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
@@ -24,9 +24,9 @@ import java.io.PrintWriter;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.GnuParser;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 
@@ -35,43 +35,43 @@ import org.apache.commons.cli.ParseException;
  */
 public class CLIManager
 {
-    public static final char ALTERNATE_POM_FILE = 'f';
+    public static final String ALTERNATE_POM_FILE = "f";
 
-    public static final char BATCH_MODE = 'B';
+    public static final String BATCH_MODE = "B";
 
-    public static final char SET_SYSTEM_PROPERTY = 'D';
+    public static final String SET_SYSTEM_PROPERTY = "D";
 
-    public static final char OFFLINE = 'o';
+    public static final String OFFLINE = "o";
 
-    public static final char QUIET = 'q';
+    public static final String QUIET = "q";
 
-    public static final char DEBUG = 'X';
+    public static final String DEBUG = "X";
 
-    public static final char ERRORS = 'e';
+    public static final String ERRORS = "e";
 
-    public static final char HELP = 'h';
+    public static final String HELP = "h";
 
-    public static final char VERSION = 'v';
+    public static final String VERSION = "v";
 
-    public static final char SHOW_VERSION = 'V';
+    public static final String SHOW_VERSION = "V";
 
-    public static final char NON_RECURSIVE = 'N';
+    public static final String NON_RECURSIVE = "N";
 
-    public static final char UPDATE_SNAPSHOTS = 'U';
+    public static final String UPDATE_SNAPSHOTS = "U";
 
-    public static final char ACTIVATE_PROFILES = 'P';
+    public static final String ACTIVATE_PROFILES = "P";
 
     public static final String SUPRESS_SNAPSHOT_UPDATES = "nsu";
 
-    public static final char CHECKSUM_FAILURE_POLICY = 'C';
+    public static final String CHECKSUM_FAILURE_POLICY = "C";
 
-    public static final char CHECKSUM_WARNING_POLICY = 'c';
+    public static final String CHECKSUM_WARNING_POLICY = "c";
 
-    public static final char ALTERNATE_USER_SETTINGS = 's';
+    public static final String ALTERNATE_USER_SETTINGS = "s";
 
     public static final String ALTERNATE_GLOBAL_SETTINGS = "gs";
 
-    public static final char ALTERNATE_USER_TOOLCHAINS = 't';
+    public static final String ALTERNATE_USER_TOOLCHAINS = "t";
 
     public static final String ALTERNATE_GLOBAL_TOOLCHAINS = "gt";
 
@@ -103,50 +103,52 @@ public class CLIManager
 
     protected Options options;
 
-    @SuppressWarnings( { "static-access", "checkstyle:linelength" } )
+    // CHECKSTYLE_OFF: LineLength
     public 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)" ).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 ) );
-        options.addOption( OptionBuilder.withLongOpt( "quiet" ).withDescription( "Quiet output - only show errors" ).create( QUIET ) );
-        options.addOption( OptionBuilder.withLongOpt( "debug" ).withDescription( "Produce execution debug output" ).create( DEBUG ) );
-        options.addOption( OptionBuilder.withLongOpt( "errors" ).withDescription( "Produce execution error messages" ).create( ERRORS ) );
-        options.addOption( OptionBuilder.withLongOpt( "non-recursive" ).withDescription( "Do not recurse into sub-projects" ).create( NON_RECURSIVE ) );
-        options.addOption( OptionBuilder.withLongOpt( "update-snapshots" ).withDescription( "Forces a check for missing releases and updated snapshots on remote repositories" ).create( UPDATE_SNAPSHOTS ) );
-        options.addOption( OptionBuilder.withLongOpt( "activate-profiles" ).withDescription( "Comma-delimited list of profiles to activate" ).hasArg().create( ACTIVATE_PROFILES ) );
-        options.addOption( OptionBuilder.withLongOpt( "batch-mode" ).withDescription( "Run in non-interactive (batch) mode (disables output color)" ).create( BATCH_MODE ) );
-        options.addOption( OptionBuilder.withLongOpt( "no-snapshot-updates" ).withDescription( "Suppress SNAPSHOT updates" ).create( SUPRESS_SNAPSHOT_UPDATES ) );
-        options.addOption( OptionBuilder.withLongOpt( "strict-checksums" ).withDescription( "Fail the build if checksums don't match" ).create( CHECKSUM_FAILURE_POLICY ) );
-        options.addOption( OptionBuilder.withLongOpt( "lax-checksums" ).withDescription( "Warn if checksums don't match" ).create( CHECKSUM_WARNING_POLICY ) );
-        options.addOption( OptionBuilder.withLongOpt( "settings" ).withDescription( "Alternate path for the user settings file" ).hasArg().create( ALTERNATE_USER_SETTINGS ) );
-        options.addOption( OptionBuilder.withLongOpt( "global-settings" ).withDescription( "Alternate path for the global settings file" ).hasArg().create( ALTERNATE_GLOBAL_SETTINGS ) );
-        options.addOption( OptionBuilder.withLongOpt( "toolchains" ).withDescription( "Alternate path for the user toolchains file" ).hasArg().create( ALTERNATE_USER_TOOLCHAINS ) );
-        options.addOption( OptionBuilder.withLongOpt( "global-toolchains" ).withDescription( "Alternate path for the global toolchains file" ).hasArg().create( ALTERNATE_GLOBAL_TOOLCHAINS ) );
-        options.addOption( OptionBuilder.withLongOpt( "fail-fast" ).withDescription( "Stop at first failure in reactorized builds" ).create( FAIL_FAST ) );
-        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( "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 (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 is core multiplied" ).create( THREADS ) );
-        options.addOption( OptionBuilder.withLongOpt( "legacy-local-repository" ).withDescription( "Use Maven 2 Legacy Local Repository behaviour, ie no use of _remote.repositories. Can also be activated by using -Dmaven.legacyLocalRepo=true" ).create( LEGACY_LOCAL_REPOSITORY ) );
-        options.addOption( OptionBuilder.withLongOpt( "builder" ).hasArg().withDescription( "The id of the build strategy to use" ).create( BUILDER ) );
+        options.addOption( Option.builder( HELP ).longOpt( "help" ).desc( "Display help information" ).build() );
+        options.addOption( Option.builder( ALTERNATE_POM_FILE ).longOpt( "file" ).hasArg().desc( "Force the use of an alternate POM file (or directory with pom.xml)" ).build() );
+        options.addOption( Option.builder( SET_SYSTEM_PROPERTY ).longOpt( "define" ).hasArgs().valueSeparator().desc( "Define a system property" ).build() );
+        options.addOption( Option.builder( OFFLINE ).longOpt( "offline" ).desc( "Work offline" ).build() );
+        options.addOption( Option.builder( VERSION ).longOpt( "version" ).desc( "Display version information" ).build() );
+        options.addOption( Option.builder( QUIET ).longOpt( "quiet" ).desc( "Quiet output - only show errors" ).build() );
+        options.addOption( Option.builder( DEBUG ).longOpt( "debug" ).desc( "Produce execution debug output" ).build() );
+        options.addOption( Option.builder( ERRORS ).longOpt( "errors" ).desc( "Produce execution error messages" ).build() );
+        options.addOption( Option.builder( NON_RECURSIVE ).longOpt( "non-recursive" ).desc( "Do not recurse into sub-projects" ).build() );
+        options.addOption( Option.builder( UPDATE_SNAPSHOTS ).longOpt( "update-snapshots" ).desc( "Forces a check for missing releases and updated snapshots on remote repositories" ).build() );
+        options.addOption( Option.builder( ACTIVATE_PROFILES ).longOpt( "activate-profiles" ).desc( "Comma-delimited list of profiles to activate" ).hasArg().build() );
+        options.addOption( Option.builder( BATCH_MODE ).longOpt( "batch-mode" ).desc( "Run in non-interactive (batch) mode (disables output color)" ).build() );
+        options.addOption( Option.builder( SUPRESS_SNAPSHOT_UPDATES ).longOpt( "no-snapshot-updates" ).desc( "Suppress SNAPSHOT updates" ).build() );
+        options.addOption( Option.builder( CHECKSUM_FAILURE_POLICY ).longOpt( "strict-checksums" ).desc( "Fail the build if checksums don't match" ).build() );
+        options.addOption( Option.builder( CHECKSUM_WARNING_POLICY ).longOpt( "lax-checksums" ).desc( "Warn if checksums don't match" ).build() );
+        options.addOption( Option.builder( ALTERNATE_USER_SETTINGS ).longOpt( "settings" ).hasArg().desc( "Alternate path for the user settings file" ).build() );
+        options.addOption( Option.builder( ALTERNATE_GLOBAL_SETTINGS ).longOpt( "global-settings" ).hasArg().desc( "Alternate path for the global settings file" ).build() );
+        options.addOption( Option.builder( ALTERNATE_USER_TOOLCHAINS ).longOpt( "toolchains" ).hasArg().desc( "Alternate path for the user toolchains file" ).hasArg().build() );
+        options.addOption( Option.builder( ALTERNATE_GLOBAL_TOOLCHAINS ).longOpt( "global-toolchains" ).desc( "Alternate path for the global toolchains file" ).hasArg().build() );
+        options.addOption( Option.builder( FAIL_FAST ).longOpt( "fail-fast" ).desc( "Stop at first failure in reactorized builds" ).build() );
+        options.addOption( Option.builder( FAIL_AT_END ).longOpt( "fail-at-end" ).desc( "Only fail the build afterwards; allow all non-impacted builds to continue" ).build() );
+        options.addOption( Option.builder( FAIL_NEVER ).longOpt( "fail-never" ).desc( "NEVER fail the build, regardless of project result" ).build() );
+        options.addOption( Option.builder( RESUME_FROM ).longOpt( "resume-from" ).hasArg().desc( "Resume reactor from specified project" ).build() );
+        options.addOption( Option.builder( PROJECT_LIST ).longOpt( "projects" ).desc( "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().build() );
+        options.addOption( Option.builder( ALSO_MAKE ).longOpt( "also-make" ).desc( "If project list is specified, also build projects required by the list" ).build() );
+        options.addOption( Option.builder( ALSO_MAKE_DEPENDENTS ).longOpt( "also-make-dependents" ).desc( "If project list is specified, also build projects that depend on projects on the list" ).build() );
+        options.addOption( Option.builder( LOG_FILE ).longOpt( "log-file" ).hasArg().desc( "Log file where all build output will go" ).build() );
+        options.addOption( Option.builder( SHOW_VERSION ).longOpt( "show-version" ).desc( "Display version information WITHOUT stopping build" ).build() );
+        options.addOption( Option.builder( ENCRYPT_MASTER_PASSWORD ).longOpt( "encrypt-master-password" ).optionalArg( true ).desc( "Encrypt master security password" ).build() );
+        options.addOption( Option.builder( ENCRYPT_PASSWORD ).longOpt( "encrypt-password" ).optionalArg( true ).desc( "Encrypt server password" ).build() );
+        options.addOption( Option.builder( THREADS ).longOpt( "threads" ).hasArg().desc( "Thread count, for instance 2.0C where C is core multiplied" ).build() );
+        options.addOption( Option.builder( LEGACY_LOCAL_REPOSITORY ).longOpt( "legacy-local-repository" ).desc( "Use Maven 2 Legacy Local Repository behaviour, ie no use of _remote.repositories. Can also be activated by using -Dmaven.legacyLocalRepo=true" ).build() );
+        options.addOption( Option.builder( BUILDER ).longOpt( "builder" ).hasArg().desc( "The id of the build strategy to use" ).build() );
 
         // Adding this back in for compatibility with the verifier that hard codes this option.
-        options.addOption( OptionBuilder.withLongOpt( "no-plugin-registry" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "npr" ) );
-        options.addOption( OptionBuilder.withLongOpt( "check-plugin-updates" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "cpu" ) );
-        options.addOption( OptionBuilder.withLongOpt( "update-plugins" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "up" ) );
-        options.addOption( OptionBuilder.withLongOpt( "no-plugin-updates" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "npu" ) );
+        options.addOption( Option.builder( "npr" ).longOpt( "no-plugin-registry" ).desc( "Ineffective, only kept for backward compatibility" ).build() );
+        options.addOption( Option.builder( "cpu" ).longOpt( "check-plugin-updates" ).desc( "Ineffective, only kept for backward compatibility" ).build() );
+        options.addOption( Option.builder( "up" ).longOpt( "update-plugins" ).desc( "Ineffective, only kept for backward compatibility" ).build() );
+        options.addOption( Option.builder( "npu" ).longOpt( "no-plugin-updates" ).desc( "Ineffective, only kept for backward compatibility" ).build() );
+
     }
+    // CHECKSTYLE_ON: LineLength
 
     public CommandLine parse( String[] args )
         throws ParseException
@@ -154,7 +156,7 @@ public class CLIManager
         // We need to eat any quotes surrounding arguments...
         String[] cleanArgs = CleanArgument.cleanArgs( args );
 
-        CommandLineParser parser = new GnuParser();
+        CommandLineParser parser = new DefaultParser();
 
         return parser.parse( options, cleanArgs );
     }


[09/14] maven git commit: [MNG-6167] Clean up dependency mess (reported by dependency:analyze)

Posted by kh...@apache.org.
[MNG-6167] Clean up dependency mess (reported by dependency:analyze)

Clean up compile and runtime dependencies. Test dependencies have not been
touched because their seem to be false positives due to DI.


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

Branch: refs/heads/MNG-6069
Commit: ecef59f1cb822e48c63215fa7dd0c8f4fd54d6af
Parents: f4ede96
Author: Michael Osipov <mi...@apache.org>
Authored: Tue May 16 15:27:22 2017 +0200
Committer: Michael Osipov <mi...@apache.org>
Committed: Tue May 16 15:27:22 2017 +0200

----------------------------------------------------------------------
 maven-builder-support/pom.xml   |  4 ----
 maven-compat/pom.xml            | 10 +++++++++-
 maven-core/pom.xml              | 22 +++++++++++++++-------
 maven-embedder/pom.xml          | 30 +++++++++++++++++++++++++-----
 maven-model-builder/pom.xml     |  1 +
 maven-plugin-api/pom.xml        |  8 ++++++++
 maven-resolver-provider/pom.xml |  8 ++++++++
 pom.xml                         | 10 ++++++++++
 8 files changed, 76 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/ecef59f1/maven-builder-support/pom.xml
----------------------------------------------------------------------
diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml
index 5eb7903..9557731 100644
--- a/maven-builder-support/pom.xml
+++ b/maven-builder-support/pom.xml
@@ -35,10 +35,6 @@ under the License.
 
   <dependencies>
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/ecef59f1/maven-compat/pom.xml
----------------------------------------------------------------------
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index 8392dca..b3cf039 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -52,6 +52,10 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
+      <artifactId>maven-settings-builder</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
     </dependency>
     <dependency>
@@ -63,6 +67,10 @@ under the License.
       <artifactId>maven-resolver-provider</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-repository-metadata</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.maven.resolver</groupId>
       <artifactId>maven-resolver-api</artifactId>
     </dependency>
@@ -131,5 +139,5 @@ under the License.
       </plugin>
     </plugins>
   </build>
-  
+
 </project>

http://git-wip-us.apache.org/repos/asf/maven/blob/ecef59f1/maven-core/pom.xml
----------------------------------------------------------------------
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 71f09c0..717e2a5 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -54,6 +54,10 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
+      <artifactId>maven-builder-support</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
       <artifactId>maven-repository-metadata</artifactId>
     </dependency>
     <dependency>
@@ -92,20 +96,28 @@ under the License.
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-shared-utils</artifactId>
     </dependency>
-    <!-- Plexus -->
     <dependency>
       <groupId>org.eclipse.sisu</groupId>
       <artifactId>org.eclipse.sisu.plexus</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.eclipse.sisu</groupId>
+      <artifactId>org.eclipse.sisu.inject</artifactId>
+    </dependency>
+    <dependency>
       <groupId>com.google.inject</groupId>
       <artifactId>guice</artifactId>
       <classifier>no_aop</classifier>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-interpolation</artifactId>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
     </dependency>
+    <!-- Plexus -->
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
@@ -119,10 +131,6 @@ under the License.
       <artifactId>plexus-component-annotations</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.sonatype.plexus</groupId>
-      <artifactId>plexus-sec-dispatcher</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/ecef59f1/maven-embedder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 66e09a3..52e9c82 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -40,6 +40,10 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
+      <artifactId>maven-settings-builder</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
       <artifactId>maven-core</artifactId>
     </dependency>
     <dependency>
@@ -48,9 +52,17 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
       <artifactId>maven-model-builder</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-builder-support</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.maven.resolver</groupId>
       <artifactId>maven-resolver-api</artifactId>
     </dependency>
@@ -59,15 +71,23 @@ under the License.
       <artifactId>maven-resolver-util</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-compat</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-shared-utils</artifactId>
     </dependency>
     <dependency>
+       <groupId>com.google.inject</groupId>
+       <artifactId>guice</artifactId>
+       <classifier>no_aop</classifier>
+     </dependency>
+     <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/ecef59f1/maven-model-builder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml
index 859f0b3..eb86824 100644
--- a/maven-model-builder/pom.xml
+++ b/maven-model-builder/pom.xml
@@ -71,6 +71,7 @@ under the License.
       <artifactId>org.eclipse.sisu.plexus</artifactId>
       <scope>test</scope>
     </dependency>
+    <!-- Testing -->
     <dependency>
       <groupId>com.google.inject</groupId>
       <artifactId>guice</artifactId>

http://git-wip-us.apache.org/repos/asf/maven/blob/ecef59f1/maven-plugin-api/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
index 1596a41..cf7e0ef 100644
--- a/maven-plugin-api/pom.xml
+++ b/maven-plugin-api/pom.xml
@@ -52,6 +52,14 @@ under the License.
       <groupId>org.eclipse.sisu</groupId>
       <artifactId>org.eclipse.sisu.plexus</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-classworlds</artifactId>
+    </dependency>
   </dependencies>
 
   <build>

http://git-wip-us.apache.org/repos/asf/maven/blob/ecef59f1/maven-resolver-provider/pom.xml
----------------------------------------------------------------------
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index a724d3b..0d1b481 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -71,6 +71,14 @@ under the License.
       <artifactId>plexus-utils</artifactId>
     </dependency>
     <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+    </dependency>
+    <dependency>
       <groupId>com.google.inject</groupId>
       <artifactId>guice</artifactId>
       <classifier>no_aop</classifier>

http://git-wip-us.apache.org/repos/asf/maven/blob/ecef59f1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e16d93b..ce84168 100644
--- a/pom.xml
+++ b/pom.xml
@@ -249,6 +249,16 @@ under the License.
         <version>${sisuInjectVersion}</version>
       </dependency>
       <dependency>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>org.eclipse.sisu.inject</artifactId>
+        <version>${sisuInjectVersion}</version>
+      </dependency>
+      <dependency>
+        <groupId>javax.inject</groupId>
+        <artifactId>javax.inject</artifactId>
+        <version>1</version>
+      </dependency>
+      <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-component-annotations</artifactId>
         <version>${plexusVersion}</version>


[04/14] maven git commit: [MNG-6223] support -f path/to/dir when detecting .mvn

Posted by kh...@apache.org.
[MNG-6223] support -f path/to/dir when detecting .mvn

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

Branch: refs/heads/MNG-6069
Commit: 2d4401557c3c870409e8b1c65d2dcc9a68281cae
Parents: be22380
Author: Hervé Boutemy <hb...@apache.org>
Authored: Sat May 6 18:15:42 2017 +0200
Committer: Hervé Boutemy <hb...@apache.org>
Committed: Tue May 9 21:07:41 2017 +0200

----------------------------------------------------------------------
 apache-maven/src/bin/mvn     | 4 +++-
 apache-maven/src/bin/mvn.cmd | 6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/2d440155/apache-maven/src/bin/mvn
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 623b5f2..eedd344 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -141,7 +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
+      if [ -d "${arg}" ]; then
+        basedir=`cd "${arg}" && pwd -P`
+      elif [ -f "${arg}" ]; then
         basedir=`dirname "${arg}"`
         basedir=`cd "${basedir}" && pwd -P`
         if [ ! -d "${basedir}" ]; then

http://git-wip-us.apache.org/repos/asf/maven/blob/2d440155/apache-maven/src/bin/mvn.cmd
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index 9d92279..bfcc1b5 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -120,7 +120,11 @@ 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%"
+if exist "%FILE_ARG%\*" (
+  set "POM_DIR=%FILE_ARG%"
+) else (
+  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


[03/14] maven git commit: Add a ProjectArtifactsCache similar to PluginArtifactsCache

Posted by kh...@apache.org.
Add a ProjectArtifactsCache similar to PluginArtifactsCache

Signed-off-by: Jason van Zyl <ja...@vanzyl.ca>

closes #82


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

Branch: refs/heads/MNG-6069
Commit: be223808939d75152d7157db33d45f230114555e
Parents: f7d4bce
Author: Anton Tanasenko <at...@gmail.com>
Authored: Wed May 18 18:40:28 2016 +0300
Committer: Karl Heinz Marbaise <kh...@apache.org>
Committed: Fri May 5 22:08:16 2017 +0200

----------------------------------------------------------------------
 .../internal/LifecycleDependencyResolver.java   |  34 ++-
 .../plugin/DefaultProjectArtifactsCache.java    | 256 +++++++++++++++++++
 .../maven/plugin/ProjectArtifactsCache.java     |  90 +++++++
 3 files changed, 377 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/be223808/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java
index 0d42aeb..504274f 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java
@@ -37,6 +37,7 @@ import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.eventspy.internal.EventSpyDispatcher;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.lifecycle.LifecycleExecutionException;
+import org.apache.maven.plugin.ProjectArtifactsCache;
 import org.apache.maven.project.DefaultDependencyResolutionRequest;
 import org.apache.maven.project.DependencyResolutionException;
 import org.apache.maven.project.DependencyResolutionResult;
@@ -75,6 +76,9 @@ public class LifecycleDependencyResolver
 
     @Inject
     private EventSpyDispatcher eventSpyDispatcher;
+    
+    @Inject
+    private ProjectArtifactsCache projectArtifactsCache;
 
     public LifecycleDependencyResolver()
     {
@@ -123,9 +127,33 @@ public class LifecycleDependencyResolver
                     throw new LifecycleExecutionException( e );
                 }
             }
-
-            Set<Artifact> artifacts =
-                getDependencies( project, scopesToCollect, scopesToResolve, session, aggregating, projectArtifacts );
+            
+            Set<Artifact> artifacts;
+            ProjectArtifactsCache.Key cacheKey = projectArtifactsCache.createKey( project,  scopesToCollect, 
+                scopesToResolve, aggregating, session.getRepositorySession() );
+            ProjectArtifactsCache.CacheRecord recordArtifacts;
+            recordArtifacts = projectArtifactsCache.get( cacheKey );
+            
+            if ( recordArtifacts != null )
+            {
+                artifacts = recordArtifacts.artifacts;
+            }
+            else
+            {
+                try
+                {
+                    artifacts = getDependencies( project, scopesToCollect, scopesToResolve, session, aggregating, 
+                        projectArtifacts );
+                    recordArtifacts = projectArtifactsCache.put( cacheKey, artifacts );
+                }
+                catch ( LifecycleExecutionException e )
+                {
+                  projectArtifactsCache.put( cacheKey, e );
+                  projectArtifactsCache.register( project, cacheKey, recordArtifacts );
+                    throw e;
+                }
+            }
+            projectArtifactsCache.register( project, cacheKey, recordArtifacts );
 
             project.setResolvedArtifacts( artifacts );
 

http://git-wip-us.apache.org/repos/asf/maven/blob/be223808/maven-core/src/main/java/org/apache/maven/plugin/DefaultProjectArtifactsCache.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultProjectArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultProjectArtifactsCache.java
new file mode 100644
index 0000000..1eaa627
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultProjectArtifactsCache.java
@@ -0,0 +1,256 @@
+package org.apache.maven.plugin;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.commons.lang3.Validate;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.lifecycle.LifecycleExecutionException;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.component.annotations.Component;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.repository.WorkspaceRepository;
+
+/**
+ * @author Igor Fedorenko
+ * @author Benjamin Bentmann
+ * @author Anton Tanasenko
+ */
+@Component( role = ProjectArtifactsCache.class )
+public class DefaultProjectArtifactsCache
+    implements ProjectArtifactsCache
+{
+
+    protected static class CacheKey
+        implements Key
+    {
+
+        private final String groupId;
+        
+        private final String artifactId;
+        
+        private final String version;
+        
+        private final Set<String> dependencyArtifacts;
+
+        private final WorkspaceRepository workspace;
+
+        private final LocalRepository localRepo;
+
+        private final List<RemoteRepository> repositories;
+        
+        private final Set<String> collect;
+        
+        private final Set<String> resolve;
+        
+        private boolean aggregating;
+
+        private final int hashCode;
+
+        public CacheKey( MavenProject project, List<RemoteRepository> repositories,
+            Collection<String> scopesToCollect, Collection<String> scopesToResolve, boolean aggregating,
+            RepositorySystemSession session )
+        {
+            
+            groupId = project.getGroupId();
+            artifactId = project.getArtifactId();
+            version = project.getVersion();
+            
+            Set<String> deps = new HashSet<>();
+            if ( project.getDependencyArtifacts() != null )
+            {
+              for ( Artifact dep: project.getDependencyArtifacts() )
+              {
+                deps.add( dep.toString() );
+              }
+            }
+            dependencyArtifacts = Collections.unmodifiableSet( deps );
+            
+            workspace = CacheUtils.getWorkspace( session );
+            this.localRepo = session.getLocalRepository();
+            this.repositories = new ArrayList<>( repositories.size() );
+            for ( RemoteRepository repository : repositories )
+            {
+                if ( repository.isRepositoryManager() )
+                {
+                    this.repositories.addAll( repository.getMirroredRepositories() );
+                }
+                else
+                {
+                    this.repositories.add( repository );
+                }
+            }
+            collect = scopesToCollect == null
+                ? Collections.<String>emptySet() 
+                : Collections.unmodifiableSet( new HashSet<>( scopesToCollect ) );
+            resolve = scopesToResolve == null 
+                ? Collections.<String>emptySet() 
+                : Collections.unmodifiableSet( new HashSet<>( scopesToResolve ) );
+            this.aggregating = aggregating;
+
+            int hash = 17;
+            hash = hash * 31 + hash( groupId );
+            hash = hash * 31 + hash( artifactId );
+            hash = hash * 31 + hash( version );
+            hash = hash * 31 + hash( dependencyArtifacts );
+            hash = hash * 31 + hash( workspace );
+            hash = hash * 31 + hash( localRepo );
+            hash = hash * 31 + CacheUtils.repositoriesHashCode( repositories );
+            hash = hash * 31 + hash( collect );
+            hash = hash * 31 + hash( resolve );
+            hash = hash * 31 + hash( aggregating );
+            this.hashCode = hash;
+        }
+
+        @Override
+        public String toString()
+        {
+            return groupId + ":" + artifactId + ":" + version;
+        }
+
+        @Override
+        public int hashCode()
+        {
+            return hashCode;
+        }
+
+        private static int hash( Object obj )
+        {
+            return obj != null ? obj.hashCode() : 0;
+        }
+
+        @Override
+        public boolean equals( Object o )
+        {
+            if ( o == this )
+            {
+                return true;
+            }
+
+            if ( !( o instanceof CacheKey ) )
+            {
+                return false;
+            }
+
+            CacheKey that = (CacheKey) o;
+
+            return eq( groupId, that.groupId ) && eq( artifactId, that.artifactId ) && eq( version, that.version ) 
+                && eq( dependencyArtifacts, that.dependencyArtifacts )
+                && eq( workspace, that.workspace ) && eq( localRepo, that.localRepo ) 
+                && CacheUtils.repositoriesEquals( repositories, that.repositories ) && eq( collect, that.collect ) 
+                && eq( resolve, that.resolve ) && aggregating == that.aggregating;
+        }
+
+        private static <T> boolean eq( T s1, T s2 )
+        {
+            return s1 != null ? s1.equals( s2 ) : s2 == null;
+        }
+
+    }
+
+    protected final Map<Key, CacheRecord> cache = new ConcurrentHashMap<>();
+
+    public Key createKey( MavenProject project, Collection<String> scopesToCollect,
+        Collection<String> scopesToResolve, boolean aggregating, RepositorySystemSession session )
+    {
+        return new CacheKey( project, project.getRemoteProjectRepositories(), scopesToCollect, scopesToResolve, 
+            aggregating, session );
+    }
+
+    public CacheRecord get( Key key )
+        throws LifecycleExecutionException
+    {
+        CacheRecord cacheRecord = cache.get( key );
+
+        if ( cacheRecord != null && cacheRecord.exception != null )
+        {
+            throw cacheRecord.exception;
+        }
+
+        return cacheRecord;
+    }
+
+    public CacheRecord put( Key key, Set<Artifact> projectArtifacts )
+    {
+        Validate.notNull( projectArtifacts, "projectArtifacts cannot be null" );
+
+        assertUniqueKey( key );
+
+        CacheRecord record =
+            new CacheRecord( Collections.unmodifiableSet( new HashSet<>( projectArtifacts ) ) );
+
+        cache.put( key, record );
+
+        return record;
+    }
+
+    protected void assertUniqueKey( Key key )
+    {
+        if ( cache.containsKey( key ) )
+        {
+            throw new IllegalStateException( "Duplicate artifact resolution result for project " + key );
+        }
+    }
+
+    public CacheRecord put( Key key, LifecycleExecutionException exception )
+    {
+        Validate.notNull( exception, "exception cannot be null" );
+
+        assertUniqueKey( key );
+
+        CacheRecord record = new CacheRecord( exception );
+
+        cache.put( key, record );
+
+        return record;
+    }
+
+    public void flush()
+    {
+        cache.clear();
+    }
+
+    protected static int pluginHashCode( Plugin plugin )
+    {
+        return CacheUtils.pluginHashCode( plugin );
+    }
+
+    protected static boolean pluginEquals( Plugin a, Plugin b )
+    {
+        return CacheUtils.pluginEquals( a, b );
+    }
+
+    public void register( MavenProject project, Key cacheKey, CacheRecord record )
+    {
+        // default cache does not track record usage
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven/blob/be223808/maven-core/src/main/java/org/apache/maven/plugin/ProjectArtifactsCache.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/ProjectArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/plugin/ProjectArtifactsCache.java
new file mode 100644
index 0000000..42a95e5
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/plugin/ProjectArtifactsCache.java
@@ -0,0 +1,90 @@
+package org.apache.maven.plugin;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Collection;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.lifecycle.LifecycleExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.aether.RepositorySystemSession;
+/**
+ * Caches project artifacts. <strong>Warning:</strong> This is an internal utility interface that is only public for
+ * technical reasons, it is not part of the public API. In particular, this interface can be changed or deleted without
+ * prior notice.
+ *
+ * @author Igor Fedorenko
+ * @author Benjamin Bentmann
+ * @author Anton Tanasenko
+ */
+public interface ProjectArtifactsCache
+{
+
+    /**
+     * A cache key.
+     */
+    interface Key
+    {
+        // marker interface for cache keys
+    }
+
+    static class CacheRecord
+    {
+
+        public final Set<Artifact> artifacts;
+
+        public final LifecycleExecutionException exception;
+
+        public CacheRecord( Set<Artifact> artifacts )
+        {
+            this.artifacts = artifacts;
+            this.exception = null;
+        }
+
+        public CacheRecord( LifecycleExecutionException exception )
+        {
+            this.artifacts = null;
+            this.exception = exception;
+        }
+    }
+
+    Key createKey( MavenProject project, Collection<String> scopesToCollect, Collection<String> scopesToResolve, 
+        boolean aggregating, RepositorySystemSession session );
+
+    CacheRecord get( Key key ) throws LifecycleExecutionException;
+
+    CacheRecord put( Key key, Set<Artifact> pluginArtifacts );
+
+    CacheRecord put( Key key, LifecycleExecutionException e );
+
+    void flush();
+
+    /**
+     * Registers the specified cache record for usage with the given project. Integrators can use the information
+     * collected from this method in combination with a custom cache implementation to dispose unused records from the
+     * cache.
+     *
+     * @param project The project that employs the plugin realm, must not be {@code null}.
+     * @param record The cache record being used for the project, must not be {@code null}.
+     */
+    void register( MavenProject project, Key cacheKey, CacheRecord record );
+
+}


[11/14] maven git commit: MNG-6233 don't mix plexus and jsr330 annotations in aether-provider

Posted by kh...@apache.org.
MNG-6233 don't mix plexus and jsr330 annotations in aether-provider

Signed-off-by: Igor Fedorenko <if...@apache.org>


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

Branch: refs/heads/MNG-6069
Commit: 66fc74d6296ea0a33f8a9712dc5ed5eb3affd529
Parents: 4463498
Author: Igor Fedorenko <if...@apache.org>
Authored: Tue Mar 28 08:41:38 2017 -0400
Committer: Igor Fedorenko <if...@apache.org>
Committed: Wed May 24 15:33:04 2017 -0400

----------------------------------------------------------------------
 maven-resolver-provider/pom.xml                        |  8 ++------
 .../internal/DefaultArtifactDescriptorReader.java      | 13 +++----------
 .../internal/DefaultVersionRangeResolver.java          |  9 ++-------
 .../repository/internal/DefaultVersionResolver.java    |  9 ++-------
 .../internal/SnapshotMetadataGeneratorFactory.java     |  7 +++++--
 .../internal/VersionsMetadataGeneratorFactory.java     |  7 +++++--
 6 files changed, 19 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/66fc74d6/maven-resolver-provider/pom.xml
----------------------------------------------------------------------
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index 0d1b481..53e67e5 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -64,10 +64,6 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-component-annotations</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
     <dependency>
@@ -125,8 +121,8 @@ under the License.
   <build>
     <plugins>
       <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-component-metadata</artifactId>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>sisu-maven-plugin</artifactId>
       </plugin>
     </plugins>
   </build>

http://git-wip-us.apache.org/repos/asf/maven/blob/66fc74d6/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
----------------------------------------------------------------------
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
index 82e1284..7ccdc05 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
@@ -26,6 +26,7 @@ import java.util.Set;
 
 import javax.inject.Inject;
 import javax.inject.Named;
+import javax.inject.Singleton;
 
 import org.apache.commons.lang3.Validate;
 import org.apache.maven.model.DistributionManagement;
@@ -39,8 +40,6 @@ import org.apache.maven.model.building.ModelBuildingException;
 import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.model.building.ModelProblem;
 import org.apache.maven.model.resolution.UnresolvableModelException;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.eclipse.aether.RepositoryEvent;
 import org.eclipse.aether.RepositoryEvent.EventType;
 import org.eclipse.aether.RepositoryException;
@@ -77,31 +76,24 @@ import org.eclipse.aether.transfer.ArtifactNotFoundException;
  * @author Benjamin Bentmann
  */
 @Named
-@Component( role = ArtifactDescriptorReader.class )
+@Singleton
 public class DefaultArtifactDescriptorReader
     implements ArtifactDescriptorReader, Service
 {
 
     @SuppressWarnings( "unused" )
-    @Requirement( role = LoggerFactory.class )
     private Logger logger = NullLoggerFactory.LOGGER;
 
-    @Requirement
     private RemoteRepositoryManager remoteRepositoryManager;
 
-    @Requirement
     private VersionResolver versionResolver;
 
-    @Requirement
     private VersionRangeResolver versionRangeResolver;
 
-    @Requirement
     private ArtifactResolver artifactResolver;
 
-    @Requirement
     private RepositoryEventDispatcher repositoryEventDispatcher;
 
-    @Requirement
     private ModelBuilder modelBuilder;
 
     public DefaultArtifactDescriptorReader()
@@ -117,6 +109,7 @@ public class DefaultArtifactDescriptorReader
     {
         setRemoteRepositoryManager( remoteRepositoryManager );
         setVersionResolver( versionResolver );
+        setVersionRangeResolver( versionRangeResolver );
         setArtifactResolver( artifactResolver );
         setModelBuilder( modelBuilder );
         setLoggerFactory( loggerFactory );

http://git-wip-us.apache.org/repos/asf/maven/blob/66fc74d6/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java
----------------------------------------------------------------------
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java
index c12c9e0..7a8ad9f 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java
@@ -22,8 +22,6 @@ package org.apache.maven.repository.internal;
 import org.apache.commons.lang3.Validate;
 import org.apache.maven.artifact.repository.metadata.Versioning;
 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.eclipse.aether.RepositoryEvent;
 import org.eclipse.aether.RepositoryEvent.EventType;
 import org.eclipse.aether.RepositorySystemSession;
@@ -56,6 +54,7 @@ import org.eclipse.aether.version.VersionScheme;
 
 import javax.inject.Inject;
 import javax.inject.Named;
+import javax.inject.Singleton;
 
 import java.io.FileInputStream;
 import java.io.InputStream;
@@ -69,7 +68,7 @@ import java.util.Map;
  * @author Benjamin Bentmann
  */
 @Named
-@Component( role = VersionRangeResolver.class )
+@Singleton
 public class DefaultVersionRangeResolver
     implements VersionRangeResolver, Service
 {
@@ -77,16 +76,12 @@ public class DefaultVersionRangeResolver
     private static final String MAVEN_METADATA_XML = "maven-metadata.xml";
 
     @SuppressWarnings( "unused" )
-    @Requirement( role = LoggerFactory.class )
     private Logger logger = NullLoggerFactory.LOGGER;
 
-    @Requirement
     private MetadataResolver metadataResolver;
 
-    @Requirement
     private SyncContextFactory syncContextFactory;
 
-    @Requirement
     private RepositoryEventDispatcher repositoryEventDispatcher;
 
     public DefaultVersionRangeResolver()

http://git-wip-us.apache.org/repos/asf/maven/blob/66fc74d6/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java
----------------------------------------------------------------------
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java
index c23794b..2789640 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java
@@ -24,8 +24,6 @@ import org.apache.maven.artifact.repository.metadata.Snapshot;
 import org.apache.maven.artifact.repository.metadata.SnapshotVersion;
 import org.apache.maven.artifact.repository.metadata.Versioning;
 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.util.StringUtils;
 import org.eclipse.aether.RepositoryCache;
 import org.eclipse.aether.RepositoryEvent;
@@ -60,6 +58,7 @@ import org.eclipse.aether.util.ConfigUtils;
 
 import javax.inject.Inject;
 import javax.inject.Named;
+import javax.inject.Singleton;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -75,7 +74,7 @@ import java.util.Map;
  * @author Benjamin Bentmann
  */
 @Named
-@Component( role = VersionResolver.class )
+@Singleton
 public class DefaultVersionResolver
     implements VersionResolver, Service
 {
@@ -89,16 +88,12 @@ public class DefaultVersionResolver
     private static final String SNAPSHOT = "SNAPSHOT";
 
     @SuppressWarnings( "unused" )
-    @Requirement( role = LoggerFactory.class )
     private Logger logger = NullLoggerFactory.LOGGER;
 
-    @Requirement
     private MetadataResolver metadataResolver;
 
-    @Requirement
     private SyncContextFactory syncContextFactory;
 
-    @Requirement
     private RepositoryEventDispatcher repositoryEventDispatcher;
 
     public DefaultVersionResolver()

http://git-wip-us.apache.org/repos/asf/maven/blob/66fc74d6/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java
----------------------------------------------------------------------
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java
index 79ffaad..ba6dadf 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java
@@ -19,7 +19,9 @@ package org.apache.maven.repository.internal;
  * under the License.
  */
 
-import org.codehaus.plexus.component.annotations.Component;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.deployment.DeployRequest;
 import org.eclipse.aether.impl.MetadataGenerator;
@@ -29,7 +31,8 @@ import org.eclipse.aether.installation.InstallRequest;
 /**
  * @author Benjamin Bentmann
  */
-@Component( role = MetadataGeneratorFactory.class, hint = "snapshot" )
+@Named( "snapshot" )
+@Singleton
 public class SnapshotMetadataGeneratorFactory
     implements MetadataGeneratorFactory
 {

http://git-wip-us.apache.org/repos/asf/maven/blob/66fc74d6/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java
----------------------------------------------------------------------
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java
index 47ef360..eae836a 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java
@@ -19,7 +19,9 @@ package org.apache.maven.repository.internal;
  * under the License.
  */
 
-import org.codehaus.plexus.component.annotations.Component;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.deployment.DeployRequest;
 import org.eclipse.aether.impl.MetadataGenerator;
@@ -29,7 +31,8 @@ import org.eclipse.aether.installation.InstallRequest;
 /**
  * @author Benjamin Bentmann
  */
-@Component( role = MetadataGeneratorFactory.class, hint = "versions" )
+@Named( "versions" )
+@Singleton
 public class VersionsMetadataGeneratorFactory
     implements MetadataGeneratorFactory
 {


[07/14] maven git commit: [MNG-6228] Optionality not displayed in dependency tree when run in debug mode

Posted by kh...@apache.org.
[MNG-6228] Optionality not displayed in dependency tree when run in debug mode

Log message in DefaultProjectDependenciesResolver has been extended with
"(optional)" if dependency is marked as optional (direct or transitive).


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

Branch: refs/heads/MNG-6069
Commit: fd988e78e95a53c3a39ec944869ba62b0c7fc0f0
Parents: 6182a20
Author: Michael Osipov <mi...@apache.org>
Authored: Tue May 9 22:15:21 2017 +0200
Committer: Michael Osipov <mi...@apache.org>
Committed: Tue May 9 22:15:21 2017 +0200

----------------------------------------------------------------------
 .../maven/project/DefaultProjectDependenciesResolver.java       | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/fd988e78/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 5a803af..4e26de2 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
@@ -295,6 +295,11 @@ public class DefaultProjectDependenciesResolver
                     //      The resolver 1.0.x releases do not record premanaged state of properties.
                     buffer.append( " (properties managed)" );
                 }
+
+                if ( dep.isOptional() )
+                {
+                    buffer.append( " (optional)" );
+                }
             }
             else
             {


[13/14] maven git commit: [MNG-6206] display deprecation build warning in case when dependencies use metaversions (LATEST or RELEASE)

Posted by kh...@apache.org.
[MNG-6206] display deprecation build warning in case when dependencies
use metaversions (LATEST or RELEASE)

Signed-off-by: Karl Heinz Marbaise <kh...@apache.org>


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

Branch: refs/heads/MNG-6069
Commit: eb6b212b567c287734a2dbbef3c113fe650f1def
Parents: a7dddcb
Author: dejan2609 <de...@gmail.com>
Authored: Sat May 20 16:57:55 2017 +0200
Committer: Karl Heinz Marbaise <kh...@apache.org>
Committed: Sun Jun 4 20:23:02 2017 +0200

----------------------------------------------------------------------
 .../model/validation/DefaultModelValidator.java |  6 ++++
 .../validation/DefaultModelValidatorTest.java   | 12 +++++++
 ...pendency-metaversions-latest-and-release.xml | 38 ++++++++++++++++++++
 3 files changed, 56 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/eb6b212b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
index e790f21..f46be0e 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
@@ -485,6 +485,12 @@ public class DefaultModelValidator
                 }
             }
 
+            if ( equals( "LATEST", dependency.getVersion() ) || equals( "RELEASE", dependency.getVersion() ) )
+            {
+                addViolation( problems, Severity.WARNING, Version.BASE, prefix + ".version", key,
+                        "is either LATEST or RELEASE (both of them are being deprecated)", dependency );
+            }
+
             Dependency existing = index.get( key );
 
             if ( existing != null )

http://git-wip-us.apache.org/repos/asf/maven/blob/eb6b212b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
index 8525476..bb99be9 100644
--- a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
@@ -676,4 +676,16 @@ public class DefaultModelValidatorTest
         assertViolations( result, 0, 0, 0 );
     }
 
+    public void testDeprecatedDependencyMetaversionsLatestAndRelease()
+            throws Exception
+    {
+        SimpleProblemCollector result = validateRaw( "deprecated-dependency-metaversions-latest-and-release.xml" );
+
+        assertViolations( result, 0, 0, 2 );
+
+        assertContains( result.getWarnings().get( 0 ),
+               "'dependencies.dependency.version' for test:a:jar is either LATEST or RELEASE (both of them are being deprecated)" );
+        assertContains( result.getWarnings().get( 1 ),
+                "'dependencies.dependency.version' for test:b:jar is either LATEST or RELEASE (both of them are being deprecated)" );
+    }
 }

http://git-wip-us.apache.org/repos/asf/maven/blob/eb6b212b/maven-model-builder/src/test/resources/poms/validation/deprecated-dependency-metaversions-latest-and-release.xml
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/test/resources/poms/validation/deprecated-dependency-metaversions-latest-and-release.xml b/maven-model-builder/src/test/resources/poms/validation/deprecated-dependency-metaversions-latest-and-release.xml
new file mode 100644
index 0000000..eba532b
--- /dev/null
+++ b/maven-model-builder/src/test/resources/poms/validation/deprecated-dependency-metaversions-latest-and-release.xml
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>gid</groupId>
+  <artifactId>aid</artifactId>
+  <version>0.1</version>
+
+    <dependencies>
+      <dependency>
+        <groupId>test</groupId>
+        <artifactId>a</artifactId>
+        <version>LATEST</version>
+      </dependency>
+      <dependency>
+        <groupId>test</groupId>
+        <artifactId>b</artifactId>
+        <version>RELEASE</version>
+        </dependency>
+    </dependencies>
+</project>


[02/14] maven git commit: [MNG-6149] MetadataResolutionResult#getGraph() never resolves request type 'test'

Posted by kh...@apache.org.
[MNG-6149] MetadataResolutionResult#getGraph() never resolves request type 'test'


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

Branch: refs/heads/MNG-6069
Commit: f7d4bce23324cd4a318486d8715a128cf7436c3a
Parents: 3938817
Author: Michael Osipov <mi...@apache.org>
Authored: Fri Apr 21 22:57:53 2017 +0200
Committer: Michael Osipov <mi...@apache.org>
Committed: Fri Apr 21 22:57:53 2017 +0200

----------------------------------------------------------------------
 .../apache/maven/repository/metadata/MetadataResolutionResult.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/f7d4bce2/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataResolutionResult.java
----------------------------------------------------------------------
diff --git a/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataResolutionResult.java b/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataResolutionResult.java
index 814b66c..74a3427 100644
--- a/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataResolutionResult.java
+++ b/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataResolutionResult.java
@@ -115,7 +115,7 @@ public class MetadataResolutionResult
         {
             return conflictResolver.resolveConflicts( getGraph(), ArtifactScopeEnum.runtime );
         }
-        else if ( requestType.equals( MetadataResolutionRequestTypeEnum.classpathRuntime ) )
+        else if ( requestType.equals( MetadataResolutionRequestTypeEnum.classpathTest ) )
         {
             return conflictResolver.resolveConflicts( getGraph(), ArtifactScopeEnum.test );
         }


[06/14] maven git commit: [MNG-6186] use enhanced HawtJNI library loading (remove previous hack)

Posted by kh...@apache.org.
[MNG-6186] use enhanced HawtJNI library loading (remove previous hack)

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

Branch: refs/heads/MNG-6069
Commit: 6182a2083fdb9964ccb5250fb85223e38485bf04
Parents: 2a79d1e
Author: Hervé Boutemy <hb...@apache.org>
Authored: Sat May 6 18:28:04 2017 +0200
Committer: Hervé Boutemy <hb...@apache.org>
Committed: Tue May 9 21:08:13 2017 +0200

----------------------------------------------------------------------
 apache-maven/src/bin/mvn                        |  4 +-
 apache-maven/src/bin/mvn.cmd                    |  1 +
 .../java/org/apache/maven/cli/MavenCli.java     | 59 --------------------
 3 files changed, 4 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/6182a208/apache-maven/src/bin/mvn
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index eedd344..525b2ef 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -193,5 +193,7 @@ exec "$JAVACMD" \
   $MAVEN_DEBUG_OPTS \
   -classpath "${CLASSWORLDS_JAR}" \
   "-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
-  "-Dmaven.home=${MAVEN_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  "-Dmaven.home=${MAVEN_HOME}" \
+  "-Dlibrary.jansi.path=${MAVEN_HOME}/jansi-native" \
+  "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
   ${CLASSWORLDS_LAUNCHER} "$@"

http://git-wip-us.apache.org/repos/asf/maven/blob/6182a208/apache-maven/src/bin/mvn.cmd
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index bfcc1b5..ba61f80 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -181,6 +181,7 @@ set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
   -classpath %CLASSWORLDS_JAR% ^
   "-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^
   "-Dmaven.home=%MAVEN_HOME%" ^
+  "-Dlibrary.jansi.path=%MAVEN_HOME%\jansi-native" ^
   "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
   %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
 if ERRORLEVEL 1 goto error

http://git-wip-us.apache.org/repos/asf/maven/blob/6182a208/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 79ab45d..e1e58c8 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
@@ -188,7 +188,6 @@ public class MavenCli
     {
         MavenCli cli = new MavenCli();
 
-        prepareJansiNative();
         MessageUtils.systemInstall();
         int result = cli.doMain( new CliRequest( args, classWorld ) );
         MessageUtils.systemUninstall();
@@ -196,64 +195,6 @@ public class MavenCli
         return result;
     }
 
-    /**
-     * temporary method while improvement reported to JAnsi+HawtJNI and integrated:
-     * library.jansi.path should point to lib/jansi-native and HawtJNI should be able to detect
-     * the platform instead of forcing the user having to point library.jansi.path to
-     * lib/jansi-native/[platform]
-     */
-    private static void prepareJansiNative()
-    {
-        if ( System.getProperty( "library.jansi.path" ) == null )
-        {
-            String mavenHome = System.getProperty( "maven.home" );
-
-            if ( mavenHome != null )
-            {
-                File jansiNative = new File( mavenHome, "lib/jansi-native/" + hawtJNIgetPlatform() );
-                System.setProperty( "library.jansi.path", jansiNative.getAbsolutePath() );
-            }
-        }
-    }
-
-    private static String hawtJNIgetOperatingSystem()
-    {
-        String name = System.getProperty( "os.name" ).toLowerCase().trim();
-        if ( name.startsWith( "linux" ) )
-        {
-            return "linux";
-        }
-        if ( name.startsWith( "mac os x" ) )
-        {
-            return "osx";
-        }
-        if ( name.startsWith( "win" ) )
-        {
-            return "windows";
-        }
-        return name.replaceAll( "\\W+", "_" );
-
-    }
-
-    private static String hawtJNIgetPlatform()
-    {
-        return hawtJNIgetOperatingSystem() + hawtJNIgetBitModel();
-    }
-
-    private static int hawtJNIgetBitModel()
-    {
-        String prop = System.getProperty( "sun.arch.data.model" );
-        if ( prop == null )
-        {
-            prop = System.getProperty( "com.ibm.vm.bitmode" );
-        }
-        if ( prop != null )
-        {
-            return Integer.parseInt( prop );
-        }
-        return -1; // we don't know..
-    }
-
     // TODO need to externalize CliRequest
     public static int doMain( String[] args, ClassWorld classWorld )
     {


[08/14] maven git commit: [MNG-5935] Optional true getting lost in managed dependencies when transitive

Posted by kh...@apache.org.
[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/f4ede96f
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f4ede96f
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f4ede96f

Branch: refs/heads/MNG-6069
Commit: f4ede96fd06c8d3e1e2b2fb679baec058cce30e1
Parents: fd988e7
Author: Christian Schulte <sc...@apache.org>
Authored: Thu Feb 11 08:45:19 2016 +0100
Committer: Michael Osipov <mi...@apache.org>
Committed: Wed May 10 10:36:19 2017 +0200

----------------------------------------------------------------------
 .../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/f4ede96f/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/f4ede96f/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 42060b4..8219205 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;
     }


[05/14] maven git commit: [MNG-6205] upgraded JAnsi to 1.16 for console encoding fix

Posted by kh...@apache.org.
[MNG-6205] upgraded JAnsi to 1.16 for console encoding fix

also fixes MNG-6218 MinGW bash detection fixed by JAnsi 1.14

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

Branch: refs/heads/MNG-6069
Commit: 2a79d1e71edc0ddd0c0ba1612ce520f43961eef2
Parents: 2d44015
Author: Hervé Boutemy <hb...@apache.org>
Authored: Sat May 6 18:25:36 2017 +0200
Committer: Hervé Boutemy <hb...@apache.org>
Committed: Tue May 9 21:08:04 2017 +0200

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/2a79d1e7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2962487..e16d93b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -277,7 +277,7 @@ under the License.
       <dependency>
         <groupId>org.fusesource.jansi</groupId>
         <artifactId>jansi</artifactId>
-        <version>1.13</version>
+        <version>1.16</version>
       </dependency>
       <dependency>
         <groupId>org.slf4j</groupId>


[10/14] maven git commit: improved modello and animal sniffer's execution ids

Posted by kh...@apache.org.
improved modello and animal sniffer's execution ids

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

Branch: refs/heads/MNG-6069
Commit: 44634982a103a696d18619346756b1adaf3dbfd9
Parents: ecef59f
Author: Hervé Boutemy <hb...@apache.org>
Authored: Sun May 21 19:14:54 2017 +0200
Committer: Hervé Boutemy <hb...@apache.org>
Committed: Sun May 21 19:14:54 2017 +0200

----------------------------------------------------------------------
 maven-core/pom.xml       | 2 +-
 maven-model/pom.xml      | 2 +-
 maven-plugin-api/pom.xml | 2 +-
 pom.xml                  | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/44634982/maven-core/pom.xml
----------------------------------------------------------------------
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 717e2a5..6cd8d85 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -214,7 +214,7 @@ under the License.
         </configuration>
         <executions>
           <execution>
-            <id>plugin-site-doc</id>
+            <id>modello-site-doc</id>
             <phase>pre-site</phase>
             <goals>
               <goal>xdoc</goal>

http://git-wip-us.apache.org/repos/asf/maven/blob/44634982/maven-model/pom.xml
----------------------------------------------------------------------
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index aabb25d..581e927 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -61,7 +61,7 @@ under the License.
         </configuration>
         <executions>
           <execution>
-            <id>standard</id>
+            <id>modello</id>
             <goals>
               <goal>java</goal>
               <goal>xpp3-reader</goal>

http://git-wip-us.apache.org/repos/asf/maven/blob/44634982/maven-plugin-api/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
index cf7e0ef..271404f 100644
--- a/maven-plugin-api/pom.xml
+++ b/maven-plugin-api/pom.xml
@@ -75,7 +75,7 @@ under the License.
         </configuration>
         <executions>
           <execution>
-            <id>plugin-site-doc</id>
+            <id>modello-site-doc</id>
             <phase>pre-site</phase>
             <goals>
               <goal>xdoc</goal>

http://git-wip-us.apache.org/repos/asf/maven/blob/44634982/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ce84168..5e12e36 100644
--- a/pom.xml
+++ b/pom.xml
@@ -465,7 +465,7 @@ under the License.
           <version>${modelloVersion}</version>
           <executions>
             <execution>
-              <id>site-docs</id>
+              <id>modello-site-docs</id>
               <phase>pre-site</phase>
               <goals>
                 <goal>xdoc</goal>
@@ -473,7 +473,7 @@ under the License.
               </goals>
             </execution>
             <execution>
-              <id>standard</id>
+              <id>modello</id>
               <goals>
                 <goal>java</goal>
                 <goal>xpp3-reader</goal>
@@ -567,7 +567,7 @@ under the License.
         </configuration>
         <executions>
           <execution>
-            <id>check-java-1.6-compat</id>
+            <id>check-java-compat</id>
             <phase>process-classes</phase>
             <goals>
               <goal>check</goal>