Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/actions/build-and-test-plugins/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Build and test plugins'
description: >
Builds and installs the Maven reactor, builds the Gradle plugin, and runs the
Maven plugin's integration tests. Shared by the Build and Release workflows so
the application build+test sequence is defined in one place.
runs:
using: "composite"
steps:
- name: Maven install (parallel, skip invoker ITs)
uses: ./.github/actions/maven-install

- name: Build Gradle plugin
shell: bash
run: |
cd ./springdoc-openapi-gradle-plugin
./gradlew build --info --build-cache --parallel

- name: Maven plugin integration tests
shell: bash
run: |
./mvnw --no-transfer-progress -B -pl springdoc-openapi-maven-plugin verify
12 changes: 12 additions & 0 deletions .github/actions/maven-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Maven install (parallel, skip invoker ITs)'
description: >
Builds and installs the whole Maven reactor to the local repo, skipping the
maven-plugin's invoker-plugin integration tests. Those run serially afterwards
via build-and-test-plugins.
runs:
using: "composite"
steps:
- name: Maven install
shell: bash
run: |
./mvnw --no-transfer-progress -B -T 1C -Dinvoker.skip=true install --file pom.xml
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,21 @@ jobs:
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Build with Maven
run: ./mvnw --no-transfer-progress -B -T 1C install --file pom.xml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
with:
cache-read-only: ${{ github.event_name == 'pull_request' }}

- name: Build and test plugins
uses: ./.github/actions/build-and-test-plugins

- name: Deploy SNAPSHOT to Maven Central
if: github.event_name == 'push' && matrix.java == 17
run: |
MY_POM_VERSION=$(./mvnw -q -DforceStdout help:evaluate -Dexpression=project.version --non-recursive)
echo "POM VERSION: $MY_POM_VERSION"
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; then
./mvnw --no-transfer-progress -B -T 1C -DskipTests deploy -e
./mvnw --no-transfer-progress -B -T 1C -Dinvoker.skip=true -DskipTests deploy -e
else
echo "Not a SNAPSHOT version, skipping deployment."
fi
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ jobs:
languages: java

- name: Build with Maven
run: ./mvnw --no-transfer-progress -B -T 1C install --file pom.xml
# CodeQL only needs the source built for analysis; the maven-plugin's invoker
# ITs already run in the main Build workflow (see maven-install action).
uses: ./.github/actions/maven-install

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
25 changes: 21 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ jobs:
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
with:
cache-read-only: false

- name: Compute release version
id: version
run: . ./CI/compute-release-version.sh ${{ github.event.inputs.release_type }}
Expand All @@ -42,12 +50,19 @@ jobs:
- name: Prepare release commit (detached)
run: . ./CI/prepare-release-commit.sh

- name: Build and test
run: ./mvnw --no-transfer-progress -B -T 1C install --file pom.xml
- name: Build and test plugins
uses: ./.github/actions/build-and-test-plugins

- name: Deploy to Maven Central
if: success()
run: ./mvnw --no-transfer-progress -B -T 1C -Prelease deploy
run: ./mvnw --no-transfer-progress -B -T 1C -Dinvoker.skip=true -Prelease deploy

- name: Publish Gradle plugin
if: success()
run: |
cd ./springdoc-openapi-gradle-plugin
./gradlew publishPlugins -Pgradle.publish.key="${GRADLE_PUBLISH_KEY}" -Pgradle.publish.secret="${GRADLE_PUBLISH_SECRET}" --info --build-cache --parallel
cd ../..

- name: Tag and push release tag
if: success()
Expand Down Expand Up @@ -111,4 +126,6 @@ jobs:
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PRIVATE_PASSPHRASE }}
GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PRIVATE_PASSPHRASE }}
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
3 changes: 3 additions & 0 deletions CI/bump-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ echo "Bumping version to $NEXT_SNAPSHOT"
# Update all POMs in one go
./mvnw versions:set -DnewVersion="${NEXT_SNAPSHOT}" -DgenerateBackupPoms=false

# Update gradle.properties
sed -i "s/version=.*/version=${NEXT_SNAPSHOT}/" springdoc-openapi-gradle-plugin/gradle.properties

