aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-frontend-resources/pom.xml
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2017-11-21 12:14:09 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2017-11-21 12:14:09 +0100
commitb1940fc000b40808a7d173125d5552e9e0424024 (patch)
treeab96581fd3522525e8d30647de875d8f7834790b /id/server/moa-id-frontend-resources/pom.xml
parent27b687ed27fad429e6fbf1b3e69c579a8f2aae16 (diff)
parent1b5e11112af6bbe48bfb5c95c8b75ae90f3edb22 (diff)
downloadmoa-id-spss-b1940fc000b40808a7d173125d5552e9e0424024.tar.gz
moa-id-spss-b1940fc000b40808a7d173125d5552e9e0424024.tar.bz2
moa-id-spss-b1940fc000b40808a7d173125d5552e9e0424024.zip
Merge branch 'eIDAS_node_implementation' of https://gitlab.iaik.tugraz.at/egiz/moa-idspss into eIDAS_node_implementation
Diffstat (limited to 'id/server/moa-id-frontend-resources/pom.xml')
-rw-r--r--id/server/moa-id-frontend-resources/pom.xml72
1 files changed, 72 insertions, 0 deletions
diff --git a/id/server/moa-id-frontend-resources/pom.xml b/id/server/moa-id-frontend-resources/pom.xml
index 64ebc14b6..342cedac8 100644
--- a/id/server/moa-id-frontend-resources/pom.xml
+++ b/id/server/moa-id-frontend-resources/pom.xml
@@ -29,6 +29,78 @@
<repositoryPath>${basedir}/../../../../repository</repositoryPath>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ <![CDATA[
+ println("==== Creating version.txt ====");
+ File mainDir = new File("${basedir}/src/main/resources");
+ if(mainDir.exists() && !mainDir.isDirectory()) {
+ println("Main dir does not exist, wont create version.txt!");
+ return;
+ }
+ File confDir = new File("${basedir}/src/main/resources/mainGUI");
+ if(confDir.exists() && !confDir.isDirectory()) {
+ println("Conf dir is not a directory, wont create version.txt!");
+ return;
+ }
+ if(!confDir.exists()) {
+ confDir.mkdir();
+ }
+ File versionFile = new File("${basedir}/src/main/resources/mainGUI/version.txt");
+ if(versionFile.exists() && versionFile.isDirectory()) {
+ println("Version file exists and is directory! Wont overwrite");
+ return;
+ }
+ if(versionFile.exists() && !versionFile.isDirectory()) {
+ println("Version file already exists, overwriting!");
+ }
+ println("Creating Version File");
+ BufferedWriter writer = new BufferedWriter(new FileWriter(versionFile));
+
+ writer.write("groupId = ${project.groupId}");
+ writer.newLine();
+ writer.write("version = ${project.version}");
+ writer.newLine();
+ writer.write("timestamp = ${maven.build.timestamp}");
+
+ String buildTag = "";
+ String buildNumber = "";
+ String buildId = "";
+ try {
+ buildTag = "${BUILD_TAG}";
+ buildNumber = "${BUILD_NUMBER}";
+ buildId = "${BUILD_ID}";
+
+ writer.write("BUILD_TAG = " + buildTag + "\n");
+ writer.write("BUILD_NUMBER = " + buildNumber + "\n");
+ writer.write("BUILD_ID = " + buildId + "\n");
+
+ } catch (Exception e) {
+ println("============= Could not find BUILD_TAG probably this is not a Jenkins/Hudson build ===========");
+ }
+
+ writer.close();
+ ]]>
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<dependency>
<groupId>MOA.id.server</groupId>