Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/jakarta #122

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
74cc79b
feat: replace reflections lib with classgraph
CarstenWickner Jan 2, 2024
e51670a
feat: avoid changing thread classloader
CarstenWickner Jan 3, 2024
3341913
feat(ci): update github workflows
dgautier Mar 12, 2024
0b95335
feat(ci): update github workflows
dgautier Mar 12, 2024
a8b01e1
feat(pom): prepare releases to github packages
dgautier Mar 12, 2024
c9eed74
fix(pom): distributionManagement must be under profile
dgautier Mar 12, 2024
a9f81d0
Bump metcalfc/changelog-generator from 4.3.0 to 4.3.1
dependabot[bot] Mar 12, 2024
43838e7
Bump com.google.guava:guava from 30.0-jre to 32.0.0-jre
dependabot[bot] Mar 12, 2024
4cbefda
Bump org.slf4j.version from 1.7.29 to 2.0.12
dependabot[bot] Mar 12, 2024
0827aab
Bump org.apache.maven.version from 3.6.0 to 3.9.6
dependabot[bot] Mar 12, 2024
650f183
Merge pull request #1 from dgautier/dependabot/github_actions/metcalf…
dgautier Mar 12, 2024
bc38866
Merge pull request #2 from dgautier/dependabot/maven/com.google.guava…
dgautier Mar 12, 2024
21d6c4a
Bump commons-fileupload:commons-fileupload in /src/it/ISSUE-25
dependabot[bot] Mar 12, 2024
f90bab9
Bump com.google.guava:guava from 30.0-jre to 33.0.0-jre
dependabot[bot] Mar 12, 2024
46a26c9
Merge pull request #4 from dgautier/dependabot/maven/org.slf4j.versio…
dgautier Mar 12, 2024
51e4149
Merge pull request #6 from dgautier/dependabot/maven/org.apache.maven…
dgautier Mar 12, 2024
9b858a1
Merge pull request #8 from dgautier/dependabot/maven/com.google.guava…
dgautier Mar 12, 2024
d41e23a
Bump the maven group group with 1 update
dependabot[bot] Mar 12, 2024
3d0cc91
fix(ci): remove legacy java versions
dgautier Mar 12, 2024
a4cf968
Merge pull request #10 from dgautier/dependabot/maven/src/it/ISSUE-25…
dgautier Mar 12, 2024
2e2572b
Merge pull request #14 from dgautier/dependabot/maven/maven-security-…
dgautier Mar 12, 2024
c7929e3
merge: feat: replace reflections lib with classgraph from @CarstenWic…
dgautier Mar 12, 2024
09e2c03
Merge pull request #16 from dgautier/CarstenWickner-master
dgautier Mar 12, 2024
06a5261
feat: split in multi-module, creates draft jakarta version
dgautier Mar 12, 2024
aa159e3
doc: update with some jakarta info
dgautier Mar 12, 2024
88ff092
refacto: moved groupId to <groupId>io.github.dgautier</groupId>
dgautier Mar 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "maven" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Deploy Snapshots
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Deploy to Github packages
run: mvn --batch-mode clean deploy -Pgithub,coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to the Maven Central Repository
run: mvn --batch-mode clean deploy -Possrh
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
24 changes: 0 additions & 24 deletions .github/workflows/ci.yaml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Verify PR
on:
pull_request:
branches:
- "**"

