Commit 66023f53 authored by Antoine Mottier's avatar Antoine Mottier
Browse files

Various build improvements

- Remove commented dependency.
- Extract plugins and libraries version in Maven property.
- Remove `source` and `target` in `maven-compiler-plugin` replaced by `maven.compiler.release` when running JDK 9 or higher.
- Add `versions-maven-plugin` configuration to specify a file (`rules.xml`) to ignore alpha, beta, RC and CR versions from available dependencies and plugins updates analysis.
- Run `versions-maven-plugin` `display-property-updates` goal on `validate` phase.
parent 2d7bf4e9
Pipeline #10827 failed with stages
in 25 seconds
......@@ -40,13 +40,6 @@
<groupId>com.gibello</groupId>
<artifactId>icar-json</artifactId>
</dependency>
<!--dependency>
<groupId>com.willc.sonarqube</groupId>
<artifactId>sonarqube-api-client</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency-->
</dependencies>
<build>
......
......@@ -19,46 +19,70 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<!-- Dependencies version -->
<!-- To check that dependencies are up to date (will only consider dependencies with version specified as property):
mvn versions:display-property-updates
-->
<!-- Jetty target version (Debian package) is 9.4
So we need to use Java EE 7 features and Servlet version 3.1 -->
<servlet.version>3.1.0</servlet.version>
<maria.db.jdbc.driver.version>2.7.1</maria.db.jdbc.driver.version>
<junit.version>5.7.0</junit.version>
<icar.json.version>1.0.0</icar.json.version>
<slf4j.version>1.7.30</slf4j.version>
<logback.classic.version>1.2.3</logback.classic.version>
<!-- Maven plugins version -->
<plugin.maven.clean.version>3.1.0</plugin.maven.clean.version>
<plugin.maven.compiler.version>3.8.1</plugin.maven.compiler.version>
<plugin.maven.install.version>3.0.0-M1</plugin.maven.install.version>
<plugin.maven.jar.version>3.2.0</plugin.maven.jar.version>
<plugin.maven.war.version>3.3.1</plugin.maven.war.version>
<plugin.maven.dependency.version>3.1.2</plugin.maven.dependency.version>
<plugin.maven.resources.version>3.2.0</plugin.maven.resources.version>
<plugin.maven.surefire.version>3.0.0-M5</plugin.maven.surefire.version>
<plugin.maven.failsafe.version>3.0.0-M5</plugin.maven.failsafe.version>
<plugin.jetty.version>9.4.31.v20200723</plugin.jetty.version>
<plugin.maven.enforcer.version>3.0.0-M3</plugin.maven.enforcer.version>
<plugin.versions.version>2.8.1</plugin.versions.version>
<plugin.maven.site.version>3.9.1</plugin.maven.site.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Jetty target version (Debian package) is 9.4
So we need to use Java EE 7 features and Servlet version 3.1 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<version>${servlet.version}</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.7.0</version>
<version>${maria.db.jdbc.driver.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.0</version>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>com.gibello</groupId>
<artifactId>icar-json</artifactId>
<version>1.0.0</version>
<version>${icar.json.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<version>${logback.classic.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
......@@ -69,61 +93,62 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<version>${plugin.maven.clean.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
<version>${plugin.maven.compiler.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<version>${plugin.maven.install.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>${plugin.maven.jar.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
<version>${plugin.maven.war.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<version>${plugin.maven.dependency.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<version>${plugin.maven.resources.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>${plugin.maven.surefire.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<version>${plugin.maven.failsafe.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${plugin.maven.site.version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.31.v20200723</version>
<version>${plugin.jetty.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<version>${plugin.maven.enforcer.version}</version>
<executions>
<execution>
<id>enforce-maven</id>
......@@ -143,6 +168,14 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${plugin.versions.version}</version>
<configuration>
<rulesUri>file:///${session.executionRootDirectory}/rules.xml</rulesUri>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
......@@ -150,6 +183,18 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>display-property-updates</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
<?xml version="1.0" encoding="UTF-8"?>
<ruleset comparisonMethod="maven"
xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 https://www.mojohaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
<ignoreVersions>
<!-- Ignore Alpha's, Beta's, release candidates and milestones -->
<ignoreVersion type="regex">(?i).*Alpha(?:-?\d+)?</ignoreVersion>
<!--<ignoreVersion type="regex">(?i).*a(?:-?\d+)?</ignoreVersion>-->
<ignoreVersion type="regex">(?i).*Beta(?:-?\d+)?</ignoreVersion>
<!--<ignoreVersion type="regex">(?i).*-B(?:-?\d+)?</ignoreVersion>-->
<ignoreVersion type="regex">(?i).*RC(?:-?\d+)?</ignoreVersion>
<ignoreVersion type="regex">(?i).*CR(?:-?\d+)?</ignoreVersion>
<!-- Not ignoring M (milestone) releases are they are used for "stable" Maven plugin releases -->
<!--<ignoreVersion type="regex">(?i).*M(?:-?\d+)?</ignoreVersion>-->
</ignoreVersions>
<rules>
</rules>
</ruleset>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment