maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schu...@apache.org
Subject [09/30] maven git commit: [MNG-6102] Introduce ${maven.conf} in m2.conf
Date Wed, 25 Jan 2017 21:19:41 GMT
[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/be5cacca
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/be5cacca
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/be5cacca

Branch: refs/heads/MNG-2199-IT
Commit: be5caccaff3d00ffca4b3cefe9665b6106bc44bf
Parents: 149cce7
Author: Michael Osipov <michaelo@apache.org>
Authored: Sun Oct 9 21:00:42 2016 +0200
Committer: Michael Osipov <michaelo@apache.org>
Committed: Mon Jan 23 20:54:54 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/maven/blob/be5cacca/apache-maven/src/bin/m2.conf
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/m2.conf b/apache-maven/src/bin/m2.conf
index 346554c..2235f82 100644
--- a/apache-maven/src/bin/m2.conf
+++ b/apache-maven/src/bin/m2.conf
@@ -1,6 +1,8 @@
 main is org.apache.maven.cli.MavenCli from plexus.core
 
+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/be5cacca/apache-maven/src/conf/settings.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/conf/settings.xml b/apache-maven/src/conf/settings.xml
index 19d7a97..e27c579 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/be5cacca/apache-maven/src/conf/toolchains.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/conf/toolchains.xml b/apache-maven/src/conf/toolchains.xml
index aefddd8..b737c17 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/be5cacca/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..207b9aa 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.conf",
                      MavenSettingsBuilder.ALT_GLOBAL_SETTINGS_XML_LOCATION );
 
         SettingsBuildingRequest request = new DefaultSettingsBuildingRequest();

http://git-wip-us.apache.org/repos/asf/maven/blob/be5cacca/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 2b9f099..9da7c4d 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
@@ -142,7 +142,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";
 

http://git-wip-us.apache.org/repos/asf/maven/blob/be5cacca/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 791a226..d9a6954 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
@@ -59,8 +59,8 @@ 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" );
+    public static final File DEFAULT_GLOBAL_SETTINGS_FILE =
+        new File( System.getProperty( "maven.conf" ), "settings.xml" );
 
     @Requirement
     private Logger logger;

http://git-wip-us.apache.org/repos/asf/maven/blob/be5cacca/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 cc9257d..d1eb53a 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