eclipse-ee4j / eclipse-ee4j/starter

Add example of starting application via java -jar

Open
#328 8 comments 0 reactions 1 assignee Claimed by @m-reza-rahman View on GitHub
enhancement low-priority
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.