# Commit and push
git config user.email "action@github.com"
git config user.name "GitHub Action"
Expand Down
3 changes: 3 additions & 0 deletions CI/prepare-release-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ git config user.name "GitHub Action"
# Update all Maven POMs in one go
./mvnw versions:set -DnewVersion="${RELEASE_VERSION}" -DgenerateBackupPoms=false

# Update gradle.properties
sed -i "s/version=.*/version=${RELEASE_VERSION}/" springdoc-openapi-gradle-plugin/gradle.properties

# Stage all changes and commit (detached)
git add -A
git commit -m "Release version ${RELEASE_VERSION}"
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
<module>springdoc-openapi-starter-webmvc-mcp</module>
<module>springdoc-openapi-starter-webflux-mcp</module>
<module>springdoc-openapi-bom</module>
<module>springdoc-openapi-generator-worker</module>
<module>springdoc-openapi-maven-plugin</module>
<module>springdoc-openapi-tests</module>
</modules>

Expand Down
10 changes: 10 additions & 0 deletions springdoc-openapi-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@
<artifactId>springdoc-openapi-starter-webflux-mcp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.vpelikh</groupId>
<artifactId>springdoc-openapi-generator-worker</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.vpelikh</groupId>
<artifactId>springdoc-openapi-maven-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
144 changes: 144 additions & 0 deletions springdoc-openapi-generator-worker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
######################
# Project Specific
######################
/target/www/**
/src/test/javascript/coverage/

######################
# Node
######################
/node/
node_tmp/
node_modules/
npm-debug.log.*
/.awcache/*
/.cache-loader/*

######################
# SASS
######################
.sass-cache/

######################
# Eclipse
######################
*.pydevproject
.project
.metadata
tmp/
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
.factorypath
/src/main/resources/rebel.xml

# External tool builders
.externalToolBuilders/**

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath

######################
# Intellij
######################
.idea/
*.iml
*.iws
*.ipr
*.ids
*.orig
classes/
out/

######################
# Visual Studio Code
######################
.vscode/

######################
# Maven
######################
/log/
/target/

######################
# Gradle
######################
.gradle/
/build/

######################
# Package Files
######################
*.jar
*.war
*.ear
*.db

######################
# Windows
######################
# Windows image file caches
Thumbs.db

# Folder config file
Desktop.ini

######################
# Mac OSX
######################
.DS_Store
.svn

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

######################
# Directories
######################
/bin/
/deploy/

######################
# Logs
######################
*.log*

######################
# Others
######################
*.class
*.*~
*~
.merge_file*

######################
# Gradle Wrapper
######################
!gradle/wrapper/gradle-wrapper.jar

######################
# Maven Wrapper
######################
!.mvn/wrapper/maven-wrapper.jar

######################
# ESLint
######################
.eslintcache
53 changes: 53 additions & 0 deletions springdoc-openapi-generator-worker/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.github.vpelikh</groupId>
<artifactId>springdoc-openapi</artifactId>
<version>5.0.6-SNAPSHOT</version>
</parent>
<artifactId>springdoc-openapi-generator-worker</artifactId>
<name>${project.artifactId}</name>
<description>Shared forked-JVM worker that boots a Spring Boot reactive or servlet context, runs springdoc-openapi, and writes the OpenAPI document. Used by the Gradle and Maven generator plugins.</description>

<dependencies>
<!-- Thin jar: no classes are bundled. It reuses the target app's own spring/springdoc
classes at runtime, so it must NOT force either web stack onto the fork classpath
(that would flip Spring Boot's deduced web application type). Both springdoc stack
APIs are therefore compile-only; the worker invokes the resource via reflection. -->
<dependency>
<groupId>io.github.vpelikh</groupId>
<artifactId>springdoc-openapi-starter-webflux-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.vpelikh</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-web-server</artifactId>
<scope>provided</scope>
</dependency>
<!-- Compile-time servlet API for the WebMvc branch. -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Runtime: the worker builds mock requests / servlet contexts with spring-test. This is
the only runtime-transitive dependency; it does not influence the web application
type. -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependencies>
</project>
Loading
Loading