Skip to content

Commit 27d0176

Browse files
committed
refs #3836 - jakarta related CI and README
1 parent 12e8e0c commit 27d0176

File tree

5 files changed

+126
-5
lines changed

5 files changed

+126
-5
lines changed

CI/post-release.sh

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ $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-project-jakarta
27+
../../mvnw versions:set -DnewVersion="${SC_NEXT_VERSION}-SNAPSHOT"
28+
cd ../..
29+
2630
#####################
2731
### update all other versions in files around to the next snapshot or new release, including readme and gradle ###
2832
#####################

CI/prepare-release.sh

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ $CUR/CI/releaseNotes.py "$SC_LAST_RELEASE" "$SC_RELEASE_TITLE" "$SC_RELEASE_TAG"
2525
./mvnw versions:set -DnewVersion=$SC_VERSION
2626
./mvnw versions:commit
2727

28+
cd modules/swagger-project-jakarta
29+
../../mvnw versions:set -DnewVersion=$SC_VERSION
30+
cd ../..
31+
32+
2833
#####################
2934
### update all other versions in files around to the new release, including readme and gradle ###
3035
#####################

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
**NOTE:** If you're looking for Swagger Core 1.5.X and OpenAPI 2.0, please refer to [1.5 branch](https://github.com/swagger-api/swagger-core/tree/1.5).
44

5+
**NOTE:** Since version 2.1.7 Swagger Core supports also Jakarta namespace, with a parallel set of artifacts with `-jakarta` suffix, providing the same functionality as the "standard" `javax` namespace ones.
6+
Please check [Wiki](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started) for more details
7+
58
![Build Test Deploy](https://github.com/swagger-api/swagger-core/workflows/Build%20Test%20Deploy%20master/badge.svg?branch=master)
69
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger.core.v3/swagger-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger.core.v3/swagger-project)
710

8-
Swagger Core is a Java implementation of the OpenAPI Specification. Current version supports *JAX-RS2*.
11+
Swagger Core is a Java implementation of the OpenAPI Specification. Current version supports *JAX-RS2* (`javax` and `jakarta` namespaces).
912

1013
## Get started with Swagger Core!
1114
See the guide on [getting started with Swagger Core](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started) to get started with adding Swagger to your API.

modules/swagger-gradle-plugin/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,26 @@
22

33
**`swagger-gradle-plugin` supports gradle 3.2 and higher.**
44

5+
## Jakarta namespace support
6+
7+
Since version 2.1.7 Swagger Core supports also Jakarta namespace, with a parallel set of artifacts with `-jakarta` suffix, providing the same functionality as the "standard" `javax` namespace ones.
8+
Please check [Wiki](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started) for more details
9+
10+
To have gradle plugin use the `jakarta` namespace artifacts, you need to provide a value to parameter `buildClasspath`
11+
In many cases it is sufficient to set it to the `classpath` value, like:
12+
13+
`buildClasspath = classpath`
14+
15+
Alternatively provide as value a classpath with the following dependencies (replacing the provided [`javax` ones](https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-gradle-plugin/src/main/java/io/swagger/v3/plugins/gradle/SwaggerPlugin.java#L16-L25)):
16+
17+
* org.apache.commons:commons-lang3:3.7
18+
* io.swagger.core.v3:swagger-jaxrs2-jakarta:2.1.7
19+
* jakarta.ws.rs:jakarta.ws.rs-api:3.0.0
20+
* jakarta.servlet:jakarta.servlet-api:5.0.0
21+
522
## Installation
23+
24+
625
### Gradle 3.2 and higher
726

827
```

modules/swagger-maven-plugin/README.md

+94-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@
44
All parameters except `outputFileName`, `outputFormat`, `skip`, `encoding` and `outputPath` correspond
55
to `swagger` [configuration property](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Integration-and-Configuration#configuration-properties) with same name.
66

7+
## Jakarta namespace support
8+
9+
Since version 2.1.7 Swagger Core supports also Jakarta namespace, with a parallel set of artifacts with `-jakarta` suffix, providing the same functionality as the "standard" `javax` namespace ones.
10+
Please check [Wiki](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started) for more details
11+
12+
Both `javax` and `jakarta` examples are provided below
13+
714
## Configuration example
815

16+
### `javax` namespace
917

1018
```xml
1119
<project>
@@ -14,7 +22,7 @@ to `swagger` [configuration property](https://github.com/swagger-api/swagger-cor
1422
<plugin>
1523
<groupId>io.swagger.core.v3</groupId>
1624
<artifactId>swagger-maven-plugin</artifactId>
17-
<version>2.1.1</version>
25+
<version>2.1.7</version>
1826
<configuration>
1927
<outputFileName>openapi</outputFileName>
2028
<outputPath>${project.build.directory}/generatedtest</outputPath>
@@ -39,7 +47,7 @@ to `swagger` [configuration property](https://github.com/swagger-api/swagger-cor
3947
<dependency>
4048
<groupId>io.swagger.core.v3</groupId>
4149
<artifactId>swagger-jaxrs2</artifactId>
42-
<version>2.1.1</version>
50+
<version>2.1.7</version>
4351
</dependency>
4452

4553
<dependency>
@@ -56,7 +64,60 @@ to `swagger` [configuration property](https://github.com/swagger-api/swagger-cor
5664
</project>
5765
```
5866

59-
### Configuration example with provided Swagger configuration file
67+
### `jakarta` namespace
68+
69+
```xml
70+
<project>
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>io.swagger.core.v3</groupId>
75+
<artifactId>swagger-maven-plugin-jakarta</artifactId>
76+
<version>2.1.7</version>
77+
<configuration>
78+
<outputFileName>openapi</outputFileName>
79+
<outputPath>${project.build.directory}/generatedtest</outputPath>
80+
<outputFormat>JSONANDYAML</outputFormat>
81+
<resourcePackages>
82+
<package>test.petstore</package>
83+
</resourcePackages>
84+
<prettyPrint>TRUE</prettyPrint>
85+
</configuration>
86+
<executions>
87+
<execution>
88+
<phase>compile</phase>
89+
<goals>
90+
<goal>resolve</goal>
91+
</goals>
92+
</execution>
93+
</executions>
94+
</plugin>
95+
</plugins>
96+
</build>
97+
<dependencies>
98+
<dependency>
99+
<groupId>io.swagger.core.v3</groupId>
100+
<artifactId>swagger-jaxrs2-jakarta</artifactId>
101+
<version>2.1.7</version>
102+
</dependency>
103+
104+
<dependency>
105+
<groupId>jakarta.ws.rs</groupId>
106+
<artifactId>jakarta.ws.rs-api</artifactId>
107+
<version>3.0.0</version>
108+
</dependency>
109+
<dependency>
110+
<groupId>jakarta.servlet</groupId>
111+
<artifactId>jakarta.servlet-api</artifactId>
112+
<version>5.0.0</version>
113+
</dependency>
114+
</dependencies>
115+
</project>
116+
```
117+
118+
## Configuration example with provided Swagger configuration file
119+
120+
### `javax` namespace
60121

61122
```xml
62123
<project>
@@ -65,7 +126,36 @@ to `swagger` [configuration property](https://github.com/swagger-api/swagger-cor
65126
<plugin>
66127
<groupId>io.swagger.core.v3</groupId>
67128
<artifactId>swagger-maven-plugin</artifactId>
68-
<version>2.1.1</version>
129+
<version>2.1.7</version>
130+
<configuration>
131+
<outputFileName>openapi</outputFileName>
132+
<outputPath>${project.build.directory}/generatedtest</outputPath>
133+
<configurationFilePath>${project.basedir}/src/main/resources/configurationFile.yaml</configurationFilePath>
134+
</configuration>
135+
<executions>
136+
<execution>
137+
<phase>compile</phase>
138+
<goals>
139+
<goal>resolve</goal>
140+
</goals>
141+
</execution>
142+
</executions>
143+
</plugin>
144+
</plugins>
145+
</build>
146+
...
147+
```
148+
149+
### `jakarta` namespace
150+
151+
```xml
152+
<project>
153+
<build>
154+
<plugins>
155+
<plugin>
156+
<groupId>io.swagger.core.v3</groupId>
157+
<artifactId>swagger-maven-plugin-jakarta</artifactId>
158+
<version>2.1.7</version>
69159
<configuration>
70160
<outputFileName>openapi</outputFileName>
71161
<outputPath>${project.build.directory}/generatedtest</outputPath>

0 commit comments

Comments
 (0)