Skip to content

Commit 90c75d5

Browse files
author
Соболев Василий
committed
Update Gradle 9.6.1, Java 17, dependencies and add publish workflow
Major updates: - Update Gradle wrapper from 8.14.5 to 9.6.1 - Update Java source/target compatibility from 8 to 17 - Update io.freefair.lombok plugin from 8.14.4 to 9.5.0 - Update JUnit Jupiter from 5.14.4 to 6.1.2 - Update JUnit Platform Launcher from 1.14.4 to 6.1.2 - Update all project dependencies to latest versions CI/CD improvements: - Add publish job to workflow for Gradle Plugin Portal - Add tag-based release automation with GitHub Release creation - Publish only runs for tags matching [0-9]+.[0-9]+.[0-9]+ on master branch - Add JaCoCo coverage report upload/download between build and sonarcloud jobs - Update all GitHub Actions to latest versions (checkout@v7, cache@v6, setup-java@v5, upload-artifact@v7, download-artifact@v8) - Upload compiled classes as build artifacts for SonarCloud analysis Code quality: - Add sonar.java.binaries and sonar.java.test.binaries properties for better SonarQube analysis - Modernize Java code: use .toList() instead of Collectors.toList() - Add @NotNull annotation to MapstructPlugin generic type - Add @SuppressWarnings for ClassCanBeRecord in CompilerArgsManager - Fix DependencyTest to handle dynamic Lombok version from plugin Other: - Update license year to 2026 - Update README badges for Java 17 and Gradle 9.6.1 - Add hs_err_pid*.log and replay_pid*.log to .gitignore Testing: - All 15 tests passing (3 CompilerArgsTest + 12 DependencyTest) - Build successful with no warnings - SonarCloud quality gate: OK
1 parent 10fd063 commit 90c75d5

15 files changed

Lines changed: 218 additions & 86 deletions

File tree

.github/SECURITY.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability / Сообщение об уязвимости
4+
5+
**English:**
6+
7+
Please report security vulnerabilities through GitHub's Private Vulnerability Reporting.
8+
9+
To submit a report:
10+
1. Go to the Security tab of this repository
11+
2. Click "Report a vulnerability"
12+
3. Provide detailed information about the issue
13+
14+
You can expect:
15+
- Acknowledgment within 48 hours
16+
- Regular updates on the progress
17+
- Credit in the security advisory (unless you prefer to remain anonymous)
18+
19+
**Русский:**
20+
21+
Пожалуйста, сообщайте об уязвимостях безопасности через GitHub Private Vulnerability Reporting.
22+
23+
Для отправки отчёта:
24+
1. Перейдите на вкладку Security этого репозитория
25+
2. Нажмите "Report a vulnerability"
26+
3. Предоставьте подробную информацию о проблеме
27+
28+
Что ожидать:
29+
- Подтверждение получения в течение 48 часов
30+
- Регулярные обновления о прогрессе
31+
- Упоминание в security advisory (если вы не предпочитаете остаться анонимным)
32+
33+
## Languages / Языки
34+
35+
We accept security reports in both English and Russian.
36+
37+
Мы принимаем отчёты об уязвимостях на английском и русском языках.

.github/workflows/main.yml

Lines changed: 110 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,140 @@ name: Build
33
on:
44
push:
55
branches: [master]
6+
tags: ['[0-9]+.[0-9]+.[0-9]+']
67
pull_request:
78
types: [opened, synchronize, reopened]
89

