Skip to content

Commit 95aefba

Browse files
committed
chore: clean up
1 parent c176769 commit 95aefba

File tree

11 files changed

+85
-225
lines changed

11 files changed

+85
-225
lines changed

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@
22

33

44

5-
![Compile and build](https://github.com/hantsy/jakartaee-mvc-sample/workflows/build/badge.svg)
5+
[![build](https://github.com/hantsy/jakartaee-mvc-sample/actions/workflows/build.yml/badge.svg)](https://github.com/hantsy/jakartaee-mvc-sample/actions/workflows/build.yml)
66

7-
> NOTE: The source codes is updated to Jakarta EE 10, and tested on GlassFish 7.0.0.M10 and WildFly Preview 27.0.0.Final. OpenLiberty support will be added in future when it gets complete support of Jakarta EE 10.
7+
As an alternative of Jakarta Faces which is used to build web UI with components, [Jakarta MVC](https://www.mvc-spec.org/) spec is similar with the transactional MVC framework, such as Apache Struts, Spring MVC, etc. which provides capability for building action-based web applications.
88

9-
> The Jakarta EE 8 based codes was archived and also tagged with [v1.0 tag](https://github.com/hantsy/jakartaee-mvc-sample/releases/tag/v1.0).
9+
The repository has already been upgraded to Jakarta EE 10.
1010

11-
As an alternative of Jakarta Faces which is used to build web UI with components, Jakarta EE MVC spec is similar with the transactional MVC framework, such as Apache Struts, Spring MVC, etc. which provides capability for building action-based web applications.
11+
* For the Jakarta EE 8 based codes was archived and also tagged with [v1.0 tag](https://github.com/hantsy/jakartaee-mvc-sample/releases/tag/v1.0).
1212

13-
In this sample application, we will build a web application with [Jakarta MVC specification](https://www.mvc-spec.org/). Jakarta MVC is based on the existing JAX-RS specs, it reuses the JAX-RS APIs, and add some additional APIs to the specific *action* features.
13+
[Jakarta MVC](https://www.mvc-spec.org/) is based on the existing JAX-RS specs, it reuses the JAX-RS APIs, and add some additional APIs to the specific *action* features.
1414

15-
[Eclipse Krazo](https://projects.eclipse.org/projects/ee4j.krazo) is the reference implementation of Jakarta MVC, it supports the following JAXRS platforms.
15+
[Eclipse Krazo](https://projects.eclipse.org/projects/ee4j.krazo) is the only implementation of Jakarta MVC, it supports the following Jakarta REST implementors.
1616

1717
* Jersey (Glassfish/Payara)
1818
* Resteasy( Wildfly)
1919
* <del>Apache CXF</del> MVC 2.0 remove CXF support.
2020

21-
22-
2321
![home](./home.png)
2422

2523
## Docs
@@ -34,14 +32,20 @@ In this sample application, we will build a web application with [Jakarta MVC sp
3432
git clone https://github.com/hantsy/jakartaee-mvc-sample
3533
```
3634

37-
2. Run on Glassfish, Wildfly or Open Liberty.
35+
2. Run on Glassfish.
3836

3937
```bash
4038
mvn clean package cargo:run -pglassfish
41-
mvn clean wildfly:run -Pwildfly
42-
mvn clean liberty:create dependency:copy liberty:run -Popenliberty
4339
```
4440

41+
3. Run test against GlassFish managed adapter.
42+
43+
```bash
44+
mvn clean verify -Parg-glassfish-managed
45+
```
46+
47+
> [!WARNING]
48+
> To reduce maintenance costs, I have removed the configuration for running the applications on WildFly, OpenLiberty, Payara, etc. If you need to run it on these application servers, please refer to [jakartaee9-starter-boilerplate](https://github.com/hantsy/jakartaee9-starter-boilerplate) or [jakartaee10-starter-boilerplate](https://github.com/hantsy/jakartaee10-starter-boilerplate) and add the configuration yourself.
4549
4650
## Reference
4751

pom.xml

Lines changed: 25 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@
3434

3535
<!-- Arquillian BOM -->
3636
<arquillian.version>1.10.0.Final</arquillian.version>
37-
<!-- Since Aruqillian core 1.9.0.Final, need to add Aruqillian Jakarta BOM which aligns to Jakarta EE -->
37+
<!-- Since Arquillian core 1.9.0.Final, need to add Arquillian Jakarta BOM which aligns to Jakarta EE -->
3838
<arquillian-jakarta-bom.version>10.0.0.Final</arquillian-jakarta-bom.version>
3939
<shrinkwrap-resolver-bom.version>3.3.5</shrinkwrap-resolver-bom.version>
4040
<arquillian-drone.version>3.0.0.Final</arquillian-drone.version>
4141
<arquillian-graphene.version>3.0.0.Final</arquillian-graphene.version>
42+
43+
<!-- tests -->
4244
<junit-bom.version>6.0.3</junit-bom.version>
4345
<mockito-bom.version>5.21.0</mockito-bom.version>
4446
<awaitility.version>4.3.0</awaitility.version>
4547
<hamcrest.version>3.0</hamcrest.version>
4648

47-
4849
<!-- Glassfish server -->
4950
<glassfish.version>7.0.24</glassfish.version>
5051
<arquillian-glassfish.version>7.0.14</arquillian-glassfish.version>
5152
<jersey.version>3.1.0</jersey.version>
52-
<derbyclient.version>10.17.1.0</derbyclient.version>
53-
<eclipselink.version>4.0.4</eclipselink.version>
53+
<eclipselink.version>4.0.9</eclipselink.version>
5454

5555
<!-- By default, skip tests -->
5656
<skipTests>true</skipTests>
@@ -116,22 +116,25 @@
116116
<dependency>
117117
<groupId>jakarta.mvc</groupId>
118118
<artifactId>jakarta.mvc-api</artifactId>
119-
<version>${jakarta.mvc-api}</version>
119+
<version>${jakarta.mvc-api.version}</version>
120120
</dependency>
121121
<!-- https://mvnrepository.com/artifact/org.eclipse.krazo/krazo-jersey -->
122122
<dependency>
123123
<groupId>org.eclipse.krazo</groupId>
124124
<artifactId>krazo-core</artifactId>
125125
<version>${krazo.version}</version>
126+
<scope>provided</scope>
126127
</dependency>
127128
<dependency>
128129
<groupId>org.eclipse.krazo</groupId>
129130
<artifactId>krazo-jersey</artifactId>
131+
<scope>provided</scope>
130132
<version>${krazo.version}</version>
131133
</dependency>
132134
<dependency>
133135
<groupId>org.eclipse.krazo</groupId>
134136
<artifactId>krazo-resteasy</artifactId>
137+
<scope>provided</scope>
135138
<version>${krazo.version}</version>
136139
</dependency>
137140
<dependency>
@@ -175,6 +178,10 @@
175178
<groupId>org.eclipse.krazo</groupId>
176179
<artifactId>krazo-core</artifactId>
177180
</dependency>
181+
<dependency>
182+
<groupId>org.eclipse.krazo</groupId>
183+
<artifactId>krazo-jersey</artifactId>
184+
</dependency>
178185
<dependency>
179186
<groupId>jakarta.mvc</groupId>
180187
<artifactId>jakarta.mvc-api</artifactId>
@@ -236,6 +243,15 @@
236243
<groupId>org.apache.maven.plugins</groupId>
237244
<artifactId>maven-compiler-plugin</artifactId>
238245
<version>${maven-compiler-plugin.version}</version>
246+
<configuration>
247+
<annotationProcessorPaths>
248+
<path>
249+
<groupId>org.eclipse.persistence</groupId>
250+
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
251+
<version>${eclipselink.version}</version>
252+
</path>
253+
</annotationProcessorPaths>
254+
</configuration>
239255
</plugin>
240256
<plugin>
241257
<groupId>org.apache.maven.plugins</groupId>
@@ -294,138 +310,15 @@
294310
</build>
295311

296312
<profiles>
297-
298-
<profile>
299-
<id>wildfly</id>
300-
<dependencies>
301-
<dependency>
302-
<groupId>org.eclipse.krazo</groupId>
303-
<artifactId>krazo-resteasy</artifactId>
304-
</dependency>
305-
</dependencies>
306-
<properties>
307-
<!-- Wildfly server -->
308-
<wildfly.artifactId>wildfly-preview-dist</wildfly.artifactId>
309-
<jboss-as.home>${project.build.directory}/wildfly-preview-${wildfly.version}</jboss-as.home>
310-
</properties>
311-
<build>
312-
<plugins>
313-
314-
<!-- unpack a copy of WildFly-->
315-
<plugin>
316-
<groupId>org.apache.maven.plugins</groupId>
317-
<artifactId>maven-dependency-plugin</artifactId>
318-
<version>${maven-dependency-plugin.version}</version>
319-
<executions>
320-
<execution>
321-
<id>unpack</id>
322-
<phase>process-classes</phase>
323-
<goals>
324-
<goal>unpack</goal>
325-
</goals>
326-
<configuration>
327-
<artifactItems>
328-
<artifactItem>
329-
<groupId>org.wildfly</groupId>
330-
<artifactId>${wildfly.artifactId}</artifactId>
331-
<version>${wildfly.version}</version>
332-
<type>zip</type>
333-
<overWrite>false</overWrite>
334-
<outputDirectory>${project.build.directory}</outputDirectory>
335-
</artifactItem>
336-
</artifactItems>
337-
</configuration>
338-
</execution>
339-
</executions>
340-
</plugin>
341-
342-
<!-- The WildFly plugin deploys your war to a local running WildFly container -->
343-
<!-- To use, run: mvn package wildfly:deploy -->
344-
<!-- For Jakarta EE 9, use `wildfly-preview-dist` as artifactId instead to start and deploy applications-->
345-
<!-- Run: mvn clean wildfly:run -PWildfly -Dwildfly.artifactId=wildfly-preview-dist -Dwildfly.version=22.0.0.Alpha1 -->
346-
<!-- or set the `jboss-as.home` to run: mvn clean wildfly:run -PWildfly -Djboss-as.home=D:\appsvr\wildfly-preview-22.0.0.Alpha1-->
347-
<plugin>
348-
<groupId>org.wildfly.plugins</groupId>
349-
<artifactId>wildfly-maven-plugin</artifactId>
350-
<version>${wildfly-maven-plugin.version}</version>
351-
</plugin>
352-
</plugins>
353-
</build>
354-
<repositories>
355-
<repository>
356-
<id>opensaml</id>
357-
<url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
358-
</repository>
359-
</repositories>
360-
</profile>
361-
<profile>
362-
<id>openliberty</id>
363-
<dependencies>
364-
<dependency>
365-
<groupId>org.eclipse.krazo</groupId>
366-
<artifactId>krazo-resteasy</artifactId>
367-
</dependency>
368-
</dependencies>
369-
<build>
370-
<plugins>
371-
<plugin>
372-
<groupId>org.apache.maven.plugins</groupId>
373-
<artifactId>maven-dependency-plugin</artifactId>
374-
<version>${maven-dependency-plugin.version}</version>
375-
<executions>
376-
<execution>
377-
<id>copy</id>
378-
<phase>package</phase>
379-
<goals>
380-
<goal>copy</goal>
381-
</goals>
382-
</execution>
383-
</executions>
384-
<configuration>
385-
<artifactItems>
386-
<artifactItem>
387-
<groupId>org.apache.derby</groupId>
388-
<artifactId>derby</artifactId>
389-
<version>${derby.version}</version>
390-
<type>jar</type>
391-
<overWrite>false</overWrite>
392-
</artifactItem>
393-
</artifactItems>
394-
<outputDirectory>${project.build.directory}/liberty/wlp/usr/shared/resources
395-
</outputDirectory>
396-
</configuration>
397-
</plugin>
398-
<!-- Enable liberty-maven-plugin -->
399-
<plugin>
400-
<groupId>io.openliberty.tools</groupId>
401-
<artifactId>liberty-maven-plugin</artifactId>
402-
<version>${liberty-maven-plugin.version}</version>
403-
</plugin>
404-
</plugins>
405-
</build>
406-
</profile>
407313
<profile>
408314
<id>glassfish</id>
409315
<activation>
410316
<activeByDefault>true</activeByDefault>
411317
</activation>
412318
<properties>
413-
<cargo.zipUrlInstaller.downloadDir>${project.basedir}/installs</cargo.zipUrlInstaller.downloadDir>
319+
<cargo.zipUrlInstaller.downloadDir>${project.basedir}/../installs</cargo.zipUrlInstaller.downloadDir>
414320
</properties>
415321
<dependencies>
416-
<!-- https://mvnrepository.com/artifact/org.eclipse.krazo/krazo-jersey -->
417-
<dependency>
418-
<groupId>org.eclipse.krazo</groupId>
419-
<artifactId>krazo-jersey</artifactId>
420-
<version>${krazo.version}</version>
421-
<scope>provided</scope>
422-
</dependency>
423-
<dependency>
424-
<groupId>org.eclipse.krazo</groupId>
425-
<artifactId>krazo-core</artifactId>
426-
<version>${krazo.version}</version>
427-
<scope>provided</scope>
428-
</dependency>
429322
</dependencies>
430323
<build>
431324
<plugins>
@@ -473,21 +366,9 @@
473366
</properties>
474367
<dependencies>
475368
<dependency>
476-
<groupId>org.eclipse.krazo</groupId>
477-
<artifactId>krazo-jersey</artifactId>
478-
<version>${krazo.version}</version>
479-
<scope>provided</scope>
480-
</dependency>
481-
<dependency>
482-
<groupId>org.eclipse.krazo</groupId>
483-
<artifactId>krazo-core</artifactId>
484-
<version>${krazo.version}</version>
485-
<scope>provided</scope>
486-
</dependency>
487-
<dependency>
488-
<groupId>com.github.hantsy.arquillian-container-glassfish-jakarta</groupId>
489-
<artifactId>arquillian-glassfish-managed-jakarta</artifactId>
490-
<version>${arquillian-glassfish-jakarta.version}</version>
369+
<groupId>io.github.hantsy.arquillian</groupId>
370+
<artifactId>arquillian-glassfish-managed</artifactId>
371+
<version>${arquillian-glassfish.version}</version>
491372
<scope>test</scope>
492373
</dependency>
493374
</dependencies>
@@ -547,12 +428,6 @@
547428
<browser>chrome</browser>
548429
</properties>
549430
</profile>
550-
<profile>
551-
<id>chromeheadless</id>
552-
<properties>
553-
<browser>chromeheadless</browser>
554-
</properties>
555-
</profile>
556431
</profiles>
557432
<reporting>
558433
<plugins>
@@ -563,10 +438,4 @@
563438
</plugin>
564439
</plugins>
565440
</reporting>
566-
<repositories>
567-
<repository>
568-
<id>jitpack.io</id>
569-
<url>https://jitpack.io</url>
570-
</repository>
571-
</repositories>
572441
</project>

src/main/webapp/WEB-INF/layout/alert.xhtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
role="alert">
66
${flashMessage.text}
77
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
8-
<span class="fa fa-times-circle" aria-hidden="true">${null}</span>
8+
<i class="bi bi-x-circle">${null}</i>
99
</button>
1010
</div>
1111
</ui:fragment>
@@ -16,7 +16,7 @@
1616
role="alert">
1717
<strong>${error.field}</strong>: ${error.message}
1818
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
19-
<span class="fa fa-times-circle" aria-hidden="true">${null}</span>
19+
<i class="bi bi-x-circle">${null}</i>
2020
</button>
2121
</div>
2222
</ui:repeat>

src/main/webapp/WEB-INF/layout/footer.xhtml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
<div class="text-center">
66
<strong>Copyright@</strong>
77
<span class="text-muted">Hantsy Bai hantsy@gmail.com</span>
8+
<span class="ms-3">
9+
<a class="text-muted mx-2" href="https://x.com/hantsy" target="_blank" rel="noopener noreferrer" aria-label="X @hantsy"><i class="bi bi-twitter-x fs-4"></i></a>
10+
<a class="text-muted mx-2" href="https://github.com/hantsy" target="_blank" rel="noopener noreferrer" aria-label="GitHub @hantsy"><i class="bi bi-github fs-4"></i></a>
11+
<a class="text-muted mx-2" href="https://www.linkedin.com/in/hantsy" target="_blank" rel="noopener noreferrer" aria-label="LinkedIn hantsy"><i class="bi bi-linkedin fs-4"></i></a>
12+
</span>
813
</div>
914
</div>
1015
</footer>

src/main/webapp/WEB-INF/layout/header.xhtml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
<li class="nav-item">
2323
<!--<a class="nav-link" href="#{mvc.uri('TaskController#add')}">Home</a>-->
2424
<a class="nav-link" href="#{mvc.basePath}/tasks/new">
25-
<i class="fa fa-plus-circle">${null}</i>
26-
New Task
27-
</a>
25+
<i class="bi bi-plus-circle-fill"></i> New Task</a>
2826
</li>
2927
</ul>
3028
</div>

src/main/webapp/WEB-INF/layout/template.xhtml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,13 @@
99
<meta charset="utf-8"/>
1010
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
1111

12-
<!-- FontAwesome -->
13-
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
14-
rel="stylesheet"
15-
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
16-
crossorigin="anonymous"/>
17-
1812
<!-- styles -->
1913
<link rel="stylesheet"
2014
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
2115
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
2216
crossorigin="anonymous"/>
23-
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
24-
rel="stylesheet"
25-
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
26-
crossorigin="anonymous"/>
17+
<link rel="stylesheet"
18+
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"/>
2719
<link href="#{request.contextPath}/resources/css/main.css" rel="stylesheet"/>
2820
<ui:insert name="headIncludes"></ui:insert>
2921
</head>
@@ -62,5 +54,6 @@
6254
crossorigin="anonymous">
6355
/** stop autoclosing **/
6456
</script>
57+
<ui:insert name="bodyIncludes"></ui:insert>
6558
</body>
6659
</html>

0 commit comments

Comments
 (0)