Skip to content

Commit 4c82d4b

Browse files
committed
add integration test module and enforcer plugin
1 parent cae1222 commit 4c82d4b

7 files changed

Lines changed: 197 additions & 27 deletions

File tree

.github/workflows/prepare-release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ jobs:
3535
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
3636
restore-keys: |
3737
${{ runner.os }}-maven-
38+
- name: Check swagger-bom version matches root version
39+
run: |
40+
ROOT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
41+
BOM_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec --file modules/swagger-bom/pom.xml)
42+
echo "Root version: ${ROOT_VERSION}"
43+
echo "BOM version: ${BOM_VERSION}"
44+
if [ "${ROOT_VERSION}" != "${BOM_VERSION}" ]; then
45+
echo "ERROR: swagger-bom version (${BOM_VERSION}) does not match root version (${ROOT_VERSION}). Update modules/swagger-bom/pom.xml."
46+
exit 1
47+
fi
3848
- name: Run prepare release script
3949
id: prepare-release
4050
run: |

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ jobs:
4040
run: |
4141
mkdir -p ~/.gradle
4242
echo "gradle.publish.key=${GRADLE_PUBLISH_KEY}\ngradle.publish.secret=${GRADLE_PUBLISH_SECRET}" > ~/.gradle/gradle.properties
43+
- name: Check swagger-bom version matches root version
44+
run: |
45+
ROOT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
46+
BOM_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec --file modules/swagger-bom/pom.xml)
47+
echo "Root version: ${ROOT_VERSION}"
48+
echo "BOM version: ${BOM_VERSION}"
49+
if [ "${ROOT_VERSION}" != "${BOM_VERSION}" ]; then
50+
echo "ERROR: swagger-bom version (${BOM_VERSION}) does not match root version (${ROOT_VERSION}). Update modules/swagger-bom/pom.xml."
51+
exit 1
52+
fi
4353
- name: Run pre release script
4454
id: preRelease
4555
run: |

CHANGELOG.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,6 @@ Import it once and omit versions on all individual Swagger dependencies.
213213
<groupId>io.swagger.core.v3</groupId>
214214
<artifactId>swagger-jaxrs2-servlet-initializer-v2</artifactId>
215215
</dependency>
216-
<dependency>
217-
<groupId>io.swagger.core.v3</groupId>
218-
<artifactId>swagger-java17-support</artifactId>
219-
</dependency>
220216
<!-- Jakarta namespace artifacts (use instead of, or alongside, the javax ones above) -->
221217
<dependency>
222218
<groupId>io.swagger.core.v3</groupId>
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>io.swagger.core.v3</groupId>
7+
<artifactId>swagger-project</artifactId>
8+
<version>2.2.47-SNAPSHOT</version>
9+
<relativePath>../..</relativePath>
10+
</parent>
11+
12+
<artifactId>swagger-bom-integration-test</artifactId>
13+
<packaging>pom</packaging>
14+
15+
<name>swagger-bom-integration-test</name>
16+
<description>Verifies that swagger-bom manages all expected artifacts at the correct version</description>
17+
18+
<!-- Not a publishable artifact -->
19+
<properties>
20+
<maven.deploy.skip>true</maven.deploy.skip>
21+
<maven.install.skip>true</maven.install.skip>
22+
</properties>
23+
24+
<dependencyManagement>
25+
<dependencies>
26+
<dependency>
27+
<groupId>io.swagger.core.v3</groupId>
28+
<artifactId>swagger-bom</artifactId>
29+
<version>${project.version}</version>
30+
<type>pom</type>
31+
<scope>import</scope>
32+
</dependency>
33+
</dependencies>
34+
</dependencyManagement>
35+
36+
<!--
37+
Declare every artifact the BOM is expected to manage, without explicit versions.
38+
Maven will fail if the BOM does not provide a version for any of these entries.
39+
-->
40+
<dependencies>
41+
<!-- javax artifact family -->
42+
<dependency>
43+
<groupId>io.swagger.core.v3</groupId>
44+
<artifactId>swagger-annotations</artifactId>
45+
</dependency>
46+
<dependency>
47+
<groupId>io.swagger.core.v3</groupId>
48+
<artifactId>swagger-models</artifactId>
49+
</dependency>
50+
<dependency>
51+
<groupId>io.swagger.core.v3</groupId>
52+
<artifactId>swagger-core</artifactId>
53+
</dependency>
54+
<dependency>
55+
<groupId>io.swagger.core.v3</groupId>
56+
<artifactId>swagger-integration</artifactId>
57+
</dependency>
58+
<dependency>
59+
<groupId>io.swagger.core.v3</groupId>
60+
<artifactId>swagger-jaxrs2</artifactId>
61+
</dependency>
62+
<dependency>
63+
<groupId>io.swagger.core.v3</groupId>
64+
<artifactId>swagger-jaxrs2-servlet-initializer</artifactId>
65+
</dependency>
66+
<dependency>
67+
<groupId>io.swagger.core.v3</groupId>
68+
<artifactId>swagger-jaxrs2-servlet-initializer-v2</artifactId>
69+
</dependency>
70+
<!-- Jakarta namespace artifact family -->
71+
<dependency>
72+
<groupId>io.swagger.core.v3</groupId>
73+
<artifactId>swagger-annotations-jakarta</artifactId>
74+
</dependency>
75+
<dependency>
76+
<groupId>io.swagger.core.v3</groupId>
77+
<artifactId>swagger-models-jakarta</artifactId>
78+
</dependency>
79+
<dependency>
80+
<groupId>io.swagger.core.v3</groupId>
81+
<artifactId>swagger-core-jakarta</artifactId>
82+
</dependency>
83+
<dependency>
84+
<groupId>io.swagger.core.v3</groupId>
85+
<artifactId>swagger-integration-jakarta</artifactId>
86+
</dependency>
87+
<dependency>
88+
<groupId>io.swagger.core.v3</groupId>
89+
<artifactId>swagger-jaxrs2-jakarta</artifactId>
90+
</dependency>
91+
<dependency>
92+
<groupId>io.swagger.core.v3</groupId>
93+
<artifactId>swagger-jaxrs2-servlet-initializer-jakarta</artifactId>
94+
</dependency>
95+
<dependency>
96+
<groupId>io.swagger.core.v3</groupId>
97+
<artifactId>swagger-jaxrs2-servlet-initializer-v2-jakarta</artifactId>
98+
</dependency>
99+
</dependencies>
100+
101+
<build>
102+
<plugins>
103+
<!--
104+
Explicitly resolve all declared dependencies so that the build fails
105+
fast if any managed artifact cannot be downloaded or is missing
106+
from the local repository after a full reactor install.
107+
-->
108+
<!-- Disable the DependencyConvergence rule inherited from the root parent.
109+
Transitive deps of mixed javax/Jakarta artifacts intentionally diverge. -->
110+
<plugin>
111+
<groupId>org.apache.maven.plugins</groupId>
112+
<artifactId>maven-enforcer-plugin</artifactId>
113+
<executions>
114+
<execution>
115+
<id>enforce-versions</id>
116+
<configuration>
117+
<skip>true</skip>
118+
</configuration>
119+
</execution>
120+
</executions>
121+
</plugin>
122+
<plugin>
123+
<groupId>org.apache.maven.plugins</groupId>
124+
<artifactId>maven-dependency-plugin</artifactId>
125+
<executions>
126+
<execution>
127+
<id>verify-bom-deps-resolve</id>
128+
<phase>validate</phase>
129+
<goals>
130+
<goal>resolve</goal>
131+
</goals>
132+
<configuration>
133+
<includeGroupIds>io.swagger.core.v3</includeGroupIds>
134+
</configuration>
135+
</execution>
136+
</executions>
137+
</plugin>
138+
</plugins>
139+
</build>
140+
141+
</project>

modules/swagger-bom/pom.xml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
</developer>
4141
</developers>
4242

43+
<issueManagement>
44+
<system>github</system>
45+
<url>https://github.com/swagger-api/swagger-core/issues</url>
46+
</issueManagement>
47+
4348
<build>
4449
<plugins>
4550
<plugin>
@@ -57,6 +62,36 @@
5762
</plugins>
5863
</build>
5964

65+
<profiles>
66+
<profile>
67+
<id>release</id>
68+
<build>
69+
<plugins>
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-gpg-plugin</artifactId>
73+
<version>1.6</version>
74+
<configuration>
75+
<gpgArguments>
76+
<arg>--pinentry-mode</arg>
77+
<arg>loopback</arg>
78+
</gpgArguments>
79+
</configuration>
80+
<executions>
81+
<execution>
82+
<id>sign-artifacts</id>
83+
<phase>verify</phase>
84+
<goals>
85+
<goal>sign</goal>
86+
</goals>
87+
</execution>
88+
</executions>
89+
</plugin>
90+
</plugins>
91+
</build>
92+
</profile>
93+
</profiles>
94+
6095
<dependencyManagement>
6196
<dependencies>
6297
<!-- Core Swagger (OpenAPI 3) libraries -->
@@ -95,11 +130,6 @@
95130
<artifactId>swagger-jaxrs2-servlet-initializer-v2</artifactId>
96131
<version>${project.version}</version>
97132
</dependency>
98-
<dependency>
99-
<groupId>io.swagger.core.v3</groupId>
100-
<artifactId>swagger-java17-support</artifactId>
101-
<version>${project.version}</version>
102-
</dependency>
103133
<!-- Jakarta namespace artifacts -->
104134
<dependency>
105135
<groupId>io.swagger.core.v3</groupId>

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@
405405
<module>modules/swagger-maven-plugin</module>
406406
<module>modules/swagger-eclipse-transformer-maven-plugin</module>
407407
<module>modules/swagger-project-jakarta</module>
408+
<module>modules/swagger-bom-integration-test</module>
408409

409410
</modules>
410411
<reporting>

0 commit comments

Comments
 (0)