Skip to content

Commit

Permalink
Fix for DS-1198 on latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
tdonohue committed Oct 5, 2012
1 parent 4f253a0 commit eeaa406
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions dspace-api/pom.xml
Expand Up @@ -73,25 +73,57 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- This plugin allows us to run a Groovy script in our Maven POM
(see: http://gmaven.codehaus.org/Executing+Groovy+Code )
We are generating a OS-agnostic version (agnostic.build.dir) of
the ${project.build.directory} property (full path of target dir).
This is necessary so that the FileWeaver & Surefire plugins can
use it to initialize the Unit Test Framework's dspace.cfg file.
Otherwise, the Unit Test Framework will not work on Windows OS.
This Groovy code was mostly borrowed from:
http://stackoverflow.com/questions/3872355/how-to-convert-file-separator-in-maven
-->
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>setproperty</id>
<phase>generate-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
pom.properties['agnostic.build.dir']=project.build.directory.replace('\\','/');
println("Initializing Maven property 'agnostic.build.dir' to: " + project.properties['agnostic.build.dir']);
</source>
</configuration>
</execution>
</executions>
</plugin>
<!-- FileWeaver plugin is in charge of initializing & "weaving" together
the dspace.cfg file to be used by the Unit Testing framework -->
<plugin> <plugin>
<groupId>edu.iu.ul.maven.plugins</groupId> <groupId>edu.iu.ul.maven.plugins</groupId>
<artifactId>fileweaver</artifactId> <artifactId>fileweaver</artifactId>
<version>1.0</version> <version>1.0</version>
<configuration> <configuration>
<outputs> <outputs>
<output> <output>
<outputPath>${project.build.directory}/testing</outputPath> <outputPath>${agnostic.build.dir}/testing</outputPath>
<name>dspace.cfg.woven</name> <name>dspace.cfg.woven</name>
<parts> <parts>
<part> <part>
<path>${project.build.directory}/testing/dspace/config/dspace.cfg</path> <path>${agnostic.build.dir}/testing/dspace/config/dspace.cfg</path>
</part> </part>
<part> <part>
<path>${project.build.directory}/testing/dspace.cfg.more</path> <path>${agnostic.build.dir}/testing/dspace.cfg.more</path>
</part> </part>
</parts> </parts>
<properties> <properties>
<dspace.dir>${project.build.directory}/testing/dspace</dspace.dir> <dspace.dir>${agnostic.build.dir}/testing/dspace</dspace.dir>
</properties> </properties>
</output> </output>
</outputs> </outputs>
Expand All @@ -118,7 +150,7 @@
<phase>process-test-resources</phase> <phase>process-test-resources</phase>
<configuration> <configuration>
<tasks> <tasks>
<copy file="${project.build.directory}/testing/dspace.cfg.woven" tofile="${project.build.directory}/testing/dspace/config/dspace.cfg"/> <copy file="${agnostic.build.dir}/testing/dspace.cfg.woven" tofile="${agnostic.build.dir}/testing/dspace/config/dspace.cfg"/>
</tasks> </tasks>
</configuration> </configuration>
<goals> <goals>
Expand All @@ -132,10 +164,10 @@
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<configuration> <configuration>
<systemPropertyVariables> <systemPropertyVariables>
<dspace.dir>${project.build.directory}/testing/dspace</dspace.dir> <dspace.dir>${agnostic.build.dir}/testing/dspace</dspace.dir>
<dspace.dir.static>${basedir}/src/test/data/dspaceFolder</dspace.dir.static> <dspace.dir.static>${basedir}/src/test/data/dspaceFolder</dspace.dir.static>
<dspace.configuration>${project.build.directory}/testing/dspace/config/dspace.cfg</dspace.configuration> <dspace.configuration>${agnostic.build.dir}/testing/dspace/config/dspace.cfg</dspace.configuration>
<db.schema.path>${project.build.directory}/testing/dspace/etc/h2/database_schema.sql</db.schema.path> <db.schema.path>${agnostic.build.dir}/testing/dspace/etc/h2/database_schema.sql</db.schema.path>
<dspace.log.init.disable>true</dspace.log.init.disable> <dspace.log.init.disable>true</dspace.log.init.disable>
</systemPropertyVariables> </systemPropertyVariables>
</configuration> </configuration>
Expand Down

0 comments on commit eeaa406

Please sign in to comment.