Permalink
Browse files

Merge pull request #123 from tdonohue/DS-1208

DS-1208 "Fix" to add in a "-Denv" flag to allow users to specify a different *.properties file
  • Loading branch information...
2 parents 3cf7c59 + ba8e87d commit 609eea4e3cde3bbccb0d8d5a434f21656b79b91a @tdonohue tdonohue committed Nov 2, 2012
Showing with 43 additions and 4 deletions.
  1. +4 −0 .gitignore
  2. +39 −4 pom.xml
View
@@ -21,3 +21,7 @@ nbdist/
nbactions.xml
nb-configuration.xml
META-INF/
+
+## Ignore all *.properties file, EXCEPT build.properties (the default)
+*.properties
+!build.properties
View
43 pom.xml
@@ -23,7 +23,6 @@
<!--Force UTF-8 encoding during build on all platforms-->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <filters.file>build.properties</filters.file>
<lucene.version>3.5.0</lucene.version>
</properties>
@@ -173,6 +172,38 @@
<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
if the testEnvironment.xml file is found. That way the Test Environment
is NOT built when running a 'mvn package' on a "binary" release. -->
@@ -383,10 +414,14 @@
<profile>
<id>skiptests</id>
<activation>
- <activeByDefault>true</activeByDefault>
- </activation>
+ <!-- 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>
<properties>
- <maven.test.skip>true</maven.test.skip>
+ <maven.test.skip>true</maven.test.skip>
</properties>
</profile>
</profiles>

0 comments on commit 609eea4

Please sign in to comment.