Home

Awesome

Dropwizard guice integration

License CI Appveyor build status codecov

DOCUMENTATION: http://xvik.github.io/dropwizard-guicey/

Support: discussions | gitter chat

About

Dropwizard 4.0.8 guice 7.0.0 integration.

Features:

Sponsors

    Channel Talk

<sup>If guicey makes your life easier, you can support its development.</sup>

Supported versions

All active (not EOL) dropwizard versions supported.

DropwizardGuiceyReason
2.1.x5.xLast java 8 compatible version (EOL January 31 2024)
3.x6.xChanged core dropwizard packages - old 3rd paty bundles would be incompatible; Java 11 required
4.x7.xJakarta namespace migration - 3rd party guice modules might be incompatible
5.xTrunk compatible (8.x), not releasedJava 17 required

Upcoming guicey changes would be ported in all active branches.

Setup

Maven Central

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'
DropwizardGuicey
4.07.1.4
3.06.2.4
2.15.10.2
2.05.5.0
1.34.2.3
1.1, 1.24.1.0
1.04.0.1
0.93.3.0
0.83.1.0
0.71.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

BOM

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:

BOMArtifact
Guicey modulesru.vyarus.guicey:guicey-[module]
Dropwizard BOMio.dropwizard:dropwizard-bom
Guice BOMcom.google.inject:guice-bom
HK2 bridgeorg.glassfish.hk2:guice-bridge
Spock-junit5ru.vyarus:spock-junit5

Snapshots

<details> <summary>Snapshots may be used through JitPack</summary>

Add JitPack repository:

repositories { maven { url 'https://jitpack.io' } }

For spring dependencies plugin (when guicey pom used as BOM):

dependencyManagement {
    resolutionStrategy {
        cacheChangingModulesFor 0, 'seconds'
    }
    imports {
        mavenBom "ru.vyarus:dropwizard-guicey:master-SNAPSHOT"
    }
}

For direct guicey dependency:

configurations.all {
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

dependencies {
    implementation 'ru.vyarus:dropwizard-guicey:master-SNAPSHOT'
}

Note that in both cases resolutionStrategy setting required for correct updating snapshot with recent commits (without it you will not always have up-to-date snapshot)

OR you can depend on exact commit:

Maven:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>  

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>ru.vyarus</groupId>
            <artifactId>dropwizard-guicey</artifactId>
            <version>master-SNAPSHOT</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>ru.vyarus</groupId>
        <artifactId>dropwizard-guicey</artifactId>
    </dependency>
</dependencies>

Or simply change version if used as direct dependency (repository must be also added):

<dependency>
    <groupId>ru.vyarus</groupId>
    <artifactId>dropwizard-guicey</artifactId>
    <version>master-SNAPSHOT</version>
</dependency>
</details>

Usage

Read documentation

Might also like


java lib generator