maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject maven git commit: [MNG-6102] Introduce ${maven.conf} in m2.conf
Date Sun, 09 Oct 2016 19:05:10 GMT
Repository: maven
Updated Branches:
  refs/heads/master 49cf5d8fb -> 4ad0fb217


[MNG-6102] Introduce ${maven.conf} in m2.conf

Set maven.conf to default ${maven.home}/conf in ${maven.home}/bin/m2.conf
to have a canonical property pointing to global configuration files from
within Java code.

This also helps package maintainers to decouple the Maven installation
from a global configuration by solely modifying m2.conf instead of using
dirty hacks, if possible at all.


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

Branch: refs/heads/master
Commit: 4ad0fb217c93d36cf3365b83baec48470196f5fa
Parents: 49cf5d8
Author: Michael Osipov <michaelo@apache.org>
Authored: Sun Oct 9 21:00:42 2016 +0200
Committer: Michael Osipov <michaelo@apache.org>
Committed: Sun Oct 9 21:00:42 2016 +0200

----------------------------------------------------------------------
 apache-maven/src/bin/m2.conf                                 | 3 ++-
 apache-maven/src/conf/settings.xml                           | 2 +-
 apache-maven/src/conf/toolchains.xml                         | 2 +-
 .../apache/maven/settings/DefaultMavenSettingsBuilder.java   | 2 +-
 .../src/main/java/org/apache/maven/cli/MavenCli.java         | 8 ++++----
 .../cli/configuration/SettingsXmlConfigurationProcessor.java | 2 +-
 maven-embedder/src/site/apt/logging.apt                      | 2 +-
 7 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/4ad0fb21/apache-maven/src/bin/m2.conf
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/m2.conf b/apache-maven/src/bin/m2.conf
index 213dc55..5eaa760 100644
--- a/apache-maven/src/bin/m2.conf
+++ b/apache-maven/src/bin/m2.conf
@@ -1,8 +1,9 @@
 main is org.apache.maven.cli.MavenCli from plexus.core
 
 set maven.home default ${user.home}/m2
+set maven.conf default ${maven.home}/conf
 
 [plexus.core]
