DOCUMENTATION: http://xvik.github.io/dropwizard-guicey/
Support: discussions | gitter chat
Dropwizard 4.0.8 guice 7.0.0 integration.
Features:
- Auto configuration from classpath scan and guice bindings.
- Yaml config values bindings by path or unique sub objects.
- Advanced Web support
- Dropwizard style console reporting: detected (and installed) extensions are printed to console to remove uncertainty
- Test support: custom junit and spock extensions
- Advanced test abilities to disable or override application logic
- Developer friendly:
- core integrations may be replaced (to better fit needs)
- rich api for developing custom integrations, and hooking into lifecycle)
- out of the box support for plug-n-play plugins (auto discoverable)
- diagnostic tools (reports), support for custom diagnostic tools
If guicey makes your life easier, you can support its development.
All active (not EOL) dropwizard versions supported.
Dropwizard | Guicey | Reason |
---|---|---|
2.1.x | 5.x | Last java 8 compatible version (EOL January 31 2024) |
3.x | 6.x | Changed core dropwizard packages - old 3rd paty bundles would be incompatible; Java 11 required |
4.x | 7.x | Jakarta namespace migration - 3rd party guice modules might be incompatible |
5.x | Trunk compatible (8.x), not released | Java 17 required |
Upcoming guicey changes would be ported in all active branches.
Maven:
<dependency>
<groupId>ru.vyarus</groupId>
<artifactId>dropwizard-guicey</artifactId>
<version>7.1.4</version>
</dependency>
Gradle:
implementation 'ru.vyarus:dropwizard-guicey:7.1.4'
Dropwizard | Guicey |
---|---|
4.0 | 7.1.4 |
3.0 | 6.2.4 |
2.1 | 5.10.2 |
2.0 | 5.5.0 |
1.3 | 4.2.3 |
1.1, 1.2 | 4.1.0 |
1.0 | 4.0.1 |
0.9 | 3.3.0 |
0.8 | 3.1.0 |
0.7 | 1.1.0 |
GRADLE 6 users: You might face Could not resolve com.google.guava:guava:32.1.2-jre.
problem. This caused by guava packaging issue (affected many people).
Either upgrade to gradle 7-8 or apply workaround
Use BOM for guice, dropwizard and guicey modules dependency management. BOM usage is highly recommended as it allows you to correctly update dropwizard dependencies.
Gradle:
dependencies {
implementation platform('ru.vyarus.guicey:guicey-bom:7.1.4')
// uncomment to override dropwizard and its dependencies versions
//implementation platform('io.dropwizard:dropwizard-dependencies:4.0.8')
// no need to specify versions
implementation 'ru.vyarus:dropwizard-guicey'
implementation 'ru.vyarus.guicey:guicey-eventbus'
implementation 'io.dropwizard:dropwizard-auth'
implementation 'com.google.inject:guice-assistedinject'
testImplementation 'io.dropwizard:dropwizard-testing'
}
Maven:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>ru.vyarus.guicey</groupId>
<artifactId>guicey-bom</artifactId>
<version>7.1.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- uncomment to override dropwizard and its dependencies versions
<dependency>
<groupId>io.dropwizard/groupId>
<artifactId>dropwizard-dependencies</artifactId>
<version>4.0.8</version>
<type>pom</type>
<scope>import</scope>
</dependency> -->
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>ru.vyarus</groupId>
<artifactId>dropwizard-guicey</artifactId>
</dependency>
</dependencies>
BOM includes:
BOM | Artifact |
---|---|
Guicey modules | ru.vyarus.guicey:guicey-[module] |
Dropwizard BOM | io.dropwizard:dropwizard-bom |
Guice BOM | com.google.inject:guice-bom |
HK2 bridge | org.glassfish.hk2:guice-bridge |
Spock-junit5 | ru.vyarus:spock-junit5 |
Snapshots may be used through GitHub packages
WARNING: Accessing GitHub package requires GitHub authorization!
An actual published version could be seen on package page
For Gradle:
-
Add GitHub repository in build.gradle:
repositories { maven { url = 'https://maven.pkg.github.com/xvik/dropwizard-guicey' credentials { username = findProperty('gpr.user') ?: System.getenv("USERNAME") password = findProperty('gpr.key') ?: System.getenv("TOKEN") } } }
or in settings.gradle:
dependencyResolutionManagement { repositories { mavenCentral() maven { url = 'https://maven.pkg.github.com/xvik/dropwizard-guicey' credentials { username = settings.ext.find('gpr.user') ?: System.getenv("USERNAME") password = settings.ext.find('gpr.key') ?: System.getenv("TOKEN") } } } }
-
In global gradle file
~/.gradle/gradle.properties
addgpr.user=<your github user name> gpr.key=<your github password or classic token>
(or credentials must be declared in environment: USERNAME/TOKEN (more usable for CI)) Read personal access tokens creation guide Note that token needs only "package/read" permission
-
Use a snapshot version (as usual):
dependencies { implementation 'ru.vyarus:dropwizard-guicey:8.0.0-SNAPSHOT' }
-
If there would be problems loading the latest snapshot, change cache policy:
configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' }
For Maven,
-
Add credentials into ~/.m2/settings.xml:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <servers> <server> <id>github</id> <username>USERNAME</username> <password>TOKEN</password> </server> </servers> </settings>
(where USERNAME- github username and TOKEN - classic token with packages:read permission)
-
Add repository (in project or using profile in settings.xml)
<repositories> <repository> <id>github</id> <url>https://maven.pkg.github.com/xvik/dropwizard-guicey</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>
(repository name MUST be the same as declared server)
-
Use dependency
<dependencies> <dependency> <groupId>ru.vyarus</groupId> <artifactId>dropwizard-guicey</artifactId> <version>8.0.0-SNAPSHOT</version> </dependency> </dependencies>
Read documentation
- yaml-updater - yaml configuration update tool, preserving comments and whitespaces (has dropwizard module)
- generics-resolver - runtime generics resolution
- guice-validator - hibernate validator integration for guice (objects validation, method arguments and return type runtime validation)
- guice-ext-annotations - @Log, @PostConstruct, @PreDestroy and utilities for adding new annotations support
- guice-persist-orient - guice integration for orientdb
- dropwizard-orient-server - embedded orientdb server for dropwizard