https://github.com/dharmit/wildfly-swarm-with-che
Simple WildFly Swarm example to run on Eclipse Che. Taken from
https://github.com/dharmit/wildfly-swarm-with-che
Last synced: 12 months ago
JSON representation
Simple WildFly Swarm example to run on Eclipse Che. Taken from
- Host: GitHub
- URL: https://github.com/dharmit/wildfly-swarm-with-che
- Owner: dharmit
- License: apache-2.0
- Created: 2017-02-16T10:30:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T10:05:30.000Z (over 9 years ago)
- Last Synced: 2025-02-10T05:29:15.706Z (over 1 year ago)
- Language: Java
- Homepage: https://github.com/wildfly-swarm/wildfly-swarm-examples/tree/master/jaxrs/jaxrs
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JAX-RS .war With Swagger Enabled Example
This example takes a normal JAX-RS build, and wraps it into
a `-swarm` runnable jar with `swagger` enabled on the resources.
> Please raise any issues found with this example in our JIRA:
> https://issues.jboss.org/browse/SWARM
## Project `pom.xml`
This project is a traditional JAX-RS project, with maven packaging
of `war` in the `pom.xml`
war
The project adds a `` to configure `wildfly-swarm-plugin` to
create the runnable `.jar`.
org.wildfly.swarm
wildfly-swarm-plugin
${version.wildfly-swarm}
package
To define the needed parts of WildFly Swarm, a dependency is added
org.wildfly.swarm
jaxrs
${version.wildfly-swarm}
This dependency provides the JAX-RS APIs to your application, so the
project does *not* need to specify those.
To enable the `swagger` fraction, another dependency is added
org.wildfly.swarm
swagger
${version.wildfly-swarm}
This dependency will cause the WildFly Swarm `swagger` fraction to
enable swagger with zero configuration. You can browse the swagger.json
at http://localhost:8080/swagger.json.
Additional application dependencies (in this case `joda-time`) can be
specified and will be included in the normal `.war` construction and available
within the WildFly Swarm application `.jar`.
## Run
* mvn package && java -jar ./target/example-jaxrs-war-swarm.jar
* mvn wildfly-swarm:run
* From your IDE, run class `org.wildfly.swarm.Swarm`
## Use
Since WildFly Swarm apps tend to support one deployment per executable, it
automatically adds a `jboss-web.xml` to the deployment if it doesn't already
exist. This is used to bind the deployment to the root of the web-server,
instead of using the `.war`'s own name as the application context.
http://localhost:8080/
Be aware that you will notice an exception in the logs when accessing the page.
This is simply an overly verbose message from WildFly that the 'favicon.ico' file couldn't be found.