fixed Java 8 build

This commit is contained in:
anhefti 2020-02-12 15:06:46 +01:00
parent 5249674be3
commit 8ea0def877
2 changed files with 359 additions and 351 deletions

706
pom.xml
View file

@ -1,352 +1,360 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>ch.ethz.seb</groupId> <groupId>ch.ethz.seb</groupId>
<artifactId>seb-server</artifactId> <artifactId>seb-server</artifactId>
<version>${sebserver-version}-SNAPSHOT</version> <version>${sebserver-version}-SNAPSHOT</version>
<name>seb-server</name> <name>seb-server</name>
<description>web-service for SEB maintenance and monitoring active SEB sessions</description> <description>web-service for SEB maintenance and monitoring active SEB sessions</description>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version> <version>2.1.0.RELEASE</version>
</parent> </parent>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<sebserver-version>0.5.4-beta</sebserver-version> <sebserver-version>0.5.4-beta</sebserver-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties> </properties>
<!-- NOTE: There currently are two profiles, a default one to build on <!-- NOTE: There currently are two profiles, a default one to build on
Java 11 (from eclipse and command-line) and one to build still on Java 8 Java 11 (from eclipse and command-line) and one to build still on Java 8
to support the Jenkins build on CI-Server that still no Java 11 installed --> to support the Jenkins build on CI-Server that still no Java 11 installed -->
<profiles> <profiles>
<profile> <profile>
<id>Java 11</id> <id>Java 11</id>
<activation> <activation>
<activeByDefault>true</activeByDefault> <activeByDefault>true</activeByDefault>
</activation> </activation>
<properties> <properties>
<java.version>11</java.version> <java.version>11</java.version>
</properties> </properties>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<release>${java.version}</release> <release>${java.version}</release>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.glassfish.jaxb</groupId> <groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId> <artifactId>jaxb-runtime</artifactId>
<version>2.4.0-b180830.0438</version><!--$NO-MVN-MAN-VER$ --> <!-- TODO move to stable version when available --> <version>2.4.0-b180830.0438</version><!--$NO-MVN-MAN-VER$ --> <!-- TODO move to stable version when available -->
</dependency> </dependency>
</dependencies> </dependencies>
</profile> </profile>
<profile> <profile>
<id>let_reporting</id> <id>let_reporting</id>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
</properties> </properties>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version> <version>2.19.1</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId> <artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version> <version>2.19.1</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId> <artifactId>maven-pmd-plugin</artifactId>
<version>3.10.0</version> <version>3.10.0</version>
<configuration> <configuration>
<skipEmptyReport>false</skipEmptyReport> <skipEmptyReport>false</skipEmptyReport>
<failOnViolation>false</failOnViolation> <failOnViolation>false</failOnViolation>
<targetJdk>${java.version}</targetJdk> <targetJdk>${java.version}</targetJdk>
<linkXRef>false</linkXRef> <linkXRef>false</linkXRef>
<rulesets> <rulesets>
<ruleset>pmd-rulesets.xml</ruleset> <ruleset>pmd-rulesets.xml</ruleset>
</rulesets> </rulesets>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<goals> <goals>
<goal>check</goal> <goal>check</goal>
<goal>cpd-check</goal> <goal>cpd-check</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId> <artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version> <version>3.0.4</version>
<configuration> <configuration>
<effort>Max</effort> <effort>Max</effort>
<failOnError>false</failOnError> <failOnError>false</failOnError>
<threshold>Low</threshold> <threshold>Low</threshold>
<xmlOutput>true</xmlOutput> <xmlOutput>true</xmlOutput>
<excludeFilterFile>findbugs-excludes.xml</excludeFilterFile> <excludeFilterFile>findbugs-excludes.xml</excludeFilterFile>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<id>analyze-compile</id> <id>analyze-compile</id>
<phase>compile</phase> <phase>compile</phase>
<goals> <goals>
<goal>check</goal> <goal>check</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.3</version> <version>0.8.3</version>
<executions> <executions>
<execution> <execution>
<id>prepare-agent</id> <id>prepare-agent</id>
<goals> <goals>
<goal>prepare-agent</goal> <goal>prepare-agent</goal>
</goals> </goals>
</execution> </execution>
<execution> <execution>
<id>report</id> <id>report</id>
<phase>prepare-package</phase> <phase>prepare-package</phase>
<goals> <goals>
<goal>report</goal> <goal>report</goal>
</goals> </goals>
<configuration> <configuration>
<excludes> <excludes>
<exclude>ch/ethz/seb/sebserver/gui/**/*</exclude> <exclude>ch/ethz/seb/sebserver/gui/**/*</exclude>
<exclude>ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/**/*</exclude> <exclude>ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/**/*</exclude>
<exclude>ch/ethz/seb/sebserver/webservice/datalayer/batis/model/**/*</exclude> <exclude>ch/ethz/seb/sebserver/webservice/datalayer/batis/model/**/*</exclude>
</excludes> </excludes>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
<configuration> <configuration>
<systemPropertyVariables> <systemPropertyVariables>
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile> <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables> </systemPropertyVariables>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</profile> </profile>
</profiles> </profiles>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<goals> <goals>
<goal>repackage</goal> <goal>repackage</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> <plugin>
</build> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<dependencies> <configuration>
<!-- Data Base --> <source>10</source>
<dependency> <target>10</target>
<groupId>org.mariadb.jdbc</groupId> </configuration>
<artifactId>mariadb-java-client</artifactId> </plugin>
</dependency> </plugins>
</build>
<!-- MyBatis -->
<dependency> <dependencies>
<groupId>org.mybatis</groupId> <!-- Data Base -->
<artifactId>mybatis</artifactId> <dependency>
<version>3.4.6</version> <groupId>org.mariadb.jdbc</groupId>
</dependency> <artifactId>mariadb-java-client</artifactId>
<dependency> </dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId> <!-- MyBatis -->
<version>1.1.0</version> <dependency>
</dependency> <groupId>org.mybatis</groupId>
<dependency> <artifactId>mybatis</artifactId>
<groupId>org.mybatis.spring.boot</groupId> <version>3.4.6</version>
<artifactId>mybatis-spring-boot-starter</artifactId> </dependency>
<version>1.3.2</version> <dependency>
</dependency> <groupId>org.mybatis.dynamic-sql</groupId>
<dependency> <artifactId>mybatis-dynamic-sql</artifactId>
<groupId>com.github.pagehelper</groupId> <version>1.1.0</version>
<artifactId>pagehelper-spring-boot-starter</artifactId> </dependency>
<version>1.2.10</version> <dependency>
</dependency> <groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<!-- Spring / Spring Boot --> <version>1.3.2</version>
<dependency> </dependency>
<groupId>org.springframework.boot</groupId> <dependency>
<artifactId>spring-boot-starter-web</artifactId> <groupId>com.github.pagehelper</groupId>
</dependency> <artifactId>pagehelper-spring-boot-starter</artifactId>
<dependency> <version>1.2.10</version>
<groupId>org.springframework.boot</groupId> </dependency>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency> <!-- Spring / Spring Boot -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId> <artifactId>spring-boot-starter-actuator</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId> <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId> <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>jackson-dataformat-xml</artifactId> <artifactId>spring-boot-starter-security</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId> <artifactId>spring-boot-starter-cache</artifactId>
<exclusions> </dependency>
<exclusion> <dependency>
<artifactId>spring-boot-starter-reactor-netty</artifactId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<groupId>org.springframework.boot</groupId> <artifactId>jackson-dataformat-xml</artifactId>
</exclusion> </dependency>
</exclusions> <dependency>
</dependency> <groupId>org.springframework.boot</groupId>
<!-- NOTE since org.springframework.security.oauth is not fully migrated <artifactId>spring-boot-starter-webflux</artifactId>
to spring-boot-starter-security we have to declare a separate version here. <exclusions>
This refers to the latest version of spring-security-oauth2 and should be <exclusion>
compatible with the overall version of spring boot SEE: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0.0-M5-Release-Notes#oauth-20-support <artifactId>spring-boot-starter-reactor-netty</artifactId>
TODO: once spring-security-oauth2 is fully migrated we should be able to <groupId>org.springframework.boot</groupId>
remove this dependency --> </exclusion>
<dependency> </exclusions>
<groupId>org.springframework.security.oauth</groupId> </dependency>
<artifactId>spring-security-oauth2</artifactId> <!-- NOTE since org.springframework.security.oauth is not fully migrated
<version>2.3.6.RELEASE</version> to spring-boot-starter-security we have to declare a separate version here.
</dependency> This refers to the latest version of spring-security-oauth2 and should be
<dependency> compatible with the overall version of spring boot SEE: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0.0-M5-Release-Notes#oauth-20-support
<groupId>org.springframework.security</groupId> TODO: once spring-security-oauth2 is fully migrated we should be able to
<artifactId>spring-security-jwt</artifactId> remove this dependency -->
<version>1.0.9.RELEASE</version> <dependency>
</dependency> <groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<!-- JMX --> <version>2.3.6.RELEASE</version>
<!-- <dependency> --> </dependency>
<!-- <groupId>org.jolokia</groupId> --> <dependency>
<!-- <artifactId>jolokia-core</artifactId> --> <groupId>org.springframework.security</groupId>
<!-- </dependency> --> <artifactId>spring-security-jwt</artifactId>
<version>1.0.9.RELEASE</version>
<!-- Apache HTTP --> </dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId> <!-- JMX -->
<artifactId>httpclient</artifactId> <!-- <dependency> -->
</dependency> <!-- <groupId>org.jolokia</groupId> -->
<!-- <artifactId>jolokia-core</artifactId> -->
<!-- Eclipse RAP / RWT --> <!-- </dependency> -->
<dependency>
<groupId>org.eclipse.rap</groupId> <!-- Apache HTTP -->
<artifactId>org.eclipse.rap.rwt</artifactId> <dependency>
<version>3.5.0</version> <groupId>org.apache.httpcomponents</groupId>
</dependency> <artifactId>httpclient</artifactId>
<dependency> </dependency>
<groupId>org.eclipse.rap</groupId>
<artifactId>org.eclipse.rap.fileupload</artifactId> <!-- Eclipse RAP / RWT -->
<version>3.7.0</version> <dependency>
</dependency> <groupId>org.eclipse.rap</groupId>
<artifactId>org.eclipse.rap.rwt</artifactId>
<!-- Misc --> <version>3.5.0</version>
<dependency> </dependency>
<groupId>joda-time</groupId> <dependency>
<artifactId>joda-time</artifactId> <groupId>org.eclipse.rap</groupId>
</dependency> <artifactId>org.eclipse.rap.fileupload</artifactId>
<dependency> <version>3.7.0</version>
<groupId>com.fasterxml.jackson.datatype</groupId> </dependency>
<artifactId>jackson-datatype-joda</artifactId>
</dependency> <!-- Misc -->
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>joda-time</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>joda-time</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.cryptonode.jncryptor</groupId> <groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jncryptor</artifactId> <artifactId>jackson-datatype-joda</artifactId>
<version>1.2.0</version> </dependency>
</dependency> <dependency>
<dependency> <groupId>org.apache.commons</groupId>
<groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId>
<artifactId>commons-text</artifactId> </dependency>
<version>1.8</version> <dependency>
</dependency> <groupId>org.cryptonode.jncryptor</groupId>
<artifactId>jncryptor</artifactId>
<version>1.2.0</version>
<!-- Testing --> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>org.apache.commons</groupId>
<artifactId>junit</artifactId> <artifactId>commons-text</artifactId>
<scope>test</scope> <version>1.8</version>
</dependency> </dependency>
<!-- <dependency> -->
<!-- <groupId>org.junit.jupiter</groupId> -->
<!-- <artifactId>junit-jupiter-api</artifactId> --> <!-- Testing -->
<!-- <scope>test</scope> --> <dependency>
<!-- </dependency> --> <groupId>junit</groupId>
<artifactId>junit</artifactId>
<!-- <dependency> --> <scope>test</scope>
<!-- <groupId>org.junit.vintage</groupId> --> </dependency>
<!-- <artifactId>junit-vintage-engine</artifactId> --> <!-- <dependency> -->
<!-- <scope>test</scope> --> <!-- <groupId>org.junit.jupiter</groupId> -->
<!-- </dependency> --> <!-- <artifactId>junit-jupiter-api</artifactId> -->
<dependency> <!-- <scope>test</scope> -->
<groupId>org.springframework.boot</groupId> <!-- </dependency> -->
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <!-- <dependency> -->
</dependency> <!-- <groupId>org.junit.vintage</groupId> -->
<dependency> <!-- <artifactId>junit-vintage-engine</artifactId> -->
<groupId>org.springframework.security</groupId> <!-- <scope>test</scope> -->
<artifactId>spring-security-test</artifactId> <!-- </dependency> -->
<scope>test</scope> <dependency>
</dependency> <groupId>org.springframework.boot</groupId>
<dependency> <artifactId>spring-boot-starter-test</artifactId>
<groupId>com.h2database</groupId> <scope>test</scope>
<artifactId>h2</artifactId> </dependency>
<scope>test</scope> <dependency>
</dependency> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
</dependencies> <scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project> </project>

View file

@ -169,9 +169,9 @@ public final class Utils {
} }
public static <T extends Enum<T>> Collection<Tuple<String>> createSelectionResource(final Class<T> enumClass) { public static <T extends Enum<T>> Collection<Tuple<String>> createSelectionResource(final Class<T> enumClass) {
return Arrays.stream(enumClass.getEnumConstants()) return Collections.unmodifiableList(Arrays.stream(enumClass.getEnumConstants())
.map(e -> new Tuple<>(e.name(), e.name())) .map(e -> new Tuple<>(e.name(), e.name()))
.collect(Collectors.toUnmodifiableList()); .collect(Collectors.toList()));
} }
public static Collection<String> getListOfLines(final String list) { public static Collection<String> getListOfLines(final String list) {