910
jobs:
1011
build:
11-
name: Build
12+
name: Build and Test
1213
runs-on: ubuntu-latest
1314
steps:
1415
- name: Checkout repository
15-
uses: actions/checkout@v4
16+
uses: actions/checkout@v7
17+
18+
- name: Set up JDK
19+
uses: actions/setup-java@v5
20+
with:
21+
distribution: 'liberica'
22+
java-version: '17'
23+
24+
- name: Cache Gradle packages
25+
uses: actions/cache@v6
26+
with:
27+
path: |
28+
~/.gradle/caches
29+
~/.gradle/wrapper
30+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
31+
restore-keys: |
32+
${{ runner.os }}-gradle-
33+
34+
- name: Build and test
35+
run: ./gradlew build test --info
36+
37+
- name: Upload build artifacts
38+
uses: actions/upload-artifact@v7
39+
with:
40+
name: build-artifacts
41+
path: |
42+
build/reports/jacoco/
43+
build/jacoco/
44+
build/classes/java/
45+
retention-days: 1
46+
47+
sonarcloud:
48+
name: SonarCloud Analysis
49+
runs-on: ubuntu-latest
50+
needs: build
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v7
1654
with:
1755
fetch-depth: 0
18-
56+
1957
- name: Set up JDK
20-
uses: actions/setup-java@v4
58+
uses: actions/setup-java@v5
2159
with:
2260
distribution: 'liberica'
2361
java-version: '17'
24-
62+
63+
- name: Cache Gradle packages
64+
uses: actions/cache@v6
65+
with:
66+
path: |
67+
~/.gradle/caches
68+
~/.gradle/wrapper
69+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
70+
restore-keys: |
71+
${{ runner.os }}-gradle-
72+
2573
- name: Cache SonarCloud packages
26-
uses: actions/cache@v4
74+
uses: actions/cache@v6
2775
with:
2876
path: ~/.sonar/cache
2977
key: ${{ runner.os }}-sonar
3078
restore-keys: ${{ runner.os }}-sonar
31-
79+
80+
- name: Download build artifacts
81+
uses: actions/download-artifact@v8
82+
with:
83+
name: build-artifacts
84+
path: build/
85+
86+
- name: SonarCloud analysis
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
90+
run: ./gradlew sonarqube --info
91+
92+
publish:
93+
name: Publish to Gradle Plugin Portal
94+
runs-on: ubuntu-latest
95+
if: startsWith(github.ref, 'refs/tags/')
96+
needs: [build, sonarcloud]
97+
steps:
98+
- name: Checkout repository
99+
uses: actions/checkout@v7
100+
with:
101+
fetch-depth: 0
102+
103+
- name: Verify tag is on master
104+
run: |
105+
git fetch origin master
106+
if ! git branch -r --contains ${{ github.sha }} | grep -q 'origin/master'; then
107+
echo "Error: Tag is not on master branch"
108+
exit 1
109+
fi
110+
111+
- name: Set up JDK
112+
uses: actions/setup-java@v5
113+
with:
114+
distribution: 'liberica'
115+
java-version: '17'
116+
32117
- name: Cache Gradle packages
33-
uses: actions/cache@v4
118+
uses: actions/cache@v6
34119
with:
35120
path: |
36121
~/.gradle/caches
37122
~/.gradle/wrapper
38123
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
39-
restore-keys: ${{ runner.os }}-gradle
40-
41-
- name: Build, test and analyze
124+
restore-keys: |
125+
${{ runner.os }}-gradle-
126+
127+
- name: Set version from tag
128+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
129+
130+
- name: Publish to Gradle Plugin Portal
131+
env:
132+
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
133+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
134+
run: ./gradlew publishPlugins
135+
136+
- name: Create GitHub Release
42137
env:
43138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
45-
run: ./gradlew build test sonarqube --info
139+
run: |
140+
gh release create ${{ github.ref_name }} \
141+
--title "${{ github.ref_name }}" \
142+
--generate-notes

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ target/
2828
/dist/
2929
/nbdist/
3030
/.nb-gradle/
31+
32+
### JVM ###
33+
hs_err_pid*.log
34+
replay_pid*.log

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 aka_zver
189+
Copyright 2026 aka_zver
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
[![Actions Status](https://github.com/AkaZver/mapstruct-plugin/workflows/Build/badge.svg)](https://github.com/AkaZver/mapstruct-plugin/actions)
2-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=AkaZver_mapstruct-plugin)
3-
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=security_rating)](https://sonarcloud.io/dashboard?id=AkaZver_mapstruct-plugin)
4-
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=AkaZver_mapstruct-plugin)
5-
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=AkaZver_mapstruct-plugin)
6-
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=AkaZver_mapstruct-plugin)
7-
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=coverage)](https://sonarcloud.io/dashboard?id=AkaZver_mapstruct-plugin)
8-
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FAkaZver%2Fmapstruct-plugin.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FAkaZver%2Fmapstruct-plugin?ref=badge_shield)
1+
<p align="center">
2+
<a href="https://github.com/AkaZver/mapstruct-plugin/actions"><img src="https://github.com/AkaZver/mapstruct-plugin/workflows/Build/badge.svg" alt="Actions Status"></a>
3+
<a href="https://sonarcloud.io"><img src="https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=alert_status" alt="Quality Gate Status"></a>
4+
<a href="https://sonarcloud.io"><img src="https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=coverage" alt="Coverage"></a>
5+
<br/>
6+
<a href="https://sonarcloud.io"><img src="https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=security_rating" alt="Security Rating"></a>
7+
<a href="https://sonarcloud.io"><img src="https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=reliability_rating" alt="Reliability Rating"></a>
8+
<a href="https://sonarcloud.io"><img src="https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=sqale_rating" alt="Maintainability Rating"></a>
9+
<a href="https://sonarcloud.io"><img src="https://sonarcloud.io/api/project_badges/measure?project=AkaZver_mapstruct-plugin&metric=vulnerabilities" alt="Vulnerabilities"></a>
10+
<br/>
11+
<a href="#"><img src="https://img.shields.io/badge/Java-17-blue.svg?logo=intellijidea" alt="Java"></a>
12+
<a href="#"><img src="https://img.shields.io/badge/Gradle-9.6.1-blue.svg?logo=gradle" alt="Gradle"></a>
13+
<a href="#"><img src="https://img.shields.io/badge/License-Apache--2.0-blue.svg?logo=apache" alt="License"></a>
14+
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2FAkaZver%2Fmapstruct-plugin?ref=badge_shield"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2FAkaZver%2Fmapstruct-plugin.svg?type=shield" alt="FOSSA Status"></a>
15+
</p>
916

