diff --git a/data-discovery/mvn-build.sh b/data-discovery/mvn-build.sh index d8e39ed6d95f830a186b2d97eb7d3e128d8200c2..3aefd995baff849e90f45657a2f7e57e1114380a 100755 --- a/data-discovery/mvn-build.sh +++ b/data-discovery/mvn-build.sh @@ -1,4 +1,11 @@ +#!/bin/bash -JAVA_HOME=/usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc38.x86_64 mvn clean package +VERSION=$(git describe) +echo "class Version { static String asString = \"${VERSION}\";}" > src/main/java/webapi/Version.java +mvn package +#JAVA_HOME=/usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc38.x86_64 mvn package + +# java show class version: +# find . -name "*.class" -exec file -b {} \; | awk -F',' '{print $NF}' | sort -u diff --git a/data-discovery/pom.xml b/data-discovery/pom.xml index 453f4988e1e20c6b4bb695d4bad5fac445b3dd80..10056ad4d9b60eceef2f4800d2295b31c570ab6f 100644 --- a/data-discovery/pom.xml +++ b/data-discovery/pom.xml @@ -12,8 +12,8 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <!-- FIXME needs JAVA_HOME=/usr/java/jdk-17.0.4.1 (java17 manually installed and aletrnatives activated) --> - <maven.compiler.source>17</maven.compiler.source> - <maven.compiler.target>17</maven.compiler.target> + <maven.compiler.source>7</maven.compiler.source> + <maven.compiler.target>7</maven.compiler.target> </properties> @@ -40,7 +40,6 @@ <groupId>vo</groupId> <artifactId>vlkb-volib</artifactId> <version>0.9.1</version> - <!-- scope>provided</scope --> </dependency> <dependency> @@ -61,6 +60,7 @@ <artifactId>jackson-core</artifactId> <version>2.15.1</version> </dependency> + <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> @@ -74,6 +74,7 @@ <artifactId>slf4j-api</artifactId> <version>1.7.36</version> </dependency> + <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple --> <dependency> <groupId>org.slf4j</groupId> @@ -89,6 +90,7 @@ <version>1.4.7</version> <scope>test</scope> </dependency> + <!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-core --> <dependency> <groupId>ch.qos.logback</groupId> @@ -110,10 +112,11 @@ <scope>provided</scope> </dependency> + <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple --> <dependency> - <groupId>org.apache.clerezza.ext</groupId> - <artifactId>org.json.simple</artifactId> - <version>0.4</version> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + <version>1.1</version> </dependency> <!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api --> @@ -130,13 +133,6 @@ <version>0.11.5</version> </dependency> - <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql --> - <dependency> - <groupId>org.postgresql</groupId> - <artifactId>postgresql</artifactId> - <version>42.2.5</version> - </dependency> - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -147,8 +143,22 @@ </dependencies> <build> - <finalName>vlkb-siav2</finalName> + <finalName>${project.artifactId}-${git.buildnumber}</finalName> <plugins> + <plugin> + <groupId>ru.concerteza.buildnumber</groupId> + <artifactId>maven-jgit-buildnumber-plugin</artifactId> + <version>1.2.7</version> + <executions> + <execution> + <id>git-buildnumber</id> + <goals> + <goal>extract-buildnumber</goal> + </goals> + <phase>prepare-package</phase> + </execution> + </executions> + </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>3.3.2</version> @@ -157,6 +167,9 @@ <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> + <!-- verbose>true</verbose --> + <fork>true</fork> + <executable>/etc/alternatives/javac</executable> <compilerArgument>-Xlint:unchecked</compilerArgument> </configuration> </plugin>