Skip to content

Commit e70b710

Browse files
committed
Modularize, move and introduce bom
1 parent d2afb24 commit e70b710

File tree

116 files changed

+199
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+199
-42
lines changed

β€Ž.github/workflows/release.yml

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

7-
env:
8-
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
9-
107
permissions:
118
contents: write
129
pull-requests: write
@@ -66,10 +63,9 @@ jobs:
6663
- name: Get version
6764
id: version
6865
run: |
69-
version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
66+
version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
7067
echo "release=$version" >> $GITHUB_OUTPUT
7168
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
72-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
7369
7470
- name: Commit and Push
7571
run: |
@@ -94,12 +90,14 @@ jobs:
9490
Add the following lines to your pom:
9591
```XML
9692
<dependency>
97-
<groupId>software.xdev</groupId>
98-
<artifactId>${{ env.PRIMARY_MAVEN_MODULE }}</artifactId>
93+
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
94+
<artifactId>flow</artifactId>
9995
<version>${{ steps.version.outputs.release }}</version>
10096
</dependency>
10197
```
10298
99+
You can also use the [BOM](https://github.com/${{ github.repository }}/tree/develop/bom) for easier dependency management.
100+
103101
### Additional notes
104102
* [Spring-Boot] You may have to include ``software/xdev`` inside [``vaadin.allowed-packages``](https://vaadin.com/docs/latest/integrations/spring/configuration#configure-the-scanning-of-packages)
105103
@@ -125,14 +123,19 @@ jobs:
125123
server-password: PACKAGES_CENTRAL_TOKEN
126124
gpg-passphrase: MAVEN_GPG_PASSPHRASE
127125
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
128-
129-
- name: Publish to GitHub Packages Central
130-
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
131-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
126+
127+
- name: Publish to GitHub Packages
128+
run: |
129+
modules=("bom")
130+
dependency_management_block=$(grep -ozP '<dependencyManagement>(\r|\n|.)*<\/dependencyManagement>' 'bom/pom.xml' | tr -d '\0')
131+
modules+=($(echo $dependency_management_block | grep -oP '(?<=<artifactId>)[^<]+'))
132+
printf -v modules_joined '%s,' "${modules[@]}"
133+
modules_arg=$(echo "${modules_joined%,}")
134+
./mvnw -B deploy -pl "$modules_arg" -am -T2C -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
132135
env:
133136
PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }}
134137
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
135-
138+
136139
- name: Set up JDK
137140
uses: actions/setup-java@v4
138141
with: # running setup-java again overwrites the settings.xml
@@ -144,12 +147,17 @@ jobs:
144147
gpg-passphrase: MAVEN_GPG_PASSPHRASE
145148

146149
- name: Publish to Central Portal
147-
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests
150+
run: |
151+
modules=("bom")
152+
dependency_management_block=$(grep -ozP '<dependencyManagement>(\r|\n|.)*<\/dependencyManagement>' 'bom/pom.xml' | tr -d '\0')
153+
modules+=($(echo $dependency_management_block | grep -oP '(?<=<artifactId>)[^<]+'))
154+
printf -v modules_joined '%s,' "${modules[@]}"
155+
modules_arg=$(echo "${modules_joined%,}")
156+
./mvnw -B deploy -pl "$modules_arg" -am -T2C -P publish,publish-sonatype-central-portal -DskipTests
148157
env:
149158
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
150159
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}
151160
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
152-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
153161

154162
publish-pages:
155163
runs-on: ubuntu-latest
@@ -172,14 +180,22 @@ jobs:
172180
cache: 'maven'
173181

174182
- name: Build site
175-
run: ../mvnw -B compile site -DskipTests -T2C
176-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
183+
run: ./mvnw -B compile site -DskipTests -T2C
184+
185+
- name: Aggregate site
186+
run: |
187+
modules=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0'))
188+
for m in "${modules[@]}"
189+
do
190+
echo "$m/target/site -> ./target/site/$m"
191+
cp -r $m/target/site ./target/site/$m
192+
done
177193
178194
- name: Deploy to Github pages
179195
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
180196
with:
181197
github_token: ${{ secrets.GITHUB_TOKEN }}
182-
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
198+
publish_dir: ./target/site
183199
force_orphan: true
184200

185201
after-release:

β€Ž.github/workflows/test-deploy.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,18 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16-
- name: Set up JDK
17-
uses: actions/setup-java@v4
18-
with: # running setup-java overwrites the settings.xml
19-
distribution: 'temurin'
20-
java-version: '17'
21-
server-id: github-central
22-
server-password: PACKAGES_CENTRAL_TOKEN
23-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
24-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
25-
26-
- 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 }}
16+
- name: Publish to GitHub Packages
17+
run: |
18+
modules=("bom")
19+
dependency_management_block=$(grep -ozP '<dependencyManagement>(\r|\n|.)*<\/dependencyManagement>' 'bom/pom.xml' | tr -d '\0')
20+
modules+=($(echo $dependency_management_block | grep -oP '(?<=<artifactId>)[^<]+'))
21+
printf -v modules_joined '%s,' "${modules[@]}"
22+
modules_arg=$(echo "${modules_joined%,}")
23+
./mvnw -B deploy -pl "$modules_arg" -am -T2C -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
2924
env:
3025
PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }}
3126
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
32-
27+
3328
- name: Set up JDK
3429
uses: actions/setup-java@v4
3530
with: # running setup-java again overwrites the settings.xml
@@ -41,8 +36,13 @@ jobs:
4136
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4237

