Skip to content

Commit 8af04f6

Browse files
authored
Merge pull request #58 from 4PointSolutions/20251026_Replace_Jersey_With_WebMVC
Replace Eclipse Jersey with Spring MVC
2 parents 307ad76 + c7e222c commit 8af04f6

File tree

51 files changed

+3372
-653
lines changed

Some content is hidden

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

51 files changed

+3372
-653
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Spring Boot Jersey Starter CI
2+
3+
on:
4+
push:
5+
paths:
6+
- 'spring/fluentforms-jersey-spring-boot-**'
7+
- '.github/workflows/spring-boot-jersey-starter-ci.yml'
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: Java ${{ matrix.java }} build
13+
runs-on: ubuntu-latest
14+
continue-on-error: ${{ matrix.experimental }}
15+
strategy:
16+
fail-fast: true
17+
matrix:
18+
java: [ 21 ]
19+
experimental: [false]
20+
include:
21+
- java: 25
22+
experimental: true
23+
24+
steps:
25+
- uses: actions/checkout@v6
26+
- name: Set up JDK ${{ matrix.java }}
27+
uses: actions/setup-java@v5
28+
with:
29+
distribution: 'oracle'
30+
java-version: ${{ matrix.java }}
31+
cache: 'maven'
32+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
33+
settings-path: ${{ github.workspace }} # location for the settings.xml file
34+
35+
- name: Build AutoConfigure with Maven
36+
run: mvn -B install -s $GITHUB_WORKSPACE/settings.xml --file spring/fluentforms-jersey-spring-boot-autoconfigure
37+
env:
38+
GITHUB_TOKEN: ${{ github.token }}
39+
40+
- name: Build AutoConfigure with Maven
41+
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/tags/*') && !matrix.experimental # Only run on main branch or tags and non-experimental
42+
run: mvn -B deploy -s $GITHUB_WORKSPACE/settings.xml --file spring/fluentforms-jersey-spring-boot-autoconfigure
43+
env:
44+
GITHUB_TOKEN: ${{ github.token }}
45+
46+
- name: Publish Starter to GitHub Packages Apache Maven
47+
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/tags/*') && !matrix.experimental # Only run on main branch or tags and non-experimental
48+
run: mvn -B deploy -s $GITHUB_WORKSPACE/settings.xml --file spring/fluentforms-jersey-spring-boot-starter
49+
env:
50+
GITHUB_TOKEN: ${{ github.token }}
51+

.github/workflows/spring-boot-starter-ci.yml renamed to .github/workflows/spring-boot-webmvc-starter-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Spring Boot Starter CI
1+
name: Spring Boot WebMVC Starter CI
22

33
on:
44
push:
55
paths:
66
- 'spring/fluentforms-spring-boot-**'
7-
- '.github/workflows/spring-boot-starter-ci.yml'
7+
- '.github/workflows/spring-boot-webmvc-starter-ci.yml'
88
workflow_dispatch:
99

1010
jobs:
@@ -22,7 +22,7 @@ jobs:
2222
experimental: true
2323

2424
steps:
25-
- uses: actions/checkout@v5
25+
- uses: actions/checkout@v6
2626
- name: Set up JDK ${{ matrix.java }}
2727
uses: actions/setup-java@v5
2828
with:

fluentforms/examples/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,25 @@
1111
<name>FluentForms Examples</name>
1212
<description>Various examples of using the Fluent Forms APIs.</description>
1313

14+
<build>
15+
<!-- This project is an example project, so we don't need to install or deploy it. -->
16+
<plugins>
17+
<plugin>
18+
<artifactId>maven-install-plugin</artifactId>
19+
<configuration>
20+
<skip>true</skip>
21+
</configuration>
22+
</plugin>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-deploy-plugin</artifactId>
26+
<configuration>
27+
<skip>true</skip>
28+
</configuration>
29+
</plugin>
30+
</plugins>
31+
</build>
32+
1433
<dependencies>
1534
<dependency>
1635
<groupId>org.osgi</groupId>

pom.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com._4point.aem.fluentforms</groupId>
6+
<artifactId>fluentforms</artifactId>
7+
<packaging>pom</packaging>
8+
<version>0.0.4-SNAPSHOT</version>
9+
<description>Fluent Forms Spring Boot Starter Projects</description>
10+
11+
<modules>
12+
<!-- Top Level projects -->
13+
<module>fluentforms</module>
14+
<module>rest-services</module>
15+
<module>spring</module>
16+
</modules>
17+
18+
<build>
19+
<!-- This project is a compositing project, so we don't need to install or deploy it. -->
20+
<plugins>
21+
<plugin>
22+
<artifactId>maven-install-plugin</artifactId>
23+
<configuration>
24+
<skip>true</skip>
25+
</configuration>
26+
</plugin>
27+
<plugin>
28+
<groupId>org.apache.maven.plugins</groupId>
29+
<artifactId>maven-deploy-plugin</artifactId>
30+
<configuration>
31+
<skip>true</skip>
32+
</configuration>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
</project>

rest-services/it.tests/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@
3838
<maven.compiler.release>17</maven.compiler.release>
3939
</properties>
4040

41+
<build>
42+
<!-- This project is just integration tests, so we don't need to isntall or deploy it. -->
43+
<plugins>
44+
<plugin>
45+
<artifactId>maven-install-plugin</artifactId>
46+
<configuration>
47+
<skip>true</skip>
48+
</configuration>
49+
</plugin>
50+
<plugin>
51+
<groupId>org.apache.maven.plugins</groupId>
52+
<artifactId>maven-deploy-plugin</artifactId>
53+
<configuration>
54+
<skip>true</skip>
55+
</configuration>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
4160
<dependencies>
4261
<!-- <dependency>
4362
<groupId>org.glassfish.jersey.core</groupId>

spring/ConfigurationProperties.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ be set to `/clientApp` (as in `fluentforms.rproxy.clientPrefix=/clientApp`).
4343

4444
`fluentforms.rproxy.afBaseLocation` - TBD - This needs to be documented.
4545

46+
`fluentforms.rproxy.type` - This is used to set the mechanism used to reverse-proxy secondary resources to AEM. If the value is `springmvc`, then Spring MVC is used to implement the reverse proxy. If it is `jersey`, then JAX-RS Jersey is used. This property is optional and, if omitted, then the autoconfiguration will choose `springmvc` if no other type is available. It will typically use a different implementation if it is available (e.g. if `fluentforms-jersey-spring-starter` is on the class path). This means that under normal circumstances, this setting should not have to be set and is only intended to be used to override the autoconfiguration mechanisms.
47+
48+
4649
### Rest Client Properties
4750

4851
Fluent Forms can be configured to use one of two different REST client libraries. It can use either the Jersey client libraries or the Spring RestClient libraries. it was originally developed to use the Jersey client libraries however this some drawbacks - firstly, the Spring requires special configuration when you combine it with libraries that use the built in Spring Web Mechanisms (e.g. Spring MVC, Spring Boot Activator, etc. - see [https://docs.spring.io/spring-boot/how-to/jersey.html](https://docs.spring.io/spring-boot/how-to/jersey.html)). Secondly, Spring Jersey is an extra dependency that duplicates functionality that is already available in the Spring Framework, so it causes some jar bloat.
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<parent>
4+
<groupId>org.springframework.boot</groupId>
5+
<artifactId>spring-boot-starter-parent</artifactId>
6+
<version>3.5.7</version>
7+
<relativePath /> <!-- lookup parent from repository -->
8+
</parent>
9+
<groupId>com._4point.aem.fluentforms</groupId>
10+
<artifactId>fluentforms-jersey-spring-boot-autoconfigure</artifactId>
11+
<version>0.0.4-SNAPSHOT</version>
12+
<name>FluentForms Jersey AutoConfigure Project</name>
13+
14+
<properties>
15+
<java.version>17</java.version>
16+
<jasypt.spring.boot.version>3.0.5</jasypt.spring.boot.version>
17+
<jasypt.maven.plugin.version>3.0.5</jasypt.maven.plugin.version>
18+
<fluentforms.version>0.0.4-SNAPSHOT</fluentforms.version>
19+
<fluentforms-autoconfigure.version>0.0.4-SNAPSHOT</fluentforms-autoconfigure.version>
20+
21+
<!-- Testing Dependencies -->
22+
<fp.hamcrest.matchers.version>0.0.4-SNAPSHOT</fp.hamcrest.matchers.version>
23+
<wiremock.version>4.0.0-beta.16</wiremock.version>
24+
<pitest.maven.plugin.version>1.20.2</pitest.maven.plugin.version>
25+
<pitest.junit5.maven.plugin.version>1.2.3</pitest.junit5.maven.plugin.version>
26+
</properties>
27+
28+
<distributionManagement>
29+
<repository>
30+
<id>github</id>
31+
<name>4Point Solutions FluentFormsAPI Apache Maven Packages</name>
32+
<url>https://maven.pkg.github.com/4PointSolutions/FluentFormsAPI</url>
33+
</repository>
34+
</distributionManagement>
35+
36+
<repositories>
37+
<repository>
38+
<id>github</id>
39+
<url>https://maven.pkg.github.com/4PointSolutions/*</url>
40+
<snapshots>
41+
<enabled>true</enabled>
42+
</snapshots>
43+
</repository>
44+
</repositories>
45+
46+
47+
<dependencies>
48+
<!-- Project Dependencies -->
49+
<dependency>
50+
<groupId>org.springframework.boot</groupId>
51+
<artifactId>spring-boot</artifactId>
52+
</dependency>
53+
<dependency>
54+
<groupId>com.github.ulisesbocchio</groupId>
55+
<artifactId>jasypt-spring-boot-starter</artifactId>
56+
<version>${jasypt.spring.boot.version}</version>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.springframework.boot</groupId>
60+
<artifactId>spring-boot-autoconfigure</artifactId>
61+
<scope>compile</scope>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.springframework.boot</groupId>
65+
<artifactId>spring-boot-autoconfigure-processor</artifactId>
66+
<optional>true</optional>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.springframework.boot</groupId>
70+
<artifactId>spring-boot-starter-jersey</artifactId>
71+
<optional>true</optional>
72+
<scope>provided</scope>
73+
</dependency>
74+
<dependency>
75+
<groupId>com._4point.aem.fluentforms</groupId>
76+
<artifactId>fluentforms-spring-boot-autoconfigure</artifactId>
77+
<version>${fluentforms-autoconfigure.version}</version>
78+
</dependency>
79+
<dependency>
80+
<groupId>com._4point.aem</groupId>
81+
<artifactId>fluentforms.core</artifactId>
82+
<version>${fluentforms.version}</version>
83+
</dependency>
84+
<dependency>
85+
<groupId>com._4point.aem.docservices</groupId>
86+
<artifactId>rest-services.client</artifactId>
87+
<version>${fluentforms.version}</version>
88+
</dependency>
89+
<dependency>
90+
<groupId>com._4point.aem.docservices.rest-services</groupId>
91+
<artifactId>rest-services.jersey-client</artifactId>
92+
<version>${fluentforms.version}</version>
93+
</dependency>
94+
<!-- Testing Dependencies -->
95+
<dependency>
96+
<groupId>org.springframework.boot</groupId>
97+
<artifactId>spring-boot-starter-test</artifactId>
98+
<scope>test</scope>
99+
</dependency>
100+
<dependency>
101+
<groupId>com.4point.testing</groupId>
102+
<artifactId>4point-hamcrest-matchers</artifactId>
103+
<version>${fp.hamcrest.matchers.version}</version>
104+
<scope>test</scope>
105+
</dependency>
106+
<dependency>
107+
<groupId>org.wiremock</groupId>
108+
<artifactId>wiremock-standalone</artifactId>
109+
<version>${wiremock.version}</version>
110+
<scope>test</scope>
111+
</dependency>
112+
<dependency>
113+
<groupId>org.pitest</groupId>
114+
<artifactId>pitest-junit5-plugin</artifactId>
115+
<version>${pitest.junit5.maven.plugin.version}</version>
116+
<scope>test</scope>
117+
</dependency>
118+
</dependencies>
119+
<build>
120+
<plugins>
121+
<!-- Useful in case you want to change the password or secret key
122+
for the jasypt data -->
123+
<!-- To change password or key
124+
- Navigate to directory where
125+
this pom resides
126+
- In command line execute:
127+
mvn
128+
jasypt:encrypt-value -Djasypt.encryptor.password=SECRET_KEY
129+
-Djasypt.plugin.value=VALUE_TO_BE_ENCRYPTED
130+
- SECRET_KEY is the
131+
value that is used to encrypt/decrypt
132+
- Alternatively you can
133+
download the plugin jar an execute the command from the location
134+
where the plugin jar reside
135+
-->
136+
<plugin>
137+
<groupId>com.github.ulisesbocchio</groupId>
138+
<artifactId>jasypt-maven-plugin</artifactId>
139+
<version>${jasypt.maven.plugin.version}</version>
140+
</plugin>
141+
<plugin>
142+
<groupId>org.apache.maven.plugins</groupId>
143+
<artifactId>maven-source-plugin</artifactId>
144+
</plugin>
145+
<plugin>
146+
<groupId>org.apache.maven.plugins</groupId>
147+
<artifactId>maven-surefire-plugin</artifactId>
148+
<configuration>
149+
<excludes>
150+
<exclude/>
151+
</excludes>
152+
</configuration>
153+
</plugin>
154+
<plugin>
155+
<!-- PiTest Mutation Testing plugin -->
156+
<!-- Run with goals 'test-compile' and 'org.pitest:pitest-maven:mutationCoverage' -->
157+
<groupId>org.pitest</groupId>
158+
<artifactId>pitest-maven</artifactId>
159+
<version>${pitest.maven.plugin.version}</version>
160+
</plugin>
161+
</plugins>
162+
</build>
163+
164+
</project>

0 commit comments

Comments
 (0)