Add in the "-Denv" flag to allow users to specify a *.properties build file which is not in source control.

This provides developers with an option to create their own *.properties file instead of using build.properties.
This commit is contained in:
Tim Donohue
2012-11-01 16:13:01 -05:00
parent 3cf7c59780
commit ba8e87d399
2 changed files with 43 additions and 4 deletions

4
.gitignore vendored
View File

@@ -21,3 +21,7 @@ nbdist/
nbactions.xml nbactions.xml
nb-configuration.xml nb-configuration.xml
META-INF/ META-INF/
## Ignore all *.properties file, EXCEPT build.properties (the default)
*.properties
!build.properties

39
pom.xml
View File

@@ -23,7 +23,6 @@
<!--Force UTF-8 encoding during build on all platforms--> <!--Force UTF-8 encoding during build on all platforms-->
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<filters.file>build.properties</filters.file>
<lucene.version>3.5.0</lucene.version> <lucene.version>3.5.0</lucene.version>
</properties> </properties>
@@ -173,6 +172,38 @@
<profiles> <profiles>
<!-- By default the main dspace.cfg file will be filtered during the build
using the "build.properties" file. This profile takes effect, unless
"-Denv" is passed in (see 'environment' profile below for more info). -->
<profile>
<id>default</id>
<activation>
<property>
<name>!env</name>
</property>
</activation>
<properties>
<filters.file>build.properties</filters.file>
</properties>
</profile>
<!-- Users can pass in an environment flag "-Denv" to tell DSpace to use
a different properties file during its build process.
For example: "mvn package -Denv=test" would build DSpace using the
settings in "test.properties" instead of those in "build.properties" -->
<profile>
<id>environment</id>
<activation>
<property>
<name>env</name>
</property>
</activation>
<properties>
<filters.file>${env}.properties</filters.file>
</properties>
</profile>
<!-- This profile ensures that we ONLY generate the Unit Test Environment <!-- This profile ensures that we ONLY generate the Unit Test Environment
if the testEnvironment.xml file is found. That way the Test Environment if the testEnvironment.xml file is found. That way the Test Environment
is NOT built when running a 'mvn package' on a "binary" release. --> is NOT built when running a 'mvn package' on a "binary" release. -->
@@ -383,7 +414,11 @@
<profile> <profile>
<id>skiptests</id> <id>skiptests</id>
<activation> <activation>
<activeByDefault>true</activeByDefault> <!-- This profile should be active at all times, unless the user
specifies a different value for "maven.test.skip" -->
<property>
<name>!maven.test.skip</name>
</property>
</activation> </activation>
<properties> <properties>
<maven.test.skip>true</maven.test.skip> <maven.test.skip>true</maven.test.skip>