1017
# MapStruct Gradle Plugin
1118

@@ -14,7 +21,7 @@ Gradle plugin for easy [MapStruct](https://mapstruct.org/) setup
1421
Usage:
1522
```groovy
1623
plugins {
17-
id 'com.github.akazver.mapstruct' version '1.0.9'
24+
id 'com.github.akazver.mapstruct' version '2.0.0'
1825
}
1926
```
2027

build.gradle

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
plugins {
2-
id 'com.gradle.plugin-publish' version '1.3.1'
3-
id 'io.freefair.lombok' version '8.13.1'
4-
id 'org.sonarqube' version '6.1.0.5360'
2+
id 'com.gradle.plugin-publish' version '2.1.1'
3+
id 'io.freefair.lombok' version '9.5.0'
4+
id 'org.sonarqube' version '7.3.1.8318'
55
id 'java-gradle-plugin'
66
id 'maven-publish'
77
id 'jacoco'
88
}
99

1010
group = 'com.github.akazver.mapstruct'
11-
version = '1.0.9'
11+
version = System.getenv("RELEASE_VERSION") ?: "dev"
1212

1313
gradlePlugin {
1414
website = 'https://github.com/AkaZver'
@@ -20,7 +20,7 @@ gradlePlugin {
2020
displayName = 'MapStruct Plugin'
2121
description = 'Automatic MapStruct configuration'
2222
implementationClass = 'com.github.akazver.gradle.plugins.mapstruct.MapstructPlugin'
23-
tags = ['mapstruct', 'mapping', 'lombok', 'spring', 'quarkus', 'camel']
23+
tags.set(['mapstruct', 'mapping', 'lombok', 'spring', 'quarkus', 'camel'])
2424
}
2525
}
2626
}
@@ -31,12 +31,12 @@ repositories {
3131
}
3232

3333
dependencies {
34-
testImplementation 'io.freefair.gradle:lombok-plugin:8.13.1'
35-
testImplementation 'org.assertj:assertj-core:3.27.3'
36-
testImplementation 'org.junit.jupiter:junit-jupiter:5.12.1'
37-
testImplementation 'org.junit.platform:junit-platform-launcher:1.12.1'
38-
testImplementation 'org.mockito:mockito-core:5.16.1'
39-
testImplementation 'org.mockito:mockito-junit-jupiter:5.16.1'
34+
testImplementation 'io.freefair.gradle:lombok-plugin:9.5.0'
35+
testImplementation 'org.assertj:assertj-core:3.27.7'
36+
testImplementation 'org.junit.jupiter:junit-jupiter:6.1.2'
37+
testImplementation 'org.junit.platform:junit-platform-launcher:6.1.2'
38+
testImplementation 'org.mockito:mockito-core:5.23.0'
39+
testImplementation 'org.mockito:mockito-junit-jupiter:5.23.0'
4040
}
4141

4242
test {
@@ -45,8 +45,8 @@ test {
4545
}
4646

4747
java {
48-
sourceCompatibility(8)
49-
targetCompatibility(8)
48+
sourceCompatibility = 17
49+
targetCompatibility = 17
5050
withSourcesJar()
5151
}
5252

@@ -63,6 +63,8 @@ sonarqube {
6363
property "sonar.projectKey", "AkaZver_mapstruct-plugin"
6464
property "sonar.organization", "aka-zver"
6565
property "sonar.host.url", "https://sonarcloud.io"
66+
property "sonar.java.binaries", "build/classes/java/main"
67+
property "sonar.java.test.binaries", "build/classes/java/test"
6668
}
6769
}
6870

gradle/wrapper/gradle-wrapper.jar

4.65 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
44
networkTimeout=10000
5+
retries=0
6+
retryBackOffMs=500
57
validateDistributionUrl=true
68
zipStoreBase=GRADLE_USER_HOME
79
zipStorePath=wrapper/dists

gradlew

Lines changed: 5 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)