Skip to content

Commit a8087a1

Browse files
committed
Initial commit
Release manually
0 parents  commit a8087a1

218 files changed

Lines changed: 66932 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
4+
"https://checkstyle.org/dtds/suppressions_1_1.dtd">
5+
<suppressions>
6+
<!-- Suppress checks for generated code -->
7+
<suppress checks=".*" files="[\\/]target[\\/]generated-sources[\\/]" />
8+
<suppress checks=".*" files="[\\/]target[\\/]generated-test-sources[\\/]" />
9+
10+
<!-- Suppress line length for OpenAPI generated models -->
11+
<suppress checks="LineLength" files=".*[\\/]api[\\/].*\.java" />
12+
</suppressions>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//OWASP//DTD Dependency-Check Suppression 1.3//EN"
4+
"https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.dtd">
5+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
6+
<!-- Add suppressions for false positives here -->
7+
<!-- Example:
8+
<suppress>
9+
<notes>False positive - not applicable to our usage</notes>
10+
<cve>CVE-2021-12345</cve>
11+
</suppress>
12+
-->
13+
</suppressions>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CodeQL Security Analysis
2+
3+
# DISABLED: Workflow temporarily disabled
4+
# To re-enable, uncomment the 'on:' section below
5+
# on:
6+
# push:
7+
# branches: [ main, develop ]
8+
# pull_request:
9+
# branches: [ main, develop ]
10+
# schedule:
11+
# - cron: '0 6 * * 1' # Run every Monday at 6 AM UTC
12+
# workflow_dispatch:
13+
on: []
14+
15+
jobs:
16+
analyze:
17+
name: Analyze Code
18+
runs-on: ubuntu-latest
19+
permissions:
20+
actions: read
21+
contents: read
22+
security-events: write
23+
pull-requests: write
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
language: [ 'java' ]
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Set up JDK 21
35+
uses: actions/setup-java@v4
36+
with:
37+
java-version: '21'
38+
distribution: 'temurin'
39+
cache: maven
40+
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v3
43+
with:
44+
languages: ${{ matrix.language }}
45+
queries: +security-and-quality
46+
# Enable additional query suites for more comprehensive analysis
47+
48+
- name: Build project
49+
run: |
50+
./mvnw clean package -DskipTests -B
51+
52+
- name: Perform CodeQL Analysis
53+
uses: github/codeql-action/analyze@v3
54+
with:
55+
category: "/language:${{ matrix.language }}"
56+
upload: true
57+
58+
- name: Upload CodeQL results as artifact
59+
if: always()
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: codeql-results
63+
path: /home/runner/work/_temp/codeql_databases/
64+
retention-days: 7
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Dependency Security Check
2+
3+
# DISABLED: Workflow temporarily disabled
4+
# To re-enable, uncomment the 'on:' section below
5+
# on:
6+
# push:
7+
# branches: [ main, develop ]
8+
# pull_request:
9+
# branches: [ main, develop ]
10+
# schedule:
11+
# - cron: '0 0 * * 0' # Weekly on Sundays
12+
# workflow_dispatch:
13+
on: []
14+
15+
jobs:
16+
dependency-check:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
security-events: write
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Set up JDK 21
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '21'
30+
distribution: 'temurin'
31+
cache: maven
32+
33+
- name: Run OWASP Dependency Check
34+
run: |
35+
./mvnw org.owasp:dependency-check-maven:check \
36+
-DfailBuildOnCVSS=7 \
37+
-DsuppressionFiles=.github/dependency-check-suppressions.xml \
38+
-B
39+
continue-on-error: true
40+
41+
- name: Upload dependency check report
42+
if: always()
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: dependency-check-report
46+
path: |
47+
**/target/dependency-check-report.html
48+
**/target/dependency-check-report.json
49+
retention-days: 30
50+
51+
- name: Run Trivy vulnerability scanner
52+
uses: aquasecurity/trivy-action@master
53+
with:
54+
scan-type: 'fs'
55+
scan-ref: '.'
56+
format: 'sarif'
57+
output: 'trivy-results.sarif'
58+
severity: 'CRITICAL,HIGH,MEDIUM'
59+
60+
- name: Upload Trivy results to GitHub Security
61+
uses: github/codeql-action/upload-sarif@v3
62+
if: always()
63+
with:
64+
sarif_file: 'trivy-results.sarif'
65+
category: 'trivy'
66+
67+
- name: Upload Trivy results as artifact
68+
if: always()
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: trivy-results
72+
path: trivy-results.sarif
73+
retention-days: 30
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Publish to GitHub Packages
2+
3+
# DISABLED: Workflow temporarily disabled
4+
# To re-enable, uncomment the 'on:' section below
5+
# on:
6+
# push:
7+
# tags:
8+
# - 'v*.*.*'
9+
# workflow_dispatch:
10+
on: []
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up JDK 21
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: '21'
27+
distribution: 'temurin'
28+
cache: maven
29+
30+
- name: Extract version from tag
31+
id: version
32+
run: |
33+
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
34+
VERSION="${GITHUB_REF#refs/tags/v}"
35+
echo "version=$VERSION" >> $GITHUB_OUTPUT
36+
./mvnw versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false -B
37+
fi
38+
39+
- name: Build with Maven
40+
run: ./mvnw clean package -DskipTests -B
41+
42+
- name: Publish to GitHub Packages
43+
run: |
44+
./mvnw deploy -DskipTests -B \
45+
-DaltDeploymentRepository=github::default::https://maven.pkg.github.com/${{ github.repository }}
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Upload artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: packages
53+
path: |
54+
**/target/*.jar
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Release to Maven Central and GitHub
2+
3+
# DISABLED: Workflow temporarily disabled
4+
# To re-enable, uncomment the 'on:' section below
5+
# on:
6+
# release:
7+
# types: [created]
8+
# workflow_dispatch:
9+
# inputs:
10+
# version:
11+
# description: 'Release version'
12+
# required: true
13+
# type: string
14+
on: []
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
packages: write
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up JDK 21
28+
uses: actions/setup-java@v4
29+
with:
30+
java-version: '21'
31+
distribution: 'temurin'
32+
cache: maven
33+
# Configure settings.xml for Maven Central and GitHub Packages
34+
server-id: ossrh # For Maven Central
35+
server-username: MAVEN_USERNAME
36+
server-password: MAVEN_PASSWORD
37+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
38+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
39+
40+
- name: Set release version
41+
run: |
42+
if [ "${{ github.event_name }}" == "release" ]; then
43+
VERSION="${GITHUB_REF#refs/tags/v}"
44+
else
45+
VERSION="${{ github.event.inputs.version }}"
46+
fi
47+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
48+
./mvnw versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false -B
49+
50+
- name: Build and package
51+
run: ./mvnw clean package -DskipTests -B
52+
53+
- name: Run tests
54+
run: ./mvnw test -B
55+
56+
- name: Deploy to Maven Central (OSSRH)
57+
env:
58+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
59+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
60+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
61+
run: |
62+
./mvnw deploy -P release -DskipTests -B
63+
64+
- name: Deploy to GitHub Packages
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
run: |
68+
./mvnw deploy -P github -DskipTests -B
69+
70+
- name: Upload Release Assets
71+
uses: softprops/action-gh-release@v1
72+
if: github.event_name == 'release'
73+
with:
74+
files: |
75+
**/target/*.jar
76+
!**/target/*-sources.jar
77+
!**/target/*-javadoc.jar
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
81+
- name: Create Release (for manual trigger)
82+
if: github.event_name == 'workflow_dispatch'
83+
uses: softprops/action-gh-release@v1
84+
with:
85+
tag_name: v${{ env.RELEASE_VERSION }}
86+
name: Release ${{ env.RELEASE_VERSION }}
87+
draft: false
88+
prerelease: false
89+
files: |
90+
**/target/*.jar
91+
!**/target/*-sources.jar
92+
!**/target/*-javadoc.jar
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/pmd-ruleset.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Custom PMD Rules"
3+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
6+
7+
<description>PMD rules for the project</description>
8+
9+
<!-- Basic rules -->
10+
<rule ref="category/java/bestpractices.xml">
11+
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
12+
<exclude name="JUnitTestContainsTooManyAsserts"/>
13+
</rule>
14+
15+
<rule ref="category/java/codestyle.xml">
16+
<exclude name="AtLeastOneConstructor"/>
17+
<exclude name="OnlyOneReturn"/>
18+
<exclude name="LongVariable"/>
19+
<exclude name="ShortVariable"/>
20+
<exclude name="CommentDefaultAccessModifier"/>
21+
<exclude name="CallSuperInConstructor"/>
22+
</rule>
23+
24+
<rule ref="category/java/design.xml">
25+
<exclude name="LawOfDemeter"/>
26+
<exclude name="LoosePackageCoupling"/>
27+
<exclude name="DataClass"/>
28+
</rule>
29+
30+
<rule ref="category/java/errorprone.xml"/>
31+
32+
<rule ref="category/java/multithreading.xml"/>
33+
34+
<rule ref="category/java/performance.xml"/>
35+
36+
<rule ref="category/java/security.xml"/>
37+
38+
<!-- Exclude generated sources -->
39+
<exclude-pattern>.*/target/generated-sources/.*</exclude-pattern>
40+
<exclude-pattern>.*/target/generated-test-sources/.*</exclude-pattern>
41+
</ruleset>

.github/spotbugs-exclude.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<FindBugsFilter>
3+
<!-- Exclude generated code from analysis -->
4+
<Match>
5+
<Source name="~.*[\\/]target[\\/]generated-sources[\\/].*" />
6+
</Match>
7+
<Match>
8+
<Source name="~.*[\\/]target[\\/]generated-test-sources[\\/].*" />
9+
</Match>
10+
11+
<!-- Exclude test resources -->
12+
<Match>
13+
<Source name="~.*[\\/]test[\\/]resources[\\/].*" />
14+
</Match>
15+
16+
<!-- Example: Suppress specific bug patterns -->
17+
<!-- Uncomment and modify as needed
18+
<Match>
19+
<Bug pattern="NP_NULL_ON_SOME_PATH" />
20+
</Match>
21+
-->
22+
23+
<!-- Example: Suppress for specific classes -->
24+
<!--
25+
<Match>
26+
<Class name="com.example.SpecificClass" />
27+
<Bug pattern="DM_STRING_CTOR" />
28+
</Match>
29+
-->
30+
</FindBugsFilter>

0 commit comments

Comments
 (0)