Skip to content

Commit 6cf84f7

Browse files
committed
Merge remote-tracking branch 'origin/update-from-template-github_com_xdev-software_openapi-client-maven-template_master' into develop
2 parents 91538db + bafbc9f commit 6cf84f7

19 files changed

Lines changed: 862 additions & 314 deletions

File tree

‎.config/checkstyle/checkstyle.xml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,17 @@
112112
<module name="ModifierOrder"/>
113113
<module name="NeedBraces"/>
114114
<module name="NoClone"/>
115+
<module name="NoCodeInFile"/>
115116
<module name="NoFinalizer"/>
116117
<module name="NonEmptyAtclauseDescription"/>
117118
<module name="NoWhitespaceAfter"/>
118119
<module name="NoWhitespaceBefore"/>
120+
<module name="ModifierOrder"/>
119121
<module name="OneStatementPerLine"/>
120122
<module name="OneTopLevelClass"/>
121123
<module name="OperatorWrap"/>
122124
<module name="OuterTypeNumber"/>
125+
<module name="PackageDeclaration"/>
123126
<module name="PackageName"/>
124127
<module name="ParameterName"/>
125128
<module name="ParenPad"/>

‎.github/workflows/check-build.yml‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ on:
1919
- '.idea/**'
2020
- 'assets/**'
2121

22-
env:
23-
DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo
24-
2522
jobs:
2623
build:
2724
runs-on: ubuntu-latest
@@ -69,13 +66,6 @@ jobs:
6966
exit 1
7067
fi
7168
72-
- name: Upload demo files
73-
uses: actions/upload-artifact@v7
74-
with:
75-
name: demo-files-java-${{ matrix.java }}
76-
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
77-
if-no-files-found: error
78-
7969
checkstyle:
8070
runs-on: ubuntu-latest
8171
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
@@ -148,10 +138,10 @@ jobs:
148138
${{ runner.os }}-pmd-
149139
150140
- name: Run PMD
151-
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C
141+
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -T2C
152142

153143
- name: Run CPD (Copy Paste Detector)
154-
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C
144+
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -T2C
155145

156146
- name: Upload report
157147
if: ${{ !cancelled() }}

‎.github/workflows/release.yml‎

Lines changed: 73 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ on:
44
push:
55
branches: [ master ]
66

7-
env:
8-
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
9-
10-
permissions:
11-
contents: write
12-
pull-requests: write
13-
147
# DO NOT RESTORE CACHE for critical release steps to prevent a (extremely unlikely) scenario
158
# where a supply chain attack could be achieved due to poisoned cache
169
jobs:
@@ -37,7 +30,8 @@ jobs:
3730
${{ runner.os }}-mvn-build-
3831
3932
- name: Build with Maven
40-
run: ./mvnw -B clean package -T2C
33+
run: ../mvnw -B clean package -T2C
34+
working-directory: src
4135

4236
- name: Check for uncommited changes
4337
run: |
@@ -61,6 +55,8 @@ jobs:
6155
runs-on: ubuntu-latest
6256
needs: [check-code]
6357
timeout-minutes: 10
58+
permissions:
59+
contents: write
6460
outputs:
6561
upload_url: ${{ steps.create-release.outputs.upload_url }}
6662
steps:
@@ -77,10 +73,9 @@ jobs:
7773
- name: Get version
7874
id: version
7975
run: |
80-
version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
76+
version=$(./mvnw -B help:evaluate -Dexpression=project.version -q -DforceStdout)
8177
echo "release=$version" >> $GITHUB_OUTPUT
8278
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
83-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
8479
8580
- name: Commit and Push
8681
run: |
@@ -92,7 +87,7 @@ jobs:
9287
9388
- name: Create Release
9489
id: create-release
95-
uses: shogo82148/actions-create-release@8674c0ecee617c8dfb006526bcc22a362c70b88a # v1
90+
uses: shogo82148/actions-create-release@cfc5a8374495dd25fe96f758cc09251ab6286911 # v1
9691
with:
9792
tag_name: v${{ steps.version.outputs.release }}
9893
release_name: v${{ steps.version.outputs.release }}
@@ -106,7 +101,7 @@ jobs:
106101
```XML
107102
<dependency>
108103
<groupId>software.xdev</groupId>
109-
<artifactId>${{ env.PRIMARY_MAVEN_MODULE }}</artifactId>
104+
<artifactId>${{ github.event.repository.name }}</artifactId>
110105
<version>${{ steps.version.outputs.release }}</version>
111106
</dependency>
112107
```
@@ -130,13 +125,13 @@ jobs:
130125
distribution: 'temurin'
131126
java-version: '17'
132127
server-id: github-central
133-
server-password: PACKAGES_CENTRAL_TOKEN
134-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
128+
server-password-env-var: PACKAGES_CENTRAL_TOKEN
129+
gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE
135130
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
136131

137132
- name: Publish to GitHub Packages Central
138-
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
139-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
133+
run: ../mvnw -B deploy -P publish -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
134+
working-directory: src
140135
env:
141136
PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }}
142137
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
@@ -147,19 +142,19 @@ jobs:
147142
distribution: 'temurin'
148143
java-version: '17'
149144
server-id: sonatype-central-portal
150-
server-username: MAVEN_CENTRAL_USERNAME
151-
server-password: MAVEN_CENTRAL_TOKEN
152-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
145+
server-username-env-var: MAVEN_CENTRAL_USERNAME
146+
server-password-env-var: MAVEN_CENTRAL_TOKEN
147+
gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE
153148