4338
- name: Publish to Central Portal
44-
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests
45-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
39+
run: |
40+
modules=("bom")
41+
dependency_management_block=$(grep -ozP '<dependencyManagement>(\r|\n|.)*<\/dependencyManagement>' 'bom/pom.xml' | tr -d '\0')
42+
modules+=($(echo $dependency_management_block | grep -oP '(?<=<artifactId>)[^<]+'))
43+
printf -v modules_joined '%s,' "${modules[@]}"
44+
modules_arg=$(echo "${modules_joined%,}")
45+
./mvnw -B deploy -pl "$modules_arg" -am -T2C -P publish,publish-sonatype-central-portal -DskipTests
4646
env:
4747
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
4848
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}

β€Žbom/pom.xml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
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+
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
8+
<artifactId>bom</artifactId>
9+
<version>5.0.0-SNAPSHOT</version>
10+
<packaging>pom</packaging>
11+
12+
<name>bom</name>
13+
<description>LeafletMap for Vaadin - BOM</description>
14+
<url>https://github.com/xdev-software/vaadin-maps-leaflet-flow</url>
15+
16+
<scm>
17+
<url>https://github.com/xdev-software/vaadin-maps-leaflet-flow</url>
18+
<connection>scm:git:https://github.com/xdev-software/vaadin-maps-leaflet-flow.git</connection>
19+
</scm>
20+
21+
<inceptionYear>2019</inceptionYear>
22+
23+
<organization>
24+
<name>XDEV Software</name>
25+
<url>https://xdev.software</url>
26+
</organization>
27+
28+
<developers>
29+
<developer>
30+
<name>XDEV Software</name>
31+
<organization>XDEV Software</organization>
32+
<url>https://xdev.software</url>
33+
</developer>
34+
</developers>
35+
36+
<licenses>
37+
<license>
38+
<name>Apache-2.0</name>
39+
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
40+
<distribution>repo</distribution>
41+
</license>
42+
</licenses>
43+
44+
<properties>
45+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
46+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
47+
</properties>
48+
49+
<dependencyManagement>
50+
<dependencies>
51+
<dependency>
52+
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
53+
<artifactId>flow</artifactId>
54+
<version>5.0.0-SNAPSHOT</version>
55+
</dependency>
56+
</dependencies>
57+
</dependencyManagement>
58+
59+
<build>
60+
<pluginManagement>
61+
<plugins>
62+
<plugin>
63+
<groupId>org.apache.maven.plugins</groupId>
64+
<artifactId>maven-site-plugin</artifactId>
65+
<version>4.0.0-M16</version>
66+
</plugin>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-project-info-reports-plugin</artifactId>
70+
<version>3.9.0</version>
71+
</plugin>
72+
</plugins>
73+
</pluginManagement>
74+
</build>
75+
<profiles>
76+
<profile>
77+
<id>publish</id>
78+
<build>
79+
<plugins>
80+
<plugin>
81+
<groupId>org.codehaus.mojo</groupId>
82+
<artifactId>flatten-maven-plugin</artifactId>
83+
<version>1.7.2</version>
84+
<configuration>
85+
<flattenMode>bom</flattenMode>
86+
</configuration>
87+
<executions>
88+
<execution>
89+
<id>flatten</id>
90+
<phase>process-resources</phase>
91+
<goals>
92+
<goal>flatten</goal>
93+
</goals>
94+
</execution>
95+
</executions>
96+
</plugin>
97+
<plugin>
98+
<groupId>org.apache.maven.plugins</groupId>
99+
<artifactId>maven-gpg-plugin</artifactId>
100+
<version>3.2.8</version>
101+
<executions>
102+
<execution>
103+
<id>sign-artifacts</id>
104+
<phase>verify</phase>
105+
<goals>
106+
<goal>sign</goal>
107+
</goals>
108+
<configuration>
109+
<!-- Fixes "gpg: signing failed: Inappropriate ioctl for device" -->
110+
<!-- Prevent `gpg` from using pinentry programs -->
111+
<gpgArguments>
112+
<arg>--pinentry-mode</arg>
113+
<arg>loopback</arg>
114+
</gpgArguments>
115+
</configuration>
116+
</execution>
117+
</executions>
118+
</plugin>
119+
</plugins>
120+
</build>
121+
</profile>
122+
<profile>
123+
<id>publish-sonatype-central-portal</id>
124+
<build>
125+
<plugins>
126+
<plugin>
127+
<groupId>org.sonatype.central</groupId>
128+
<artifactId>central-publishing-maven-plugin</artifactId>
129+
<version>0.8.0</version>
130+
<extensions>true</extensions>
131+
<configuration>
132+
<publishingServerId>sonatype-central-portal</publishingServerId>
133+
<autoPublish>true</autoPublish>
134+
</configuration>
135+
</plugin>
136+
</plugins>
137+
</build>
138+
</profile>
139+
</profiles>
140+
</project>

β€Žvaadin-maps-leaflet-flow-demo/pom.xml renamed to β€Žflow-demo/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<parent>
8-
<groupId>software.xdev</groupId>
9-
<artifactId>vaadin-maps-leaflet-flow-root</artifactId>
8+
<groupId>software.xdev.vaadin.maps_leaflet</groupId>
9+
<artifactId>root</artifactId>
1010
<version>5.0.0-SNAPSHOT</version>
1111
</parent>
1212

13-
<artifactId>vaadin-maps-leaflet-flow-demo</artifactId>
13+
<artifactId>flow-demo</artifactId>
1414
<version>5.0.0-SNAPSHOT</version>
1515
<packaging>jar</packaging>
1616

0 commit comments

Comments
Β (0)