This repository will no longer be maintained except for critical security fixes and should not be used for new development.
It is superseded by Soklet 2.0.0, which no longer uses embedded Jetty.
- No new features or bug fixes will be made except for critical security fixes
- Issues and pull requests are not monitored
- The repository is kept for historical reference only
Replacement: https://github.com/soklet/soklet
Final release: 1.0.18 (November 13, 2025)
Jetty integration for Soklet, a minimalist infrastructure for Java webapps and microservices.
<dependency>
<groupId>com.soklet</groupId>
<artifactId>soklet-jetty</artifactId>
<version>1.0.18</version>
</dependency>If you don't use Maven, you can drop soklet-jetty-1.0.18.jar directly into your project. You'll also need Jetty 9 as a dependency.
// Assumes you're using Guice as your DI framework via soklet-guice
public static void main(String[] args) throws Exception {
Injector injector = createInjector(Modules.override(new SokletModule()).with(new AppModule()));
Server server = injector.getInstance(Server.class);
// Start the server
new ServerLauncher(server).launch(StoppingStrategy.ON_KEYPRESS, () -> {
// Some custom on-server-shutdown code here, if needed
});
}
class AppModule extends AbstractModule {
@Inject
@Provides
@Singleton
public Server provideServer(InstanceProvider instanceProvider) {
// We'll have Jetty be our Soklet server
return JettyServer.forInstanceProvider(instanceProvider).port(8080).build();
}
}See the Soklet website for complete documentation of server configuration options.
Soklet Jetty was created by Mark Allen and sponsored by Transmogrify, LLC.