Skip to content

Commit

Permalink
build: make pom more CI friendly by using Maven revision property
Browse files Browse the repository at this point in the history
- include revision property in parent pom
- child modules now refer to parent pom version by revision property
- also clean pom dependencies

for more info visit https://maven.apache.org/maven-ci-friendly.html
  • Loading branch information
nicoprow committed Jun 20, 2024
1 parent 51b4156 commit 500d237
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 110 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ application-developer.properties
application-developer.yml
*.drawio.svg.bkp
/docker/compose/**/.env
.flattened-pom.xml
8 changes: 1 addition & 7 deletions bpdm-cleaning-service-dummy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>bpdm-parent</artifactId>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<dependencies>
Expand Down Expand Up @@ -143,12 +143,6 @@
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
8 changes: 1 addition & 7 deletions bpdm-common-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>bpdm-parent</artifactId>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<dependencies>
Expand Down Expand Up @@ -61,11 +61,6 @@
<artifactId>junit-jupiter</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
Expand All @@ -79,7 +74,6 @@
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand Down
2 changes: 1 addition & 1 deletion bpdm-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>bpdm-parent</artifactId>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bpdm-gate-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<artifactId>bpdm-parent</artifactId>
<groupId>org.eclipse.tractusx</groupId>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion bpdm-gate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>bpdm-parent</artifactId>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bpdm-orchestrator-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>bpdm-parent</artifactId>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion bpdm-orchestrator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>bpdm-parent</artifactId>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<dependencies>
Expand Down
7 changes: 5 additions & 2 deletions bpdm-pool-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>bpdm-parent</artifactId>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<properties>
Expand All @@ -51,7 +51,10 @@
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
7 changes: 1 addition & 6 deletions bpdm-pool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>bpdm-parent</artifactId>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<dependencies>
Expand Down Expand Up @@ -152,11 +152,6 @@
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.11.0</version>
</dependency>
</dependencies>

<build>
Expand Down
144 changes: 61 additions & 83 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<artifactId>bpdm-parent</artifactId>
<name>Business Partner Data Management Parent</name>
<description>Parent pom of Business Partner Data Management</description>
<version>6.0.2-SNAPSHOT</version>
<version>${revision}</version>
<packaging>pom</packaging>

<parent>
Expand All @@ -49,24 +49,12 @@
</modules>

<properties>
<revision>6.0.2-SNAPSHOT</revision>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<spring-boot.version>3.2.5</spring-boot.version>
<kotlin.version>1.9.24</kotlin.version>
<springdoc.version>2.5.0</springdoc.version>
<neo.version>1.29</neo.version>
<kotlinlogging.version>3.0.5</kotlinlogging.version>
<wiremock.version>2.35.2</wiremock.version>
<springmockk.version>4.0.2</springmockk.version>
<assertj.version>3.24.2</assertj.version>
<spring-boot.version>3.0.4</spring-boot.version>
<sonar.organization>catenax-ng</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.projectKey>product-bpdm</sonar.projectKey>
<sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
<sonar.version>3.11.0.3922</sonar.version>
<jacoco.version>0.8.12</jacoco.version>
<testcontainers.version>1.19.8</testcontainers.version>
<io.projectreactor.netty>1.1.20</io.projectreactor.netty>
</properties>

<pluginRepositories>
Expand Down Expand Up @@ -131,7 +119,7 @@
<dependency>
<groupId>com.neovisionaries</groupId>
<artifactId>nv-i18n</artifactId>
<version>${neo.version}</version>
<version>1.29</version>
</dependency>
<!-- OpenAPI 3 auto API documentation library for Spring Boot -->
<dependency>
Expand All @@ -144,56 +132,49 @@
<artifactId>springdoc-openapi-starter-common</artifactId>
<version>${springdoc.version}</version>
</dependency>
<!-- Override snakeyaml version used by transitive dependencies due to security issue -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.2</version>
</dependency>
<!-- Override jwt library version used by spring framework due to security issue -->
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>9.37.2</version>
</dependency>

<!-- Kotlin wrapper for slf4j (Logging)-->
<dependency>
<groupId>io.github.microutils</groupId>
<artifactId>kotlin-logging-jvm</artifactId>
<version>${kotlinlogging.version}</version>
<version>3.0.5</version>
</dependency>
<!-- Used for simple CSV operations -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.11.0</version>
</dependency>

<!-- Test -->
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8-standalone</artifactId>
<version>${wiremock.version}</version>
<version>2.35.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.ninja-squad</groupId>
<artifactId>springmockk</artifactId>
<version>${springmockk.version}</version>
<version>4.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<version>3.24.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>${testcontainers.version}</version>
<version>1.19.8</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty-http</artifactId>
<version>${io.projectreactor.netty}</version>
<version>1.1.20</version>
</dependency>
<dependency>
<groupId>com.github.dasniko</groupId>
Expand Down Expand Up @@ -285,55 +266,52 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.dash</groupId>
<artifactId>license-tool-plugin</artifactId>
<version>1.1.0</version>
<executions>
<execution>
<id>license-check</id>
<goals>
<goal>license-check</goal>
</goals>
</execution>
</executions>
<configuration>
<projectId>automotive.tractusx</projectId>
<summary>DEPENDENCIES</summary>
<includeScope>test</includeScope>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar.version}</version>
</plugin>
<!-- Creates test coverage report -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.dash</groupId>
<artifactId>license-tool-plugin</artifactId>
<version>1.1.0</version>
<executions>
<execution>
<id>license-check</id>
<goals>
<goal>license-check</goal>
</goals>
</execution>
</executions>
<configuration>
<projectId>automotive.tractusx</projectId>
<summary>DEPENDENCIES</summary>
<includeScope>test</includeScope>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 500d237

Please sign in to comment.