-load       ${maven.home}/conf/logging
+load       ${maven.conf}/logging
 optionally ${maven.home}/lib/ext/*.jar
 load       ${maven.home}/lib/*.jar

http://git-wip-us.apache.org/repos/asf/maven/blob/4ad0fb21/apache-maven/src/conf/settings.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/conf/settings.xml b/apache-maven/src/conf/settings.xml
index 3fa2f14..c24acfd 100644
--- a/apache-maven/src/conf/settings.xml
+++ b/apache-maven/src/conf/settings.xml
@@ -32,7 +32,7 @@ under the License.
  |  2. Global Level. This settings.xml file provides configuration for all Maven
  |                 users on a machine (assuming they're all using the same Maven
  |                 installation). It's normally provided in
- |                 ${maven.home}/conf/settings.xml.
+ |                 ${maven.conf}/settings.xml.
  |
  |                 NOTE: This location can be overridden with the CLI option:
  |

http://git-wip-us.apache.org/repos/asf/maven/blob/4ad0fb21/apache-maven/src/conf/toolchains.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/conf/toolchains.xml b/apache-maven/src/conf/toolchains.xml
index 14ef3fe..b263072 100644
--- a/apache-maven/src/conf/toolchains.xml
+++ b/apache-maven/src/conf/toolchains.xml
@@ -32,7 +32,7 @@ under the License.
  |  2. Global Level. This toolchains.xml file provides configuration for all Maven
  |                 users on a machine (assuming they're all using the same Maven
  |                 installation). It's normally provided in
- |                 ${maven.home}/conf/toolchains.xml.
+ |                 ${maven.conf}/toolchains.xml.
  |
  |                 NOTE: This location can be overridden with the CLI option:
  |

http://git-wip-us.apache.org/repos/asf/maven/blob/4ad0fb21/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
b/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
index 820d886..ec499ca 100644
--- a/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
@@ -66,7 +66,7 @@ public class DefaultMavenSettingsBuilder
         throws IOException, XmlPullParserException
     {
         File globalSettingsFile =
-            getFile( "${maven.home}/conf/settings.xml", "maven.home",
+            getFile( "${maven.conf}/settings.xml", "maven.home",
                      MavenSettingsBuilder.ALT_GLOBAL_SETTINGS_XML_LOCATION );
 
         SettingsBuildingRequest request = new DefaultSettingsBuildingRequest();

http://git-wip-us.apache.org/repos/asf/maven/blob/4ad0fb21/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 822f696..9bbf2b5 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
@@ -156,7 +156,7 @@ public class MavenCli
     public static final File DEFAULT_USER_TOOLCHAINS_FILE = new File( userMavenConfigurationHome,
"toolchains.xml" );
 
     public static final File DEFAULT_GLOBAL_TOOLCHAINS_FILE =
-        new File( System.getProperty( "maven.home", System.getProperty( "user.dir", "" )
), "conf/toolchains.xml" );
+        new File( System.getProperty( "maven.conf" ), "toolchains.xml" );
 
     private static final String EXT_CLASS_PATH = "maven.ext.class.path";
 
@@ -1671,14 +1671,14 @@ public class MavenCli
         if ( commandLine.hasOption( CLIManager.SET_SYSTEM_PROPERTY ) )
         {
             String[] defStrs = commandLine.getOptionValues( CLIManager.SET_SYSTEM_PROPERTY
);
-            
+
             if ( defStrs != null )
             {
                 //The following is needed to get precedence
                 //of properties which are defined on command line
-                //over properties defined in the .mvn/maven.config. 
+                //over properties defined in the .mvn/maven.config.
                 ArrayUtils.reverse( defStrs );
-                
+
                 for ( String defStr : defStrs )
                 {
                     setCliProperty( defStr, userProperties );

http://git-wip-us.apache.org/repos/asf/maven/blob/4ad0fb21/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
b/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
index 7ba2194..1008d4e 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
@@ -56,7 +56,7 @@ public class SettingsXmlConfigurationProcessor
     public static final File DEFAULT_USER_SETTINGS_FILE = new File( USER_MAVEN_CONFIGURATION_HOME,
"settings.xml" );
 
     public static final File DEFAULT_GLOBAL_SETTINGS_FILE =
-        new File( System.getProperty( "maven.home", System.getProperty( "user.dir", "" )
), "conf/settings.xml" );
+        new File( System.getProperty( "maven.conf" ), "settings.xml" );
 
     @Requirement
     private Logger logger;

http://git-wip-us.apache.org/repos/asf/maven/blob/4ad0fb21/maven-embedder/src/site/apt/logging.apt
----------------------------------------------------------------------
diff --git a/maven-embedder/src/site/apt/logging.apt b/maven-embedder/src/site/apt/logging.apt
index 340580a..800857c 100644
--- a/maven-embedder/src/site/apt/logging.apt
+++ b/maven-embedder/src/site/apt/logging.apt
@@ -54,7 +54,7 @@ Maven Logging
 
  Logging configuration loading is actually done by logging implementation, without any Maven
extensions to support merging
  Maven installation configuration with per-user configuration for example:
- <<<$\{maven.home}/conf/logging>>> directory was added to core's classpath
(see <<<$\{maven.home}/bin/m2.conf>>>). See your implementation
+ <<<$\{maven.conf}/logging>>> directory was added to core's classpath (see
<<<$\{maven.home}/bin/m2.conf>>>). See your implementation
  documentation for details on file names, formats, and so on.
 
  During Maven initialization, Maven tweaks default root logging level to match CLI verbosity
choice. Since such feature isn't available


Mime
View raw message