Skip to content

Commit

Permalink
build(maven): Move the war/jar logic to the main pom.xml
Browse files Browse the repository at this point in the history
This allows us to use the packagingValue inside the ors-report-aggregation as well and build it in jar/war mode. Before, we always needed to exclude the package when building with war target.
  • Loading branch information
MichaelsJP committed Feb 19, 2024
1 parent 3c9f57f commit 9cbadb4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
24 changes: 0 additions & 24 deletions ors-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@

<packaging>${packagingValue}</packaging>

<properties>
<!--
A default for packagingValue is needed, if profiles other than buildWar or buildFatJar are used, e.g. apitests.
The value is set/overridden in the profiles buildWar and buildFatJar, e.g.
mvn clean package -PbuildWar
-->
<packagingValue>jar</packagingValue>
</properties>

<build>
<finalName>ors</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
Expand Down Expand Up @@ -290,21 +281,6 @@
</dependencies>

<profiles>
<profile>
<id>buildWar</id>
<properties>
<packagingValue>war</packagingValue>
</properties>
</profile>
<profile>
<id>buildFatJar</id>
<properties>
<packagingValue>jar</packagingValue>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>apitests</id>
<build>
Expand Down
2 changes: 1 addition & 1 deletion ors-report-aggregation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<groupId>org.heigit.ors</groupId>
<artifactId>ors-api</artifactId>
<version>${project.version}</version>
<type>jar</type>
<type>${packagingValue}</type>
</dependency>
</dependencies>

Expand Down
24 changes: 24 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
</modules>

<properties>
<!--
A default for packagingValue is needed, if profiles other than buildWar or buildFatJar are used, e.g. apitests.
The value is set/overridden in the profiles buildWar and buildFatJar, e.g.
mvn clean package -PbuildWar
-->
<packagingValue>jar</packagingValue>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Expand Down Expand Up @@ -81,6 +87,24 @@
</repository>
</repositories>

<profiles>
<profile>
<id>buildWar</id>
<properties>
<packagingValue>war</packagingValue>
</properties>
</profile>
<profile>
<id>buildFatJar</id>
<properties>
<packagingValue>jar</packagingValue>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>

<dependencyManagement>
<dependencies>
<!-- As long as swagger-parser uses snakeyaml <2 it cannot be used. Too much vulnerabilities. -->
Expand Down

0 comments on commit 9cbadb4

Please sign in to comment.