Skip to content
Snippets Groups Projects
Commit 9704dee0 authored by Robert Butora's avatar Robert Butora
Browse files

mvn build: tagets java version to 1.7, runs on /etc/alternatives/javac, uses git-version

parent 8c13b1f8
No related branches found
No related tags found
No related merge requests found
#!/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
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment