Skip to content

Commit

Permalink
refs #3836 - jakarta related CI and README
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Feb 12, 2021
1 parent 12e8e0c commit 27d0176
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CI/post-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ $CUR/CI/publishRelease.py "$SC_RELEASE_TAG"
./mvnw versions:set -DnewVersion="${SC_NEXT_VERSION}-SNAPSHOT"
./mvnw versions:commit

cd modules/swagger-project-jakarta
../../mvnw versions:set -DnewVersion="${SC_NEXT_VERSION}-SNAPSHOT"
cd ../..

#####################
### update all other versions in files around to the next snapshot or new release, including readme and gradle ###
#####################
Expand Down
5 changes: 5 additions & 0 deletions CI/prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ $CUR/CI/releaseNotes.py "$SC_LAST_RELEASE" "$SC_RELEASE_TITLE" "$SC_RELEASE_TAG"
./mvnw versions:set -DnewVersion=$SC_VERSION
./mvnw versions:commit

cd modules/swagger-project-jakarta
../../mvnw versions:set -DnewVersion=$SC_VERSION
cd ../..


#####################
### update all other versions in files around to the new release, including readme and gradle ###
#####################
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

**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).

**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.
Please check [Wiki](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started) for more details

![Build Test Deploy](https://github.com/swagger-api/swagger-core/workflows/Build%20Test%20Deploy%20master/badge.svg?branch=master)
[![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)

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

## Get started with Swagger Core!
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.
Expand Down
19 changes: 19 additions & 0 deletions modules/swagger-gradle-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,26 @@

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

## Jakarta namespace support

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.
Please check [Wiki](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started) for more details

To have gradle plugin use the `jakarta` namespace artifacts, you need to provide a value to parameter `buildClasspath`
In many cases it is sufficient to set it to the `classpath` value, like:

`buildClasspath = classpath`

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)):

* org.apache.commons:commons-lang3:3.7
* io.swagger.core.v3:swagger-jaxrs2-jakarta:2.1.7
* jakarta.ws.rs:jakarta.ws.rs-api:3.0.0
* jakarta.servlet:jakarta.servlet-api:5.0.0

## Installation


### Gradle 3.2 and higher

```
Expand Down
98 changes: 94 additions & 4 deletions modules/swagger-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@
All parameters except `outputFileName`, `outputFormat`, `skip`, `encoding` and `outputPath` correspond
to `swagger` [configuration property](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Integration-and-Configuration#configuration-properties) with same name.

## Jakarta namespace support

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.
Please check [Wiki](https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started) for more details

Both `javax` and `jakarta` examples are provided below

## Configuration example

### `javax` namespace

```xml
<project>
Expand All @@ -14,7 +22,7 @@ to `swagger` [configuration property](https://github.com/swagger-api/swagger-cor
<plugin>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>2.1.1</version>
<version>2.1.7</version>
<configuration>
<outputFileName>openapi</outputFileName>
<outputPath>${project.build.directory}/generatedtest</outputPath>
Expand All @@ -39,7 +47,7 @@ to `swagger` [configuration property](https://github.com/swagger-api/swagger-cor
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2</artifactId>
<version>2.1.1</version>
<version>2.1.7</version>
</dependency>

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

### Configuration example with provided Swagger configuration file
### `jakarta` namespace

```xml
<project>
<build>
<plugins>
<plugin>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-maven-plugin-jakarta</artifactId>
<version>2.1.7</version>
<configuration>
<outputFileName>openapi</outputFileName>
<outputPath>${project.build.directory}/generatedtest</outputPath>
<outputFormat>JSONANDYAML</outputFormat>
<resourcePackages>
<package>test.petstore</package>
</resourcePackages>
<prettyPrint>TRUE</prettyPrint>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>resolve</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2-jakarta</artifactId>
<version>2.1.7</version>
</dependency>

<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
</project>
```

## Configuration example with provided Swagger configuration file

### `javax` namespace

```xml
<project>
Expand All @@ -65,7 +126,36 @@ to `swagger` [configuration property](https://github.com/swagger-api/swagger-cor
<plugin>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>2.1.1</version>
<version>2.1.7</version>
<configuration>
<outputFileName>openapi</outputFileName>
<outputPath>${project.build.directory}/generatedtest</outputPath>
<configurationFilePath>${project.basedir}/src/main/resources/configurationFile.yaml</configurationFilePath>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>resolve</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
```

### `jakarta` namespace

```xml
<project>
<build>
<plugins>
<plugin>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-maven-plugin-jakarta</artifactId>
<version>2.1.7</version>
<configuration>
<outputFileName>openapi</outputFileName>
<outputPath>${project.build.directory}/generatedtest</outputPath>
Expand Down

0 comments on commit 27d0176

Please sign in to comment.