154149
- name: Publish to Central Portal
155-
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests
150+
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal
151+
working-directory: src
156152
env:
157153
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
158154
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}
159155
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
160-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
161156

162-
publish-pages:
157+
build-pages:
163158
runs-on: ubuntu-latest
164159
needs: [prepare-release]
165160
timeout-minutes: 15
@@ -188,20 +183,69 @@ jobs:
188183
${{ runner.os }}-mvn-build-
189184
190185
- name: Build site
191-
run: ../mvnw -B compile site -DskipTests -T2C
192-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
186+
run: ../mvnw -B compile site -P site -T2C
187+
working-directory: src
188+
189+
- name: Aggregate site
190+
run: |
191+
# Compile is required, otherwise dep resolution failure
192+
echo "Looking up modules"
193+
module_dirs=($(../mvnw -B -q --also-make compile exec:exec -P site -Dexec.executable="pwd" -Dmaven.main.skip))
194+
base_module_full="${module_dirs[0]}"
195+
196+
echo "Found modules - Src: $base_module_full"
197+
198+
base_cut_away_length=$((${#base_module_full}+1))
199+
200+
echo "BasePathLengthToCutAway: $base_cut_away_length"
193201
194-
- name: Deploy to Github pages
195-
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4
202+
is_first=true
203+
for full_module_path in "${module_dirs[@]}"
204+
do
205+
if [ $is_first = true ]; then
206+
echo "Skipping initial/base module"
207+
is_first=false
208+
continue
209+
fi
210+
211+
m=${full_module_path:$base_cut_away_length}
212+
213+
echo "$m/target/site/. -> ./target/site/$m"
214+
mkdir -p ./target/site/$m
215+
cp -r $m/target/site/. ./target/site/$m
216+
done
217+
working-directory: src
218+
219+
- name: Upload pages artifact
220+
uses: actions/upload-pages-artifact@v5
196221
with:
197-
github_token: ${{ secrets.GITHUB_TOKEN }}
198-
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
199-
force_orphan: true
222+
path: src/target/site
223+
224+
deploy-pages:
225+
runs-on: ubuntu-latest
226+
needs: [build-pages]
227+
timeout-minutes: 10
228+
concurrency:
229+
group: 'pages'
230+
cancel-in-progress: false
231+
permissions:
232+
pages: write
233+
id-token: write
234+
environment:
235+
name: github-pages
236+
url: ${{ steps.deployment.outputs.page_url }}
237+
steps:
238+
- name: Deploy to GitHub Pages
239+
id: deployment
240+
uses: actions/deploy-pages@v5
200241

201242
after-release:
202243
runs-on: ubuntu-latest
203244
needs: [publish-maven]
204245
timeout-minutes: 10
246+
permissions:
247+
contents: write
248+
pull-requests: write
205249
steps:
206250
- uses: actions/checkout@v7
207251

‎.github/workflows/test-deploy.yml‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: Test Deployment
33
on:
44
workflow_dispatch:
55

6-
env:
7-
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
8-
96
jobs:
107
publish-maven:
118
runs-on: ubuntu-latest
@@ -19,13 +16,13 @@ jobs:
1916
distribution: 'temurin'
2017
java-version: '17'
2118
server-id: github-central
22-
server-password: PACKAGES_CENTRAL_TOKEN
23-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
19+
server-password-env-var: PACKAGES_CENTRAL_TOKEN
20+
gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE
2421
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
2522

2623
- name: Publish to GitHub Packages Central
27-
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
28-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
24+
run: ../mvnw -B deploy -P publish -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
25+
working-directory: src
2926
env:
3027
PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }}
3128
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
@@ -36,13 +33,13 @@ jobs:
3633
distribution: 'temurin'
3734
java-version: '17'
3835
server-id: sonatype-central-portal
39-
server-username: MAVEN_CENTRAL_USERNAME
40-
server-password: MAVEN_CENTRAL_TOKEN
41-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
36+
server-username-env-var: MAVEN_CENTRAL_USERNAME
37+
server-password-env-var: MAVEN_CENTRAL_TOKEN
38+
gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE
4239

4340
- name: Publish to Central Portal
44-
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests
45-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
41+
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal
42+
working-directory: src
4643
env:
4744
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
4845
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}

‎.idea/checkstyle-idea.xml‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
wrapperVersion=3.3.4
22
distributionType=only-script
3-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.10.0/apache-maven-3.10.0-bin.zip

‎.run/Run Demo.run.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
33
<option name="MAIN_CLASS_NAME" value="software.xdev.Application" />
44
<module name="sessionize-java-client-demo" />
5-
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
65
<extension name="coverage">
76
<pattern>
87
<option name="PATTERN" value="software.xdev.*" />

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ If you need support as soon as possible and you can't wait for any pull request,
3636
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.
3737

3838
## Dependencies and Licenses
39-
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/sessionize-java-client/dependencies)
39+
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/sessionize-java-client)

‎demos/pom.xml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>software.xdev</groupId>
9+
<artifactId>root</artifactId>
10+
<version>1.0.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>demos</artifactId>
14+
<packaging>pom</packaging>
15+
16+
<modules>
17+
<module>template-placeholder-demo</module>
18+
</modules>
19+
</project>

0 commit comments

Comments
 (0)