mirror of https://github.com/apache/maven.git
have system properties override maven.properties
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162972 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
03d569dcef
commit
5e7a365a6f
|
@ -3,6 +3,8 @@
|
|||
# Check to make sure JAVA_HOME is set
|
||||
[ -z $JAVA_HOME ] && echo && echo 'You must set $JAVA_HOME to use mboot!' && echo && exit 1
|
||||
|
||||
ARGS="$@"
|
||||
|
||||
# Build and install mboot
|
||||
(
|
||||
echo "-----------------------------------------------------------------------"
|
||||
|
@ -20,7 +22,7 @@ ret=$?; if [ $ret != 0 ]; then exit $ret; fi
|
|||
echo " Building maven2 components ... "
|
||||
echo "-----------------------------------------------------------------------"
|
||||
|
||||
$JAVA_HOME/bin/java -jar mboot.jar
|
||||
$JAVA_HOME/bin/java $ARGS -jar mboot.jar
|
||||
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
|
||||
)
|
||||
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
|
||||
|
@ -30,7 +32,7 @@ ret=$?; if [ $ret != 0 ]; then exit $ret; fi
|
|||
echo
|
||||
echo "Running maven-core integration tests ..."
|
||||
echo
|
||||
./maven-core-it.sh
|
||||
./maven-core-it.sh $ARGS
|
||||
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
|
||||
)
|
||||
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
|
||||
|
|
|
@ -160,10 +160,15 @@ public class MBoot
|
|||
|
||||
properties = loadProperties( mavenPropertiesFile );
|
||||
|
||||
// Make the system properties override maven.properties
|
||||
properties.putAll( System.getProperties() );
|
||||
|
||||
for ( Iterator i = properties.keySet().iterator(); i.hasNext(); )
|
||||
{
|
||||
String key = (String) i.next();
|
||||
|
||||
// TODO: the namespace should be "properties" itself to support variables within the same file,
|
||||
// however, StringUtils would need to support recursive replacement
|
||||
properties.setProperty( key, StringUtils.interpolate( properties.getProperty( key ), System.getProperties() ) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue