Skip to content

Commit b39cf52

Browse files
committed
add jakarta artifacts and CI drift-guard
1 parent d168477 commit b39cf52

7 files changed

Lines changed: 174 additions & 6 deletions

File tree

.github/workflows/maven-pulls.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ jobs:
2929
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
3030
restore-keys: |
3131
${{ runner.os }}-maven-
32+
- name: Check swagger-bom version matches root version
33+
run: |
34+
ROOT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
35+
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)
36+
echo "Root version: ${ROOT_VERSION}"
37+
echo "BOM version: ${BOM_VERSION}"
38+
if [ "${ROOT_VERSION}" != "${BOM_VERSION}" ]; then
39+
echo "ERROR: swagger-bom version (${BOM_VERSION}) does not match root version (${ROOT_VERSION}). Update modules/swagger-bom/pom.xml."
40+
exit 1
41+
fi
3242
- name: Build with Maven and Gradle
3343
run: |
3444
./mvnw --no-transfer-progress -B install --file pom.xml

.github/workflows/maven.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ jobs:
2929
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
3030
restore-keys: |
3131
${{ runner.os }}-maven-
32+
- name: Check swagger-bom version matches root version
33+
run: |
34+
ROOT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
35+
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)
36+
echo "Root version: ${ROOT_VERSION}"
37+
echo "BOM version: ${BOM_VERSION}"
38+
if [ "${ROOT_VERSION}" != "${BOM_VERSION}" ]; then
39+
echo "ERROR: swagger-bom version (${BOM_VERSION}) does not match root version (${ROOT_VERSION}). Update modules/swagger-bom/pom.xml."
40+
exit 1
41+
fi
3242
- name: Build with Maven and Gradle, Deploy snapshot to maven central
3343
run: |
3444
export MY_POM_VERSION=`./mvnw -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changelog
2+
3+
## 2.2.47-SNAPSHOT
4+
5+
### New Features
6+
7+
- **`swagger-bom`**: Added Maven Bill of Materials (BOM) module (`io.swagger.core.v3:swagger-bom`).
8+
The BOM manages **both** the `javax` artifact family and the Jakarta (`-jakarta` suffix) artifact family
9+
in a single import. Consumers can import the BOM once and omit explicit versions on all
10+
`io.swagger.core.v3` runtime dependencies.
11+
Covered artifacts: `swagger-annotations`, `swagger-models`, `swagger-core`, `swagger-integration`,
12+
`swagger-jaxrs2`, `swagger-jaxrs2-servlet-initializer`, `swagger-jaxrs2-servlet-initializer-v2`,
13+
`swagger-java17-support`, and their `-jakarta` counterparts.
14+
Build plugins are intentionally excluded from the BOM.
15+
16+
---
17+
18+
For earlier releases see the [GitHub Releases page](https://github.com/swagger-api/swagger-core/releases).

CI/post-release.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ python $CUR/CI/publishRelease.py "$SC_RELEASE_TAG"
2323
./mvnw versions:set -DnewVersion="${SC_NEXT_VERSION}-SNAPSHOT"
2424
./mvnw versions:commit
2525

26+
cd modules/swagger-bom
27+
../../mvnw versions:set -DnewVersion="${SC_NEXT_VERSION}-SNAPSHOT"
28+
../../mvnw versions:commit
29+
cd ../..
30+
2631
cd modules/swagger-project-jakarta
2732
../../mvnw versions:set -DnewVersion="${SC_NEXT_VERSION}-SNAPSHOT"
2833
../../mvnw versions:commit

CI/prepare-release.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ python $CUR/CI/releaseNotes.py "$SC_LAST_RELEASE" "$SC_RELEASE_TITLE" "$SC_RELEA
2525
./mvnw versions:set -DnewVersion=$SC_VERSION
2626
./mvnw versions:commit
2727

28+
cd modules/swagger-bom
29+
../../mvnw versions:set -DnewVersion=$SC_VERSION
30+
../../mvnw versions:commit
31+
cd ../..
32+
2833
cd modules/swagger-project-jakarta
2934
../../mvnw versions:set -DnewVersion=$SC_VERSION
3035
../../mvnw versions:commit

README.md

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,16 @@ Of course if you don't want to build locally you can grab artifacts from maven c
158158

159159
### Maven BOM
160160

161-
To manage Swagger dependencies consistently across modules, import the Swagger Core BOM and omit versions on individual Swagger dependencies:
161+
The `swagger-bom` artifact is a Bill of Materials that manages **both** the `javax` and Jakarta (`-jakarta` suffix) artifact families.
162+
Import it once and omit versions on all individual Swagger dependencies.
163+
164+
> **Note:** Maven and Gradle build plugins (`swagger-maven-plugin`, `swagger-gradle-plugin`,
165+
> `swagger-eclipse-transformer-maven-plugin`) are intentionally **excluded** from the BOM.
166+
> Plugins are applied via `<build><plugins>` or `plugins {}`, not via `<dependencyManagement>`,
167+
> so including them in the BOM would be misleading and could conflict with the plugin
168+
> management section of a consumer's build.
169+
170+
#### Maven
162171

163172
```xml
164173
<dependencyManagement>
@@ -171,11 +180,11 @@ To manage Swagger dependencies consistently across modules, import the Swagger C
171180
<scope>import</scope>
172181
</dependency>
173182
</dependencies>
174-
175183
</dependencyManagement>
176184

177-
<!-- Then declare Swagger dependencies without versions -->
185+
<!-- Then declare Swagger dependencies without explicit versions -->
178186
<dependencies>
187+
<!-- javax artifacts -->
179188
<dependency>
180189
<groupId>io.swagger.core.v3</groupId>
181190
<artifactId>swagger-annotations</artifactId>
@@ -196,7 +205,6 @@ To manage Swagger dependencies consistently across modules, import the Swagger C
196205
<groupId>io.swagger.core.v3</groupId>
197206
<artifactId>swagger-jaxrs2</artifactId>
198207
</dependency>
199-
<!-- Optional servlet initializer helpers -->
200208
<dependency>
201209
<groupId>io.swagger.core.v3</groupId>
202210
<artifactId>swagger-jaxrs2-servlet-initializer</artifactId>
@@ -205,14 +213,58 @@ To manage Swagger dependencies consistently across modules, import the Swagger C
205213
<groupId>io.swagger.core.v3</groupId>
206214
<artifactId>swagger-jaxrs2-servlet-initializer-v2</artifactId>
207215
</dependency>
208-
<!-- Optional support for Java 17 module-path consumers -->
209216
<dependency>
210217
<groupId>io.swagger.core.v3</groupId>
211218
<artifactId>swagger-java17-support</artifactId>
212219
</dependency>
220+
<!-- Jakarta namespace artifacts (use instead of, or alongside, the javax ones above) -->
221+
<dependency>
222+
<groupId>io.swagger.core.v3</groupId>
223+
<artifactId>swagger-annotations-jakarta</artifactId>
224+
</dependency>
225+
<dependency>
226+
<groupId>io.swagger.core.v3</groupId>
227+
<artifactId>swagger-models-jakarta</artifactId>
228+
</dependency>
229+
<dependency>
230+
<groupId>io.swagger.core.v3</groupId>
231+
<artifactId>swagger-core-jakarta</artifactId>
232+
</dependency>
233+
<dependency>
234+
<groupId>io.swagger.core.v3</groupId>
235+
<artifactId>swagger-integration-jakarta</artifactId>
236+
</dependency>
237+
<dependency>
238+
<groupId>io.swagger.core.v3</groupId>
239+
<artifactId>swagger-jaxrs2-jakarta</artifactId>
240+
</dependency>
241+
<dependency>
242+
<groupId>io.swagger.core.v3</groupId>
243+
<artifactId>swagger-jaxrs2-servlet-initializer-jakarta</artifactId>
244+
</dependency>
245+
<dependency>
246+
<groupId>io.swagger.core.v3</groupId>
247+
<artifactId>swagger-jaxrs2-servlet-initializer-v2-jakarta</artifactId>
248+
</dependency>
213249
</dependencies>
214250
```
215251

252+
#### Gradle
253+
254+
```kotlin
255+
dependencies {
256+
implementation(platform("io.swagger.core.v3:swagger-bom:${swaggerOpenapiv3Version}"))
257+
258+
// javax artifacts — no version needed
259+
implementation("io.swagger.core.v3:swagger-annotations")
260+
implementation("io.swagger.core.v3:swagger-core")
261+
262+
// Jakarta namespace artifacts — no version needed
263+
implementation("io.swagger.core.v3:swagger-annotations-jakarta")
264+
implementation("io.swagger.core.v3:swagger-core-jakarta")
265+
}
266+
```
267+
216268
## Sample Apps
217269
The samples have moved to [a new repository](https://github.com/swagger-api/swagger-samples/tree/2.0) and contain various integrations and configurations.
218270

modules/swagger-bom/pom.xml

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.swagger.core.v3</groupId>
66
<artifactId>swagger-bom</artifactId>
7-
<version>2.2.38-SNAPSHOT</version>
7+
<version>2.2.47-SNAPSHOT</version>
88
<packaging>pom</packaging>
99

1010
<name>swagger-bom</name>
@@ -25,6 +25,38 @@
2525
</license>
2626
</licenses>
2727

28+
<developers>
29+
<developer>
30+
<id>daniel-kmiecik</id>
31+
<name>Daniel Kmiecik</name>
32+
</developer>
33+
<developer>
34+
<id>djankowsk</id>
35+
<name>Damian Jankowski</name>
36+
</developer>
37+
<developer>
38+
<id>ewaostrowska</id>
39+
<name>Ewa Ostrowska</name>
40+
</developer>
41+
</developers>
42+
43+
<build>
44+
<plugins>
45+
<plugin>
46+
<groupId>org.sonatype.central</groupId>
47+
<artifactId>central-publishing-maven-plugin</artifactId>
48+
<version>0.7.0</version>
49+
<extensions>true</extensions>
50+
<configuration>
51+
<publishingServerId>central</publishingServerId>
52+
<autoPublish>true</autoPublish>
53+
<waitUntil>published</waitUntil>
54+
<waitMaxTime>3600</waitMaxTime>
55+
</configuration>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
2860
<dependencyManagement>
2961
<dependencies>
3062
<!-- Core Swagger (OpenAPI 3) libraries -->
@@ -68,6 +100,42 @@
68100
<artifactId>swagger-java17-support</artifactId>
69101
<version>${project.version}</version>
70102
</dependency>
103+
<!-- Jakarta namespace artifacts -->
104+
<dependency>
105+
<groupId>io.swagger.core.v3</groupId>
106+
<artifactId>swagger-annotations-jakarta</artifactId>
107+
<version>${project.version}</version>
108+
</dependency>
109+
<dependency>
110+
<groupId>io.swagger.core.v3</groupId>
111+
<artifactId>swagger-models-jakarta</artifactId>
112+
<version>${project.version}</version>
113+
</dependency>
114+
<dependency>
115+
<groupId>io.swagger.core.v3</groupId>
116+
<artifactId>swagger-core-jakarta</artifactId>
117+
<version>${project.version}</version>
118+
</dependency>
119+
<dependency>
120+
<groupId>io.swagger.core.v3</groupId>
121+
<artifactId>swagger-integration-jakarta</artifactId>
122+
<version>${project.version}</version>
123+
</dependency>
124+
<dependency>
125+
<groupId>io.swagger.core.v3</groupId>
126+
<artifactId>swagger-jaxrs2-jakarta</artifactId>
127+
<version>${project.version}</version>
128+
</dependency>
129+
<dependency>
130+
<groupId>io.swagger.core.v3</groupId>
131+
<artifactId>swagger-jaxrs2-servlet-initializer-jakarta</artifactId>
132+
<version>${project.version}</version>
133+
</dependency>
134+
<dependency>
135+
<groupId>io.swagger.core.v3</groupId>
136+
<artifactId>swagger-jaxrs2-servlet-initializer-v2-jakarta</artifactId>
137+
<version>${project.version}</version>
138+
</dependency>
71139
</dependencies>
72140
</dependencyManagement>
73141

0 commit comments

Comments
 (0)