Depending on your use case, choose the appropriate artifact ID. Note that for versions 2.1.0 and earlier, the groupId was com.nanohttpd. For all newer versions, use org.nanohttpd.
Specialized HTTP(S) Service
Use artifactId: nanohttpd. Extend org.nanohttpd.NanoHTTPD.
WebSocket Service
Use artifactId: nanohttpd-websocket. Extend org.nanohttpd.NanoWebSocketServer.
HTTP File Server
Use artifactId: nanohttpd-webserver. Use org.nanohttpd.SimpleWebServer as a starting point.
<!-- Maven: Specialized HTTP Service -->
<dependency>
<groupId>org.nanohttpd</groupId>
<artifactId>nanohttpd</artifactId>
<version>CURRENT_VERSION</version>
</dependency>
<!-- Maven: WebSocket Service -->
<dependency>
<groupId>org.nanohttpd</groupId>
<artifactId>nanohttpd-websocket</artifactId>
<version>CURRENT_VERSION</version>
</dependency>
<!-- Maven: File Server -->
<dependency>
<groupId>org.nanohttpd</groupId>
<artifactId>nanohttpd-webserver</artifactId>
<version>CURRENT_VERSION</version>
</dependency>
<!-- Gradle Example -->
dependencies {
runtime(
[group: 'org.nanohttpd', name: 'nanohttpd', version: 'CURRENT_VERSION'],
)
}