Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justin-tay/jetty-weld-war-example
Web Application Resource example with Weld for Jetty 12.
https://github.com/justin-tay/jetty-weld-war-example
Last synced: about 1 month ago
JSON representation
Web Application Resource example with Weld for Jetty 12.
- Host: GitHub
- URL: https://github.com/justin-tay/jetty-weld-war-example
- Owner: justin-tay
- License: apache-2.0
- Created: 2023-08-22T21:19:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-03T08:58:23.000Z (about 1 year ago)
- Last Synced: 2023-09-04T11:54:19.300Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jetty Weld WAR Example
## Quick Start
### Jetty 12
#### Run
```shell
mvn package cargo:run
```#### Debug
```shell
mvn package cargo:run -Dcargo.debug=true
```This will add `-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y`.
#### Test
```shell
mvn verify
```## Deploy
### Jetty 12
The `JETTY_BASE` needs to be set up with the following with the war deployed at `JETTY_BASE/webapp`.
```shell
cd $JETTY_BASE
java -jar $JETTY_HOME/start.jar --add-modules=http,ee10-deploy,ee10-annotations,ee10-websocket-jakarta,ee10-cdi-decorate
```Currently Jetty 12 requires a custom `ServletContainerInitializer` to explicitly set the CDI Provider to the `WeldProvider` due to the following issue https://github.com/eclipse/jetty.project/issues/10150 as the presence of the `jakarta.enterprise.cdi-api` library in the Jetty classpath causes the `ServiceLoader` not to find the `WeldProvider`. This is implemented in `WeldServletContainerInitializer`.
## Starting
### Jetty 12
The server can be started with the following.
```shell
cd $JETTY_BASE
java -jar $JETTY_HOME/start.jar
```