You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Henning P. Schmiedehausen" <hp...@intermeta.de> on 2002/12/27 19:56:12 UTC

[PATCH] Sitewide Installation Properties

This patch allows maven to read a ${maven.home}/build.properties file
before the user properties file (usually in
${user.home}/build.properties}). This is useful for a shared
installation where you want to set user defaults.

diff -urb test/jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java
--- test/jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java	Wed Dec 18 18:13:37 2002
+++ jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java	Fri Dec 27 18:44:07 2002
@@ -642,6 +642,13 @@
         // System properties
         Properties systemProperties = System.getProperties();
 
+        // Installation build properties
+        File installationBuildPropertiesFile =
+            new File( System.getProperty( "maven.home" ), "build.properties" );
+
+        logger.debug( "Using installationBuildPropertiesFile: " + installationBuildPropertiesFile.getAbsolutePath() );
+        Properties installationBuildProperties = loadProperties( installationBuildPropertiesFile );
+
         // User build properties
         File userBuildPropertiesFile =
             new File( System.getProperty( "user.home" ), "build.properties" );
@@ -671,6 +678,7 @@
         Map result = MavenUtils.mergeMaps( new Map[]
         {
             systemProperties,
+            installationBuildProperties,
             userBuildProperties,
             projectBuildProperties,
             projectProperties,

	Regards
		Henning



-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

Re: [PATCH] Sitewide Installation Properties

Posted by Jason van Zyl <ja...@zenplex.com>.
On Fri, 2002-12-27 at 13:56, Henning P. Schmiedehausen wrote:
> This patch allows maven to read a ${maven.home}/build.properties file
> before the user properties file (usually in
> ${user.home}/build.properties}). This is useful for a shared
> installation where you want to set user defaults.

I think James and Craig had a solution for this as well which was a
little simpler. I'll take a peek tomorrow. In any event a site wide use
case is definitely something that needs to be satisfied.

-- 
jvz.

Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society