eclipse-ee4j / eclipse-ee4j/starter
Add example of starting application via java -jar
- Dominant language
- HTML
- Stars
- 60
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
I'd love to see an option to start a project with an embedded runtime, and have it package a single jar.
Possibly by using SeBootstrap and an SeContainer, something like:
```java
SeContainer container = SeContainerInitializer.newInstance()
.addPackages(true, ExampleApplication.class)
.initialize();
ExampleApplication app = new ExampleApplication();
SeBootstrap.start(app, SeBootstrap.Configuration.builder().port(8080).build())
.thenAccept(instance -> instance.stopOnShutdown(stopResult -> container.close()));
URI uri = UriBuilder.fromUri("http://localhost/").port(8080).build();
System.out.printf("Application started: %s%nStop the application using CTRL+C%n", uri.toString());
```
Contributor guide
Assessment
This issue has not been assessed yet.