jobs:
build:
strategy:
matrix:
java-version: [17, 21 ]
runs-on: [ ubuntu-latest, macos-latest, windows-latest ]
name: Jdk ${{ matrix.java-version }}, os ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn --batch-mode verify -Pcoverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Release New Version
on:
workflow_dispatch:
inputs:
releaseversion:
description: 'Release version'
required: true
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- run: |
echo "Release version ${{ github.event.inputs.releaseversion }}!"
- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"
- name: Deploy to Github packages
run: mvn --batch-mode clean deploy -Pgithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"
- name: Publish to the Maven Central Repository
run: mvn --batch-mode clean deploy -Possrh
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.releaseversion }}
release_name: ${{ github.event.inputs.releaseversion }}
body: |
### Things that changed in this release
${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false

50 changes: 41 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Swagger Maven Plugin

This plugin is intended to use the [Swagger Core library](https://github.com/swagger-api/swagger-core) to generate
OpenAPI documentation from a JAX-RS based REST service with as little change as possible. This allows for @SwaggerDefinition, @ReaderListener and ModelConverters to work the same way as with the core Swagger library.
OpenAPI documentation from a JAX-RS or Jakarta based REST service with as little change as possible. This allows for @SwaggerDefinition, @ReaderListener and ModelConverters to work the same way as with the core Swagger library.


# Status

The plugin is considered production ready. The version 2.x.x of the plugin is supporting generation of OpenAPI version 3 specifications using Swagger 2.x. To generate OpenAPI version 2 specifications using Swagger 1.x use the latest 1.x.x version of the plugin.
The plugin is considered production ready.
- The version 3.X (not released) will support jakarta annotations
- The version 2.x.x of the plugin is supporting generation of OpenAPI version 3 specifications using Swagger 2.x.
- To generate OpenAPI version 2 specifications using Swagger 1.x use the latest 1.x.x version of the plugin.

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.openapitools.swagger/swagger-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.openapitools.swagger/swagger-maven-plugin/)
[![Javadoc](https://javadoc.io/badge/io.openapitools.swagger/swagger-maven-plugin/badge.svg)](https://www.javadoc.io/doc/io.openapitools.swagger/swagger-maven-plugin)
[![Build status](https://travis-ci.org/openapi-tools/swagger-maven-plugin.svg?branch=master)](https://travis-ci.org/openapi-tools/swagger-maven-plugin)
[![Known Vulnerabilities](https://snyk.io/test/github/openapi-tools/swagger-maven-plugin/badge.svg)](https://snyk.io/test/github/openapi-tools/swagger-maven-plugin)
[![Build status](https://github.com/dgautier/swagger-maven-plugin/actions/workflows/build.yml/badge.svg)](https://travis-ci.org/openapi-tools/swagger-maven-plugin)


# Usage
Expand All @@ -23,8 +25,39 @@ To have Swagger generate the OpenAPI specifications as part of the build add in
<plugins>
...
<plugin>
<groupId>io.openapitools.swagger</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<groupId>io.github.dgautier</groupId>
<artifactId>swagger-maven-plugin-jaxrs2</artifactId>
<configuration>
<resourcePackages>
<resourcePackage>io.openapitools.swagger.example</resourcePackage>
<resourcePackage>io.openapitools.swagger.example.alternate</resourcePackage>
</resourcePackages>
<outputDirectory>${basedir}/target/</outputDirectory>
<outputFilename>swagger</outputFilename>
<outputFormats>JSON,YAML</outputFormats>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
```

Or Use the jakarta version :

```xml
<build>
<plugins>
...
<plugin>
<groupId>io.github.dgautier</groupId>
<artifactId>swagger-maven-plugin-jakarta</artifactId>
<configuration>
<resourcePackages>
<resourcePackage>io.openapitools.swagger.example</resourcePackage>
Expand All @@ -33,7 +66,6 @@ To have Swagger generate the OpenAPI specifications as part of the build add in
<outputDirectory>${basedir}/target/</outputDirectory>
<outputFilename>swagger</outputFilename>
<outputFormats>JSON,YAML</outputFormats>
<prettyPrint>true</prettyPrint>
</configuration>
<executions>
<execution>
Expand All @@ -60,7 +92,7 @@ Most general properties of the Swagger model is configurable using the swaggerCo

```xml
<plugin>
<groupId>io.openapitools.swagger</groupId>
<groupId>io.github.dgautier</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<configuration>
<swaggerConfig>
Expand Down Expand Up @@ -99,7 +131,7 @@ The generated OpenAPI specifications may be installed and deployed as Maven arti

```xml
<plugin>
<groupId>io.openapitools.swagger</groupId>
<groupId>io.github.dgautier</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<configuration>
<attachSwaggerArtifact>true</attachSwaggerArtifact>
Expand Down
Loading