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/08/27 14:58:12 UTC
[01/12] maven git commit: [MNG-6186] fixed path to jansi native libs
in distribution [Forced Update!]
Repository: maven
Updated Branches:
refs/heads/MNG-6069 0abc475f7 -> d349ddd32 (forced update)
[MNG-6186] fixed path to jansi native libs in distribution
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/707cff6f
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/707cff6f
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/707cff6f
Branch: refs/heads/MNG-6069
Commit: 707cff6ffdecbfb0e0356c70e3a7b490535e7ce4
Parents: eb6b212
Author: Hervé Boutemy <hb...@apache.org>
Authored: Sat Jun 10 08:04:43 2017 +0200
Committer: Hervé Boutemy <hb...@apache.org>
Committed: Sat Jun 10 08:04:43 2017 +0200
----------------------------------------------------------------------
apache-maven/src/bin/mvn | 2 +-
apache-maven/src/bin/mvn.cmd | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/707cff6f/apache-maven/src/bin/mvn
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 525b2ef..fa6164b 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -194,6 +194,6 @@ exec "$JAVACMD" \
-classpath "${CLASSWORLDS_JAR}" \
"-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
"-Dmaven.home=${MAVEN_HOME}" \
- "-Dlibrary.jansi.path=${MAVEN_HOME}/jansi-native" \
+ "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/jansi-native" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${CLASSWORLDS_LAUNCHER} "$@"
http://git-wip-us.apache.org/repos/asf/maven/blob/707cff6f/apache-maven/src/bin/mvn.cmd
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index ba61f80..7b0b271 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -181,7 +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" ^
+ "-Dlibrary.jansi.path=%MAVEN_HOME%\lib\jansi-native" ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
[04/12] maven git commit: [MNG-6258] Upgrade to Maven Resolver 1.1.0
Posted by kh...@apache.org.
[MNG-6258] Upgrade to Maven Resolver 1.1.0
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/e520324c
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/e520324c
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/e520324c
Branch: refs/heads/MNG-6069
Commit: e520324c8d45e2465cf8aeafb4d57cef30250136
Parents: a1fe421
Author: Michael Osipov <mi...@apache.org>
Authored: Wed Jul 12 19:50:09 2017 +0200
Committer: Michael Osipov <mi...@apache.org>
Committed: Wed Jul 12 19:50:09 2017 +0200
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/e520324c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d6f165c..78c375f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,7 +65,7 @@ under the License.
<cipherVersion>1.7</cipherVersion>
<modelloVersion>1.9.1</modelloVersion>
<jxpathVersion>1.3</jxpathVersion>
- <resolverVersion>1.0.3</resolverVersion>
+ <resolverVersion>1.1.0</resolverVersion>
<slf4jVersion>1.7.22</slf4jVersion>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
<!-- Control the name of the distribution and information output by mvn -->
[12/12] 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/d349ddd3
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/d349ddd3
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/d349ddd3
Branch: refs/heads/MNG-6069
Commit: d349ddd3222cb15f14230cf9277ee6c82a0106fd
Parents: f047ea1
Author: Karl Heinz Marbaise <kh...@apache.org>
Authored: Sat Mar 18 18:18:27 2017 +0100
Committer: Karl Heinz Marbaise <kh...@apache.org>
Committed: Sun Aug 27 16:36:42 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/d349ddd3/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/12] maven git commit: [MNG-6127] Fix plugin execution
configuration interference
Posted by kh...@apache.org.
[MNG-6127] Fix plugin execution configuration interference
Signed-off-by: rfscholte <rf...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/f1ed6592
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f1ed6592
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f1ed6592
Branch: refs/heads/MNG-6069
Commit: f1ed6592b1c701834d1377fade6cdb382a63bbf4
Parents: 842db37
Author: Mario Krizmanic <ma...@gmail.com>
Authored: Tue Aug 15 21:46:29 2017 +0200
Committer: rfscholte <rf...@apache.org>
Committed: Tue Aug 15 21:46:29 2017 +0200
----------------------------------------------------------------------
.../internal/DefaultLifecyclePluginAnalyzer.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/f1ed6592/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
index aec785f..14653b7 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
@@ -31,6 +31,7 @@ import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.util.ArrayList;
import java.util.Collections;
@@ -190,8 +191,13 @@ public class DefaultLifecyclePluginAnalyzer
execution.setPhase( phase );
execution.setPriority( i - mojos.size() );
execution.getGoals().add( gs.goal );
- execution.setConfiguration( mojo.getConfiguration() );
-
+
+ Xpp3Dom lifecycleConfiguration = mojo.getConfiguration();
+ if ( lifecycleConfiguration != null )
+ {
+ execution.setConfiguration( new Xpp3Dom( lifecycleConfiguration ) );
+ }
+
plugin.setDependencies( mojo.getDependencies() );
plugin.getExecutions().add( execution );
}
[08/12] maven git commit: [MNG-6148] Can't package and assemble with
JDK9/Jigsaw
Posted by kh...@apache.org.
[MNG-6148] Can't package and assemble with JDK9/Jigsaw
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/842db371
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/842db371
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/842db371
Branch: refs/heads/MNG-6069
Commit: 842db371f0fcaf4e930b99395fb6a8bb442684d6
Parents: 4f2a2db
Author: rfscholte <rf...@apache.org>
Authored: Tue Aug 15 21:42:42 2017 +0200
Committer: rfscholte <rf...@apache.org>
Committed: Tue Aug 15 21:42:42 2017 +0200
----------------------------------------------------------------------
pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/842db371/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 78c375f..8ce59ed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -657,6 +657,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.0.0-M1</version>
<configuration>
<!-- TODO Remove when we upgrade to maven-parent 31 -->
<locale>en</locale>
[07/12] maven git commit: [MNG-6174] Clean Up Maven Model
Posted by kh...@apache.org.
[MNG-6174] Clean Up Maven Model
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/4f2a2dba
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/4f2a2dba
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/4f2a2dba
Branch: refs/heads/MNG-6069
Commit: 4f2a2dba89251d9045fe9944783509a397491da3
Parents: 8f8c45c
Author: Karl Heinz Marbaise <kh...@apache.org>
Authored: Sun Feb 19 21:17:31 2017 +0100
Committer: Karl Heinz Marbaise <kh...@apache.org>
Committed: Wed Aug 2 19:31:49 2017 +0200
----------------------------------------------------------------------
maven-model/src/main/mdo/maven.mdo | 667 --------------------------------
1 file changed, 667 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/4f2a2dba/maven-model/src/main/mdo/maven.mdo
----------------------------------------------------------------------
diff --git a/maven-model/src/main/mdo/maven.mdo b/maven-model/src/main/mdo/maven.mdo
index de800d9..7ba6106 100644
--- a/maven-model/src/main/mdo/maven.mdo
+++ b/maven-model/src/main/mdo/maven.mdo
@@ -83,18 +83,6 @@
<!-- ====================================================================== -->
<field>
- <name>pomVersion</name>
- <version>3.0.0</version>
- <required>true</required>
- <type>String</type>
- <description>
- <![CDATA[
- Declares to which version of project descriptor this POM conforms.
- The only valid value is <code>3</code>.
- ]]>
- </description>
- </field>
- <field>
<name>modelVersion</name>
<version>4.0.0+</version>
<required>true</required>
@@ -107,20 +95,6 @@
<!-- ====================================================================== -->
<field xdoc.separator="blank">
- <name>extend</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- The location of the parent project, if one exists. Values from the
- parent project will be the default for this project if they are
- left unspecified. The path may be absolute, or relative to the
- current <code>project.xml</code> file. For example,
- <code><extend>${basedir}/../project.xml</extend></code>.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field xdoc.separator="blank">
<name>parent</name>
<version>4.0.0+</version>
<description>The location of the parent project, if one exists. Values from the parent
@@ -159,25 +133,6 @@
<type>String</type>
</field>
<field>
- <name>id</name>
- <version>3.0.0</version>
- <required>true</required>
- <description>
- <![CDATA[
- <b>Deprecated</b>. When used, this sets both the <code>groupId</code>
- and <code>artifactId</code> elements if they were previously empty.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field>
- <name>currentVersion</name>
- <description>The current version of the artifact produced by this project.</description>
- <version>3.0.0</version>
- <required>true</required>
- <type>String</type>
- </field>
- <field>
<name>version</name>
<version>4.0.0+</version>
<required>true</required>
@@ -185,15 +140,6 @@
<type>String</type>
</field>
<field>
- <name>versions</name>
- <version>3.0.0</version>
- <description>Contains information on previous versions of the project.</description>
- <association>
- <type>Version</type>
- <multiplicity>*</multiplicity>
- </association>
- </field>
- <field>
<name>packaging</name>
<version>4.0.0+</version>
<description>
@@ -223,13 +169,6 @@
<type>String</type>
</field>
<field>
- <name>shortDescription</name>
- <version>3.0.0</version>
- <description>A short description of the project. The short description should be limited
- to a single line.</description>
- <type>String</type>
- </field>
- <field>
<name>description</name>
<version>3.0.0+</version>
<description>A detailed description of the project, used by Maven whenever it needs to
@@ -251,20 +190,6 @@
<type>String</type>
</field>
<field>
- <name>siteAddress</name>
- <version>3.0.0</version>
- <description>The hostname of the web server that hosts the project's web site. This is
- used when the web site is deployed.</description>
- <type>String</type>
- </field>
- <field>
- <name>siteDirectory</name>
- <version>3.0.0</version>
- <description>The directory on the web server where the public web site for this project
- resides. This is used when the web site is deployed.</description>
- <type>String</type>
- </field>
- <field>
<name>inceptionYear</name>
<version>3.0.0+</version>
<required>true</required>
@@ -273,20 +198,6 @@
<type>String</type>
</field>
<field>
- <name>logo</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- The URL of the project's logo image. This can be an URL relative
- to the base directory of the generated web site,
- (e.g., <code>/images/project-logo.png</code>) or an absolute URL
- (e.g., <code>http://my.corp/project-logo.png</code>). This is used
- when generating the project documentation.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field>
<name>organization</name>
<version>3.0.0+</version>
<description>This element describes various attributes of the organization to which the
@@ -361,27 +272,6 @@
<!-- SCM -->
<!-- ====================================================================== -->
- <field xdoc.separator="blank">
- <name>branches</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- Contains information on SCM branches of the project.
- ]]>
- </description>
- <association>
- <type>Branch</type>
- <multiplicity>*</multiplicity>
- </association>
- </field>
- <field>
- <name>repository</name>
- <version>3.0.0</version>
- <description>Specification for the SCM used by the project, such as CVS, Subversion, etc.</description>
- <association>
- <type>Repository</type>
- </association>
- </field>
<field xdoc.separator="blank" xml.insertParentFieldsUpTo="modules">
<name>scm</name>
<version>4.0.0+</version>
@@ -395,12 +285,6 @@
<!-- Issue Tracking -->
<!-- ====================================================================== -->
- <field xdoc.separator="blank">
- <name>issueTrackingUrl</name>
- <version>3.0.0</version>
- <description>The URL of the project's issue tracking system.</description>
- <type>String</type>
- </field>
<field>
<name>issueManagement</name>
<version>4.0.0+</version>
@@ -415,12 +299,6 @@
<!-- ====================================================================== -->
<field>
- <name>gumpRepositoryId</name>
- <version>3.0.0</version>
- <description>This is the repository identifier in Gump that this project is part of.</description>
- <type>String</type>
- </field>
- <field>
<name>ciManagement</name>
<version>4.0.0+</version>
<description>The project's continuous integration information.</description>
@@ -430,83 +308,6 @@
</field>
<!-- ====================================================================== -->
- <!-- Distribution Management -->
- <!-- ====================================================================== -->
-
- <field>
- <name>distributionSite</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- The server where the final distributions will be published. This is used when the
- distributions are deployed. If this isn't defined, the central repository is used instead as
- determined by <code>maven.repo.central</code> and <code>maven.repo.central.directory</code>.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field>
- <name>distributionDirectory</name>
- <version>3.0.0</version>
- <description>The directory on the web server where the final distributions will be
- published. This is used when the distributions are deployed.</description>
- <type>String</type>
- </field>
-
- <!-- ====================================================================== -->
- <!-- Specific version 3 -->
- <!-- ====================================================================== -->
-
- <field>
- <name>packageGroups</name>
- <version>3.0.0</version>
- <description>Package groups required for complete javadocs.</description>
- <association>
- <type>PackageGroup</type>
- <multiplicity>*</multiplicity>
- </association>
- </field>
- <field>
- <name>reports</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- This element includes the specification of reports to be
- included in a Maven-generated site. These reports will be run
- when a user executes <code>maven site</code>. All of the
- reports will be included in the navigation bar for browsing in
- the order they are specified.
- ]]>
- </description>
- <association>
- <type>String</type>
- <multiplicity>*</multiplicity>
- </association>
- </field>
- <field>
- <name>properties</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- Project properties that will be used by various plugins.
- The format is <code><name>value</name></code>.
- ]]>
- </description>
- <type>Properties</type>
- <association xml.mapStyle="inline">
- <type>String</type>
- <multiplicity>*</multiplicity>
- </association>
- </field>
- <field xml.tagName="package">
- <name>packageName</name>
- <version>3.0.0</version>
- <type>String</type>
- <description>The Java package name of the project. This value is used when generating
- JavaDoc.</description>
- </field>
-
- <!-- ====================================================================== -->
<!-- Build -->
<!-- ====================================================================== -->
@@ -537,33 +338,6 @@
</fields>
<codeSegments>
<codeSegment>
- <version>3.0.0</version>
- <code>
- <![CDATA[
- public void setVersion(String version)
- {
- this.currentVersion = version;
- }
-
- public String getVersion()
- {
- return currentVersion;
- }
-
- /* We need this because we can't use package as a field name.*/
- public void setPackage(String packageName)
- {
- this.packageName = packageName;
- }
-
- public String getPackage()
- {
- return packageName;
- }
- ]]>
- </code>
- </codeSegment>
- <codeSegment>
<version>4.0.0+</version>
<code>
<![CDATA[
@@ -757,21 +531,6 @@
</field>
</fields>
</class>
- <class>
- <name>Branch</name>
- <version>3.0.0</version>
- <description>Contains information on the SCM branches of the project.</description>
- <fields>
- <field>
- <name>tag</name>
- <version>3.0.0</version>
- <required>true</required>
- <description>The branch tag in the version control system (e.g. cvs) used by the project
- for the source code associated with this branch of the project.</description>
- <type>String</type>
- </field>
- </fields>
- </class>
<class java.clone="deep">
<name>PluginContainer</name>
<version>3.0.0+</version>
@@ -936,14 +695,6 @@
</description>
<fields>
<field>
- <name>nagEmailAddress</name>
- <version>3.0.0</version>
- <description>An address to which notifications regarding the status of builds for this
- project can be sent. This is intended for use by tools which do unattended builds, for
- example those providing for continuous integration.</description>
- <type>String</type>
- </field>
- <field>
<name>sourceDirectory</name>
<version>3.0.0+</version>
<required>true</required>
@@ -969,15 +720,6 @@
<type>String</type>
</field>
<field>
- <name>unitTestSourceDirectory</name>
- <version>3.0.0</version>
- <required>true</required>
- <description>This element specifies a directory containing the unit test source of the
- project. The generated build system will compile these directories when the project is
- being tested. The path given is relative to the project descriptor.</description>
- <type>String</type>
- </field>
- <field>
<name>testSourceDirectory</name>
<version>4.0.0+</version>
<required>true</required>
@@ -990,52 +732,6 @@
<type>String</type>
</field>
<field>
- <name>aspectSourceDirectory</name>
- <version>3.0.0</version>
- <description>This element specifies a directory containing Aspect sources of the project.
- The generated build system will compile the Aspects in this directory when the project
- is built if Aspects have been enabled. The path given is relative to the project
- descriptor.</description>
- <type>String</type>
- </field>
- <field>
- <name>integrationUnitTestSourceDirectory</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- This element is <b>deprecated</b> and should no longer be used.
- Initially it was used by the first Cactus plugin. Now
- the location of the Cactus test sources is defined
- through a plugin property. See the Cactus plugin
- <a href="http://jakarta.apache.org/cactus/integration/maven/properties.html">properties</a>
- page.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field>
- <name>sourceModifications</name>
- <version>3.0.0</version>
- <required>true</required>
- <description>This element describes all of the sourceModifications associated with a
- project. These modifications are used to exclude or include various source depending on
- the environment the build is running in.</description>
- <association>
- <type>SourceModification</type>
- <multiplicity>*</multiplicity>
- </association>
- </field>
- <field>
- <name>unitTest</name>
- <version>3.0.0</version>
- <required>true</required>
- <description>This element specifies unit tests associated with the project.</description>
- <defaultValue>new UnitTest()</defaultValue>
- <association>
- <type>UnitTest</type>
- </association>
- </field>
- <field>
<name>outputDirectory</name>
<version>4.0.0+</version>
<description><![CDATA[
@@ -1254,18 +950,6 @@
</description>
<fields>
<field>
- <name>id</name>
- <version>3.0.0</version>
- <required>true</required>
- <description>
- <![CDATA[
- <b>Deprecated</b>. Please use <code>groupId</code> and
- <code>artifactId</code> together instead.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field>
<name>groupId</name>
<version>3.0.0+</version>
<required>true</required>
@@ -1301,36 +985,6 @@
<type>String</type>
</field>
<field>
- <name>url</name>
- <version>3.0.0</version>
- <description>This url will be provided to the user if the jar file cannot be downloaded
- from the central repository.</description>
- <type>String</type>
- </field>
- <field>
- <name>jar</name>
- <version>3.0.0</version>
- <description>Literal name of the artifact in the repository. Used to override the
- calculated artifact name.</description>
- <type>String</type>
- </field>
- <field>
- <name>type</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- The type of dependency. While it
- usually represents the extension on the filename of the dependency,
- that is not always the case.
- Some examples are <code>jar</code>, <code>war</code>, and <code>plugin</code>.
- A dependency of type <code>plugin</code> is loaded as a Maven plugin and
- not added to the project build classpath.
- ]]>
- </description>
- <type>String</type>
- <defaultValue>jar</defaultValue>
- </field>
- <field>
<name>type</name>
<version>4.0.0+</version>
<description>
@@ -1371,23 +1025,6 @@
<required>false</required>
</field>
<field>
- <name>properties</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- Properties about the dependency. Various plugins allow you to
- mark dependencies with properties. For example the war plugin looks for a
- <code>war.bundle</code> property, and if found will include the
- dependency in <code>WEB-INF/lib</code>.
- ]]>
- </description>
- <type>Properties</type>
- <association xml.mapStyle="inline">
- <type>String</type>
- <multiplicity>*</multiplicity>
- </association>
- </field>
- <field>
<name>scope</name>
<version>4.0.0+</version>
<description>
@@ -1450,20 +1087,6 @@
</fields>
<codeSegments>
<codeSegment>
- <version>3.0.0</version>
- <code>
- <![CDATA[
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return groupId + "/" + type + "s:" + artifactId + "-" + version;
- }
- ]]>
- </code>
- </codeSegment>
- <codeSegment>
<version>4.0.0+</version>
<code>
<![CDATA[
@@ -1507,111 +1130,6 @@
]]>
</code>
</codeSegment>
- <codeSegment>
- <version>3.0.0</version>
- <code>
- <![CDATA[
- /**
- * @return the key as <code>id:type</code>
- */
- public String getKey()
- {
- return getId() + ":" + getType();
- }
-
- /**
- * @return the groupId as artifact directory
- */
- public String getArtifactDirectory()
- {
- return getGroupId();
- }
-
- /**
- * @return the artifact name as <code>artifactId-version.extension</code> if <jar/> not set
- */
- public String getArtifact()
- {
- // If the jar name has been explicitly set then use that. This
- // is when the <jar/> element is explicitly used in the POM.
- if ( getJar() != null)
- {
- return getJar();
- }
-
- String artifact;
-
- if ("ejb-client".equals(getType())) {
- artifact = getArtifactId() + "-" + getVersion() + "-client." + getExtension();
- } else {
- artifact = getArtifactId() + "-" + getVersion() + "." + getExtension();
- }
-
- return artifact;
- }
-
- public String getTypeDirectory()
- {
- String path;
- if (getType().equals("ejb-client")) {
- path = "ejbs";
- } else {
- path = getType() + "s";
- }
-
- return path;
- }
-
- public String getExtension()
- {
- if ("ejb".equals(getType()) || "ejb-client".equals(getType()) || "plugin".equals(getType()) || "aspect".equals(getType()) || "uberjar".equals(getType())) return "jar";
- return getType();
- }
-
- public boolean isAddedToClasspath()
- {
- return ("jar".equals(getType()) || "ejb".equals(getType()) || "ejb-client".equals(getType()) || "sar".equals(getType()));
- }
-
- public boolean isPlugin()
- {
- return ("plugin".equals(getType()));
- }
-
- public String getProperty( String property )
- {
- return getProperties().getProperty( property );
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals( Object o )
- {
- if ( this == o )
- {
- return true;
- }
-
- if ( !( o instanceof Dependency ) )
- {
- return false;
- }
-
- Dependency d = (Dependency) o;
- return getId().equals( d.getId() );
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode()
- {
- return getId().hashCode();
- }
- ]]>
- </code>
- </codeSegment>
</codeSegments>
</class>
<class>
@@ -1887,39 +1405,6 @@
<description>The URL to the organization's home page.</description>
<type>String</type>
</field>
- <field>
- <name>logo</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- The URL to the organization's logo image. This can be an URL relative
- to the base directory of the generated web site,
- (e.g., <code>/images/org-logo.png</code>) or an absolute URL
- (e.g., <code>http://my.corp/logo.png</code>). This value is used
- when generating the project documentation.
- ]]>
- </description>
- <type>String</type>
- </field>
- </fields>
- </class>
- <class>
- <name>PackageGroup</name>
- <version>3.0.0</version>
- <description>A JavaDoc package group.</description>
- <fields>
- <field>
- <name>title</name>
- <version>3.0.0</version>
- <description>The title to use for the package group.</description>
- <type>String</type>
- </field>
- <field>
- <name>packages</name>
- <version>3.0.0</version>
- <description>The packages in the group</description>
- <type>String</type>
- </field>
</fields>
</class>
<class java.clone="deep">
@@ -2077,50 +1562,6 @@
</codeSegments>
</class>
- <class>
- <name>Repository</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- The <code><repository></code> element contains informations required to a repository
- used by the project.
- ]]>
- </description>
- <fields>
- <field>
- <name>connection</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- The source control management system URL
- that describes the repository and how to connect to the
- repository. For more information, see the
- <a href="https://maven.apache.org/scm/scm-url-format.html">URL format</a>
- and <a href="https://maven.apache.org/scm/scms-overview.html">list of supported SCMs</a>.
- This connection is read-only.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field>
- <name>developerConnection</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- Just like <code>connection</code>, but for developers, i.e. this scm connection
- will not be read only.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field>
- <name>url</name>
- <version>3.0.0</version>
- <description>The URL to the project's browsable SCM repository, such as ViewVC or Fisheye.</description>
- <type>String</type>
- </field>
- </fields>
- </class>
<class java.clone="deep">
<name>Scm</name>
<version>4.0.0+</version>
@@ -2299,114 +1740,6 @@
</codeSegment>
</codeSegments>
</class>
- <class>
- <name>SourceModification</name>
- <description>This element describes all of the source modifications associated with a project.
- These modifications are used to exclude or include various source depending on the
- environment the build is running in.</description>
- <version>3.0.0</version>
- <superClass>FileSet</superClass>
- <fields>
- <field>
- <name>className</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- If the class with this name can <b>not</b> be
- loaded, then the includes and excludes specified below
- will be applied to the contents of the <code>sourceDirectory</code>.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field>
- <name>property</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- If the property with this name is <b>not</b> set,
- then the includes and excludes specified below
- will be applied to the contents of the <code>sourceDirectory</code>.
- ]]>
- </description>
- <type>String</type>
- </field>
- </fields>
- </class>
- <class>
- <name>UnitTest</name>
- <version>3.0.0</version>
- <superClass>PatternSet</superClass>
- <description>A PatternSet for unit tests.</description>
- <fields>
- <field>
- <name>resources</name>
- <version>3.0.0</version>
- <description>The classpath resources to use when executing the unit tests.</description>
- <association>
- <type>Resource</type>
- <multiplicity>*</multiplicity>
- </association>
- </field>
- </fields>
- </class>
- <class>
- <name>Version</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- This element describes each of the previous versions of the
- project. Each version is described by a <code>version</code>
- element
- ]]>
- </description>
- <fields>
- <field>
- <name>name</name>
- <version>3.0.0</version>
- <description>
- <![CDATA[
- The external version number under which this release was distributed. Examples include:
- <code>1.0</code>,
- <code>1.1-alpha1</code>,
- <code>1.2-beta</code>,
- <code>1.3.2</code> etc.
- ]]>
- </description>
- <type>String</type>
- </field>
- <field>
- <name>tag</name>
- <version>3.0.0</version>
- <description>The name given in the SCM (e.g. CVS) used by the project for the source code
- associated with this version of the project.</description>
- <type>String</type>
- </field>
- <field>
- <name>id</name>
- <version>3.0.0</version>
- <description>A unique identifier for a version. This is usually identical to the name.</description>
- <type>String</type>
- </field>
- </fields>
- <codeSegments>
- <codeSegment>
- <version>3.0.0</version>
- <code>
- <![CDATA[
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return getId();
- }
- ]]>
- </code>
- </codeSegment>
- </codeSegments>
- </class>
-
<class java.clone="deep">
<name>RepositoryBase</name>
<version>4.0.0+</version>
[11/12] maven git commit: Squashed commit of the following:
Posted by kh...@apache.org.
Squashed commit of the following:
commit c829bdcfc275b207e23fc568b3c16d98195675be
Author: rfscholte <rf...@apache.org>
Date: Thu Aug 24 10:54:08 2017 +0200
[MNG-6275] ServiceLoaderFactory can't find implementations via ClassRealm
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/f047ea14
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f047ea14
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f047ea14
Branch: refs/heads/MNG-6069
Commit: f047ea143766fd22ae42040e6805bef287f3cc3e
Parents: 785bad6
Author: rfscholte <rf...@apache.org>
Authored: Thu Aug 24 11:33:01 2017 +0200
Committer: rfscholte <rf...@apache.org>
Committed: Thu Aug 24 11:33:01 2017 +0200
----------------------------------------------------------------------
.../classrealm/DefaultClassRealmManager.java | 2 +-
.../DefaultClassRealmManagerTest.java | 101 +++++++++++++++++++
2 files changed, 102 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/f047ea14/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java b/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
index 6ce1925..d517924 100644
--- a/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
+++ b/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
@@ -120,7 +120,7 @@ public class DefaultClassRealmManager
{
try
{
- ClassRealm classRealm = world.newRealm( realmId, null );
+ ClassRealm classRealm = world.newRealm( realmId, ClassLoader.getSystemClassLoader() );
if ( logger.isDebugEnabled() )
{
http://git-wip-us.apache.org/repos/asf/maven/blob/f047ea14/maven-core/src/test/java/org/apache/maven/classrealm/DefaultClassRealmManagerTest.java
----------------------------------------------------------------------
diff --git a/maven-core/src/test/java/org/apache/maven/classrealm/DefaultClassRealmManagerTest.java b/maven-core/src/test/java/org/apache/maven/classrealm/DefaultClassRealmManagerTest.java
new file mode 100644
index 0000000..726199f
--- /dev/null
+++ b/maven-core/src/test/java/org/apache/maven/classrealm/DefaultClassRealmManagerTest.java
@@ -0,0 +1,101 @@
+package org.apache.maven.classrealm;
+
+/*
+ * 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.ServiceLoader;
+
+import javax.script.ScriptEngineFactory;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+import org.junit.Test;
+
+public class DefaultClassRealmManagerTest extends PlexusTestCase
+{
+ private ClassRealmManager classRealmManager;
+
+ @Override
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+ this.classRealmManager = lookup( ClassRealmManager.class );
+ }
+
+ @Override
+ protected void customizeContainerConfiguration( ContainerConfiguration configuration )
+ {
+ configuration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
+ }
+
+ @Test
+ public void testMNG6275_pluginRealmDefaultParentClassLoader()
+ {
+ Plugin plugin = new Plugin();
+ plugin.setVersion( "VERSION" );
+
+ ClassLoader parent = null;
+
+ ClassRealm pluginRealm = classRealmManager.createPluginRealm( plugin, parent, null, null, null );
+ ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, pluginRealm );
+ assertTrue( sef.iterator().hasNext() );
+ }
+
+ @Test
+ public void testMNG6275_extensionRealmDefaultParentClassLoader()
+ {
+ Plugin extension = new Plugin();
+ extension.setVersion( "VERSION" );
+
+ ClassRealm extensionRealm = classRealmManager.createExtensionRealm( extension, null );
+ ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, extensionRealm );
+ assertTrue( sef.iterator().hasNext() );
+ }
+
+ @Test
+ public void testMNG6275_projectRealmDefaultParentClassLoader()
+ {
+ Model model = new Model();
+
+ ClassRealm projectRealm = classRealmManager.createProjectRealm( model, null );
+ ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, projectRealm );
+ assertTrue( sef.iterator().hasNext() );
+ }
+
+ @Test
+ public void testMNG6275_mavenApiRealmDefaultParentClassLoader()
+ {
+ ClassRealm mavenApiRealm = classRealmManager.getMavenApiRealm();
+ ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, mavenApiRealm );
+ assertTrue( sef.iterator().hasNext() );
+ }
+
+ @Test
+ public void testMNG6275_coreRealmDefaultParentClassLoader()
+ {
+ ClassRealm coreRealm = classRealmManager.getCoreRealm();
+ ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, coreRealm );
+ assertTrue( sef.iterator().hasNext() );
+ }
+}
[02/12] maven git commit: [MNG-6207] Create WARNINGs in case of using
system scope o display deprecation build warning for dependencies with scope
'system' declaration o Note about tests: existing 'systemPath' related tests
are reused/expanded (rati
Posted by kh...@apache.org.
[MNG-6207] Create WARNINGs in case of using system scope
o display deprecation build warning for dependencies with scope 'system' declaration
o Note about tests: existing 'systemPath' related tests are reused/expanded
(rationale: scope 'system' and 'systemPath' are mutually dependent)
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/12d64713
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/12d64713
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/12d64713
Branch: refs/heads/MNG-6069
Commit: 12d6471337c7ad067b7762d44050a079829ea26c
Parents: 707cff6
Author: dejan2609 <de...@gmail.com>
Authored: Sat May 20 15:42:43 2017 +0200
Committer: Karl Heinz Marbaise <kh...@apache.org>
Committed: Sun Jun 11 13:55:07 2017 +0200
----------------------------------------------------------------------
.../model/validation/DefaultModelValidator.java | 14 +++++---
.../validation/DefaultModelValidatorTest.java | 36 +++++++++++++++++---
2 files changed, 41 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/12d64713/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 f46be0e..2e7985f 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
@@ -467,6 +467,13 @@ public class DefaultModelValidator
}
else if ( "system".equals( dependency.getScope() ) )
{
+
+ if ( request.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1 )
+ {
+ addViolation( problems, Severity.WARNING, Version.V31, prefix + ".scope", key,
+ "declares usage of deprecated 'system' scope ", dependency );
+ }
+
String sysPath = dependency.getSystemPath();
if ( StringUtils.isNotEmpty( sysPath ) )
{
@@ -488,7 +495,7 @@ 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 );
+ "is either LATEST or RELEASE (both of them are being deprecated)", dependency );
}
Dependency existing = index.get( key );
@@ -1034,9 +1041,8 @@ public class DefaultModelValidator
buffer.append( ' ' ).append( message );
// CHECKSTYLE_OFF: LineLength
- problems.add( new ModelProblemCollectorRequest( severity,
- version ).setMessage( buffer.toString() ).setLocation( getLocation( fieldName,
- tracker ) ) );
+ problems.add( new ModelProblemCollectorRequest( severity, version ).setMessage(
+ buffer.toString() ).setLocation( getLocation( fieldName, tracker ) ) );
// CHECKSTYLE_ON: LineLength
}
http://git-wip-us.apache.org/repos/asf/maven/blob/12d64713/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 bb99be9..4da3c87 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
@@ -418,7 +418,20 @@ public class DefaultModelValidatorTest
assertViolations( result, 0, 0, 1 );
- assertTrue( result.getWarnings().get( 0 ).contains( "test:a:jar" ) );
+ assertContains( result.getWarnings().get( 0 ),
+ "'dependencies.dependency.systemPath' for test:a:jar should use a variable instead of a hard-coded path" );
+
+ SimpleProblemCollector result_31 = validateRaw( "hard-coded-system-path.xml", ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1 );
+
+ assertViolations( result_31, 0, 0, 3 );
+
+ assertContains( result_31.getWarnings().get( 0 ),
+ "'dependencies.dependency.scope' for test:a:jar declares usage of deprecated 'system' scope" );
+ assertContains( result_31.getWarnings().get( 1 ),
+ "'dependencies.dependency.systemPath' for test:a:jar should use a variable instead of a hard-coded path" );
+ assertContains( result_31.getWarnings().get( 2 ),
+ "'dependencies.dependency.scope' for test:b:jar declares usage of deprecated 'system' scope" );
+
}
public void testEmptyModule()
@@ -611,10 +624,23 @@ public class DefaultModelValidatorTest
assertViolations( result, 0, 0, 2 );
- assertContains( result.getWarnings().get( 0 ), "'dependencies.dependency.systemPath' for test:a:jar "
- + "should not point at files within the project directory" );
- assertContains( result.getWarnings().get( 1 ), "'dependencies.dependency.systemPath' for test:b:jar "
- + "should not point at files within the project directory" );
+ assertContains( result.getWarnings().get( 0 ),
+ "'dependencies.dependency.systemPath' for test:a:jar should not point at files within the project directory" );
+ assertContains( result.getWarnings().get( 1 ),
+ "'dependencies.dependency.systemPath' for test:b:jar should not point at files within the project directory" );
+
+ SimpleProblemCollector result_31 = validateRaw( "basedir-system-path.xml", ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1 );
+
+ assertViolations( result_31, 0, 0, 4 );
+
+ assertContains( result_31.getWarnings().get( 0 ),
+ "'dependencies.dependency.scope' for test:a:jar declares usage of deprecated 'system' scope" );
+ assertContains( result_31.getWarnings().get( 1 ),
+ "'dependencies.dependency.systemPath' for test:a:jar should not point at files within the project directory" );
+ assertContains( result_31.getWarnings().get( 2 ),
+ "'dependencies.dependency.scope' for test:b:jar declares usage of deprecated 'system' scope" );
+ assertContains( result_31.getWarnings().get( 3 ),
+ "'dependencies.dependency.systemPath' for test:b:jar should not point at files within the project directory" );
}
public void testInvalidVersionInPluginManagement()
[06/12] maven git commit: [MNG-6123] detect self references in POM
and fail fast o Added unit test and self referencing pom
Posted by kh...@apache.org.
[MNG-6123] detect self references in POM and fail fast
o Added unit test and self referencing pom
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/8f8c45c9
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/8f8c45c9
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/8f8c45c9
Branch: refs/heads/MNG-6069
Commit: 8f8c45c990193b04c1770997d446951c5185b164
Parents: b100257
Author: Karl Heinz Marbaise <kh...@apache.org>
Authored: Tue Apr 4 22:46:11 2017 +0200
Committer: Karl Heinz Marbaise <kh...@apache.org>
Committed: Tue Aug 1 22:01:36 2017 +0200
----------------------------------------------------------------------
.../model/validation/DefaultModelValidator.java | 54 ++++++++++++++++++--
.../validation/DefaultModelValidatorTest.java | 13 +++++
.../validation/raw-model/self-referencing.xml | 38 ++++++++++++++
3 files changed, 102 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/8f8c45c9/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 2e7985f..d97d8f6 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
@@ -131,6 +131,9 @@ public class DefaultModelValidator
validate20RawDependencies( problems, m.getDependencies(), "dependencies.dependency", request );
+ validate20RawDependenciesSelfReferencing( problems, m, m.getDependencies(), "dependencies.dependency",
+ request );
+
if ( m.getDependencyManagement() != null )
{
validate20RawDependencies( problems, m.getDependencyManagement().getDependencies(),
@@ -344,12 +347,12 @@ public class DefaultModelValidator
Severity errOn30 = getSeverity( request, ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0 );
- validateEffectiveDependencies( problems, m.getDependencies(), false, request );
+ validateEffectiveDependencies( problems, m, m.getDependencies(), false, request );
DependencyManagement mgmt = m.getDependencyManagement();
if ( mgmt != null )
{
- validateEffectiveDependencies( problems, mgmt.getDependencies(), true, request );
+ validateEffectiveDependencies( problems, m, mgmt.getDependencies(), true, request );
}
if ( request.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 )
@@ -524,7 +527,33 @@ public class DefaultModelValidator
}
}
- private void validateEffectiveDependencies( ModelProblemCollector problems, List<Dependency> dependencies,
+ private void validate20RawDependenciesSelfReferencing( ModelProblemCollector problems, Model m,
+ List<Dependency> dependencies, String prefix,
+ ModelBuildingRequest request )
+ {
+ // We only check for groupId/artifactId cause if there is another
+ // module with the same groupId/artifactId this will fail the build
+ // earlier like "Project '...' is duplicated in the reactor.
+ // So it is sufficient to check only groupId/artifactId and not the
+ // packaging type.
+ for ( Dependency dependency : dependencies )
+ {
+ String key = dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + dependency.getVersion();
+ String mKey = m.getGroupId() + ":" + m.getArtifactId() + ":" + m.getVersion();
+ if ( key.equals( mKey ) )
+ {
+ // This means a module which is build has a dependency which has the same
+ // groupId, artifactId and version coordinates. This is in consequence
+ // a self reference or in other words a circular reference which can not
+ // being resolved.
+ addViolation( problems, Severity.FATAL, Version.V31, prefix + " " + key, key, "is referencing itself.",
+ dependency );
+
+ }
+ }
+ }
+
+ private void validateEffectiveDependencies( ModelProblemCollector problems, Model m, List<Dependency> dependencies,
boolean management, ModelBuildingRequest request )
{
Severity errOn30 = getSeverity( request, ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0 );
@@ -551,11 +580,30 @@ public class DefaultModelValidator
*/
validateEnum( prefix + "scope", problems, Severity.WARNING, Version.V20, d.getScope(),
d.getManagementKey(), d, "provided", "compile", "runtime", "test", "system" );
+
+ validateEffectiveModelAgainstDependency( prefix, problems, m, d, request );
}
}
}
}
+ private void validateEffectiveModelAgainstDependency( String prefix, ModelProblemCollector problems, Model m,
+ Dependency d, ModelBuildingRequest request )
+ {
+ String key = d.getGroupId() + ":" + d.getArtifactId() + ":" + d.getVersion();
+ String mKey = m.getGroupId() + ":" + m.getArtifactId() + ":" + m.getVersion();
+ if ( key.equals( mKey ) )
+ {
+ // This means a module which is build has a dependency which has the same
+ // groupId, artifactId and version coordinates. This is in consequence
+ // a self reference or in other words a circular reference which can not
+ // being resolved.
+ addViolation( problems, Severity.FATAL, Version.V31, prefix + " " + key, key, "is referencing itself.", d );
+
+ }
+
+ }
+
private void validate20EffectivePluginDependencies( ModelProblemCollector problems, Plugin plugin,
ModelBuildingRequest request )
{
http://git-wip-us.apache.org/repos/asf/maven/blob/8f8c45c9/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 4da3c87..5614daf 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
@@ -714,4 +714,17 @@ public class DefaultModelValidatorTest
assertContains( result.getWarnings().get( 1 ),
"'dependencies.dependency.version' for test:b:jar is either LATEST or RELEASE (both of them are being deprecated)" );
}
+
+ public void testSelfReferencingDependencyInRawModel()
+ throws Exception
+ {
+ SimpleProblemCollector result = validateRaw( "raw-model/self-referencing.xml" );
+
+ assertViolations( result, 1, 0, 0 );
+
+ assertEquals( "'dependencies.dependency com.example.group:testinvalidpom:0.0.1-SNAPSHOT' for com.example.group:testinvalidpom:0.0.1-SNAPSHOT is referencing itself.",
+ result.getFatals().get( 0 ) );
+
+ }
+
}
http://git-wip-us.apache.org/repos/asf/maven/blob/8f8c45c9/maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.xml
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.xml b/maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.xml
new file mode 100644
index 0000000..a902896
--- /dev/null
+++ b/maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.example.group</groupId>
+ <artifactId>testinvalidpom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+
+ <description>
+ This will test if the module validator recognized that this
+ dependency is the same as the module itself.
+ </description>
+ <dependencies>
+ <dependency>
+ <groupId>com.example.group</groupId>
+ <artifactId>testinvalidpom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
[10/12] maven git commit: [MNG-6220] Add CLI options to control color
output Introduce -Dstyle.color=[always|never|auto]
Posted by kh...@apache.org.
[MNG-6220] Add CLI options to control color output
Introduce -Dstyle.color=[always|never|auto]
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/785bad69
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/785bad69
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/785bad69
Branch: refs/heads/MNG-6069
Commit: 785bad693c60ad60d7b307af8fab9e9234ff57bd
Parents: f1ed659
Author: rfscholte <rf...@apache.org>
Authored: Tue Aug 15 21:48:57 2017 +0200
Committer: rfscholte <rf...@apache.org>
Committed: Tue Aug 15 21:48:57 2017 +0200
----------------------------------------------------------------------
maven-embedder/pom.xml | 5 ++
.../java/org/apache/maven/cli/MavenCli.java | 28 +++++--
.../java/org/apache/maven/cli/MavenCliTest.java | 86 ++++++++++++++++++--
3 files changed, 107 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/785bad69/maven-embedder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 7bd2650..4b3d097 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -138,6 +138,11 @@ under the License.
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.fusesource.jansi</groupId>
+ <artifactId>jansi</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/maven/blob/785bad69/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 641a2a9..3474fab 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
@@ -144,6 +144,8 @@ public class MavenCli
private static final String MVN_MAVEN_CONFIG = ".mvn/maven.config";
+ public static final String STYLE_COLOR_PROPERTY = "style.color";
+
private ClassWorld classWorld;
private LoggerManager plexusLoggerManager;
@@ -472,8 +474,9 @@ public class MavenCli
/**
* configure logging
*/
- private void logging( CliRequest cliRequest )
+ void logging( CliRequest cliRequest )
{
+ // LOG LEVEL
cliRequest.debug = cliRequest.commandLine.hasOption( CLIManager.DEBUG );
cliRequest.quiet = !cliRequest.debug && cliRequest.commandLine.hasOption( CLIManager.QUIET );
cliRequest.showErrors = cliRequest.debug || cliRequest.commandLine.hasOption( CLIManager.ERRORS );
@@ -494,18 +497,33 @@ public class MavenCli
// else fall back to default log level specified in conf
// see https://issues.apache.org/jira/browse/MNG-2570
- if ( cliRequest.commandLine.hasOption( CLIManager.BATCH_MODE ) )
+ // LOG COLOR
+ String styleColor = cliRequest.getUserProperties().getProperty( STYLE_COLOR_PROPERTY, "auto" );
+ if ( "always".equals( styleColor ) )
+ {
+ MessageUtils.setColorEnabled( true );
+ }
+ else if ( "never".equals( styleColor ) )
{
MessageUtils.setColorEnabled( false );
}
-
+ else if ( !"auto".equals( styleColor ) )
+ {
+ throw new IllegalArgumentException( "Invalid color configuration option [" + styleColor
+ + "]. Supported values are (auto|always|never)." );
+ }
+ else if ( cliRequest.commandLine.hasOption( CLIManager.BATCH_MODE )
+ || cliRequest.commandLine.hasOption( CLIManager.LOG_FILE ) )
+ {
+ MessageUtils.setColorEnabled( false );
+ }
+
+ // LOG STREAMS
if ( cliRequest.commandLine.hasOption( CLIManager.LOG_FILE ) )
{
File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) );
logFile = resolveFile( logFile, cliRequest.workingDirectory );
- MessageUtils.setColorEnabled( false );
-
// redirect stdout and stderr to file
try
{
http://git-wip-us.apache.org/repos/asf/maven/blob/785bad69/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
index 9b480ea..433c949 100644
--- a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
+++ b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
@@ -19,26 +19,35 @@ package org.apache.maven.cli;
* under the License.
*/
-import junit.framework.TestCase;
-import org.apache.commons.cli.ParseException;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
import java.io.File;
+import org.apache.commons.cli.ParseException;
+import org.apache.maven.shared.utils.logging.MessageUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
public class MavenCliTest
- extends TestCase
{
private MavenCli cli;
private String origBasedir;
- protected void setUp()
+ @Before
+ public void setUp()
{
cli = new MavenCli();
origBasedir = System.getProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY );
}
- @Override
- protected void tearDown()
+ @After
+ public void tearDown()
throws Exception
{
if ( origBasedir != null )
@@ -49,9 +58,9 @@ public class MavenCliTest
{
System.getProperties().remove( MavenCli.MULTIMODULE_PROJECT_DIRECTORY );
}
- super.tearDown();
}
+ @Test
public void testCalculateDegreeOfConcurrencyWithCoreMultiplier()
{
int cores = Runtime.getRuntime().availableProcessors();
@@ -71,6 +80,7 @@ public class MavenCliTest
}
}
+ @Test
public void testMavenConfig()
throws Exception
{
@@ -90,6 +100,7 @@ public class MavenCliTest
assertEquals( "foobar", request.commandLine.getOptionValue( "builder" ) );
}
+ @Test
public void testMavenConfigInvalid()
throws Exception
{
@@ -120,6 +131,7 @@ public class MavenCliTest
*
* @throws Exception in case of failure.
*/
+ @Test
public void testMVNConfigurationThreadCanBeOverwrittenViaCommandLine()
throws Exception
{
@@ -145,6 +157,7 @@ public class MavenCliTest
*
* @throws Exception
*/
+ @Test
public void testMVNConfigurationDefinedPropertiesCanBeOverwrittenViaCommandLine()
throws Exception
{
@@ -172,6 +185,7 @@ public class MavenCliTest
*
* @throws Exception
*/
+ @Test
public void testMVNConfigurationCLIRepeatedPropertiesLastWins()
throws Exception
{
@@ -199,6 +213,7 @@ public class MavenCliTest
*
* @throws Exception
*/
+ @Test
public void testMVNConfigurationFunkyArguments()
throws Exception
{
@@ -221,4 +236,61 @@ public class MavenCliTest
assertEquals( "-Dpom.xml", request.getCommandLine().getOptionValue( CLIManager.ALTERNATE_POM_FILE ) );
}
+
+ @Test
+ public void testStyleColors()
+ throws Exception
+ {
+ assumeTrue( "ANSI not supported", MessageUtils.isColorEnabled() );
+ CliRequest request;
+
+ MessageUtils.setColorEnabled( true );
+ request = new CliRequest( new String[] { "-B" }, null );
+ cli.cli( request );
+ cli.properties( request );
+ cli.logging( request );
+ assertFalse( MessageUtils.isColorEnabled() );
+
+ MessageUtils.setColorEnabled( true );
+ request = new CliRequest( new String[] { "-l", "target/temp/mvn.log" }, null );
+ cli.cli( request );
+ cli.properties( request );
+ cli.logging( request );
+ assertFalse( MessageUtils.isColorEnabled() );
+
+ MessageUtils.setColorEnabled( false );
+ request = new CliRequest( new String[] { "-Dstyle.color=always" }, null );
+ cli.cli( request );
+ cli.properties( request );
+ cli.logging( request );
+ assertTrue( MessageUtils.isColorEnabled() );
+
+ MessageUtils.setColorEnabled( true );
+ request = new CliRequest( new String[] { "-Dstyle.color=never" }, null );
+ cli.cli( request );
+ cli.properties( request );
+ cli.logging( request );
+ assertFalse( MessageUtils.isColorEnabled() );
+
+ MessageUtils.setColorEnabled( false );
+ request = new CliRequest( new String[] { "-Dstyle.color=always", "-B", "-l", "target/temp/mvn.log" }, null );
+ cli.cli( request );
+ cli.properties( request );
+ cli.logging( request );
+ assertTrue( MessageUtils.isColorEnabled() );
+
+ try
+ {
+ MessageUtils.setColorEnabled( false );
+ request = new CliRequest( new String[] { "-Dstyle.color=maybe", "-B", "-l", "target/temp/mvn.log" }, null );
+ cli.cli( request );
+ cli.properties( request );
+ cli.logging( request );
+ fail( "maybe is not a valid option" );
+ }
+ catch ( IllegalArgumentException e )
+ {
+ // noop
+ }
+ }
}
[03/12] maven git commit: [MNG-6240] Duplicate components in plugin
extension realm when plugin depends on maven-aether-resolver
Posted by kh...@apache.org.
[MNG-6240] Duplicate components in plugin extension realm when plugin depends on maven-aether-resolver
Maven Core needs to export the maven-aether-provider artifact so that its components do not get added twice in plugin realm. This happens if the build uses an extension plugin depending on maven-aether-provider, before it was renamed to maven-resolver-provider
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/a1fe4219
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/a1fe4219
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/a1fe4219
Branch: refs/heads/MNG-6069
Commit: a1fe42199565f76007a97f47cd4a848fd9b63482
Parents: 12d6471
Author: Guillaume Boué <gb...@apache.org>
Authored: Fri Jun 9 23:25:31 2017 +0200
Committer: Guillaume Boué <gb...@apache.org>
Committed: Wed Jun 14 19:55:41 2017 +0200
----------------------------------------------------------------------
maven-core/src/main/resources/META-INF/maven/extension.xml | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/a1fe4219/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 1f0b95f..c5f40b5 100644
--- a/maven-core/src/main/resources/META-INF/maven/extension.xml
+++ b/maven-core/src/main/resources/META-INF/maven/extension.xml
@@ -134,6 +134,11 @@ under the License.
<exportedArtifact>org.sonatype.sisu:sisu-inject-plexus</exportedArtifact>
<exportedArtifact>org.eclipse.sisu:org.eclipse.sisu.plexus</exportedArtifact>
<exportedArtifact>org.apache.maven:maven-artifact</exportedArtifact>
+ <!--
+ | MNG-6240: Plugins might depend on maven-aether-provider <= 3.3.9 before the rename to maven-resolver-provider.
+ | Since backwards-compatibility was kept, Maven Core also provides this artifact.
+ -->
+ <exportedArtifact>org.apache.maven:maven-aether-provider</exportedArtifact>
<exportedArtifact>org.apache.maven:maven-resolver-provider</exportedArtifact>
<exportedArtifact>org.apache.maven:maven-artifact-manager</exportedArtifact>
<exportedArtifact>org.apache.maven:maven-compat</exportedArtifact>
[05/12] maven git commit: [MNG-5457] Show repository id when
downloading or uploading from/to a remote repository
Posted by kh...@apache.org.
[MNG-5457] Show repository id when downloading or uploading from/to a remote repository
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/b1002575
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/b1002575
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/b1002575
Branch: refs/heads/MNG-6069
Commit: b1002575177abd1108fe50f457cceb9c7c3cf7d8
Parents: e520324
Author: Michael Osipov <mi...@apache.org>
Authored: Fri Jul 15 23:26:56 2016 +0200
Committer: Michael Osipov <mi...@apache.org>
Committed: Wed Jul 12 20:10:47 2017 +0200
----------------------------------------------------------------------
.../transfer/AbstractMavenTransferListener.java | 31 +++++++++++++-------
.../transfer/Slf4jMavenTransferListener.java | 31 +++++++++++++-------
2 files changed, 42 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/b1002575/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java
index 21822be..2b13879 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java
@@ -217,9 +217,15 @@ public abstract class AbstractMavenTransferListener
public void transferInitiated( TransferEvent event )
{
String action = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
+ String direction = event.getRequestType() == TransferEvent.RequestType.PUT ? "to" : "from";
TransferResource resource = event.getResource();
- out.println( action + ": " + resource.getRepositoryUrl() + resource.getResourceName() );
+ StringBuilder message = new StringBuilder();
+ message.append( action ).append( ' ' ).append( direction ).append( ' ' ).append( resource.getRepositoryId() );
+ message.append( ": " );
+ message.append( resource.getRepositoryUrl() ).append( resource.getResourceName() );
+
+ out.println( message.toString() );
}
@Override
@@ -228,30 +234,35 @@ public abstract class AbstractMavenTransferListener
{
TransferResource resource = event.getResource();
// TODO This needs to be colorized
- out.println( "[WARNING] " + event.getException().getMessage() + " for " + resource.getRepositoryUrl()
- + resource.getResourceName() );
+ out.println( "[WARNING] " + event.getException().getMessage() + " from " + resource.getRepositoryId() + " for "
+ + resource.getRepositoryUrl() + resource.getResourceName() );
}
@Override
public void transferSucceeded( TransferEvent event )
{
+ String action = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
+ String direction = event.getRequestType() == TransferEvent.RequestType.PUT ? "to" : "from";
+
TransferResource resource = event.getResource();
long contentLength = event.getTransferredBytes();
-
FileSizeFormat format = new FileSizeFormat( Locale.ENGLISH );
- String result = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
- String len = format.format( contentLength );
- String throughput = "";
+ StringBuilder message = new StringBuilder();
+ message.append( action ).append( ' ' ).append( direction ).append( ' ' ).append( resource.getRepositoryId() );
+ message.append( ": " );
+ message.append( resource.getRepositoryUrl() ).append( resource.getResourceName() );
+ message.append( " (" ).append( format.format( contentLength ) );
+
long duration = System.currentTimeMillis() - resource.getTransferStartTime();
if ( duration > 0L )
{
double bytesPerSecond = contentLength / ( duration / 1000.0 );
- throughput = " at " + format.format( (long) bytesPerSecond ) + "/s";
+ message.append( " at " ).append( format.format( (long) bytesPerSecond ) ).append( "/s" );
}
- out.println( result + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
- + throughput + ")" );
+ message.append( ')' );
+ out.println( message.toString() );
}
}
http://git-wip-us.apache.org/repos/asf/maven/blob/b1002575/maven-embedder/src/main/java/org/apache/maven/cli/transfer/Slf4jMavenTransferListener.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/Slf4jMavenTransferListener.java b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/Slf4jMavenTransferListener.java
index ac5333e..5c97acb 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/Slf4jMavenTransferListener.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/Slf4jMavenTransferListener.java
@@ -50,9 +50,15 @@ public class Slf4jMavenTransferListener
public void transferInitiated( TransferEvent event )
{
String action = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
+ String direction = event.getRequestType() == TransferEvent.RequestType.PUT ? "to" : "from";
TransferResource resource = event.getResource();
- out.info( action + ": " + resource.getRepositoryUrl() + resource.getResourceName() );
+ StringBuilder message = new StringBuilder();
+ message.append( action ).append( ' ' ).append( direction ).append( ' ' ).append( resource.getRepositoryId() );
+ message.append( ": " );
+ message.append( resource.getRepositoryUrl() ).append( resource.getResourceName() );
+
+ out.info( message.toString() );
}
@Override
@@ -60,30 +66,35 @@ public class Slf4jMavenTransferListener
throws TransferCancelledException
{
TransferResource resource = event.getResource();
- out.warn( event.getException().getMessage() + " for " + resource.getRepositoryUrl()
- + resource.getResourceName() );
+ out.warn( event.getException().getMessage() + " from " + resource.getRepositoryId() + " for "
+ + resource.getRepositoryUrl() + resource.getResourceName() );
}
@Override
public void transferSucceeded( TransferEvent event )
{
+ String action = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
+ String direction = event.getRequestType() == TransferEvent.RequestType.PUT ? "to" : "from";
+
TransferResource resource = event.getResource();
long contentLength = event.getTransferredBytes();
-
FileSizeFormat format = new FileSizeFormat( Locale.ENGLISH );
- String result = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
- String len = format.format( contentLength );
- String throughput = "";
+ StringBuilder message = new StringBuilder();
+ message.append( action ).append( ' ' ).append( direction ).append( ' ' ).append( resource.getRepositoryId() );
+ message.append( ": " );
+ message.append( resource.getRepositoryUrl() ).append( resource.getResourceName() );
+ message.append( " (" ).append( format.format( contentLength ) );
+
long duration = System.currentTimeMillis() - resource.getTransferStartTime();
if ( duration > 0L )
{
double bytesPerSecond = contentLength / ( duration / 1000.0 );
- throughput = " at " + format.format( (long) bytesPerSecond ) + "/s";
+ message.append( " at " ).append( format.format( (long) bytesPerSecond ) ).append( "/s" );
}
- out.info( result + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
- + throughput + ")" );
+ message.append( ')' );
+ out.info( message.toString() );
}
}