Skip to content

A light-weight library that helps reduce boilerplate code in Dropwizard services by enabling auto-binding of resources using Guice

License

Notifications You must be signed in to change notification settings

nadav-lavy-exa/dropwizard-guicier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dropwizard-Guicier

About

This is a fork of HubSpot/dropwizard-guicier with following modifications:

  • Significant reduction in dependency footprint
  • Reduction in inter-dependency conflicts (hence, lesser chances of jar hell)
  • Compatilibity with latest versions of Dropwizard

Usage

Add this library (dropwizard-guicier) as dependency:

<dependencies>
    <dependency>
        <groupId>com.flipkart.utils</groupId>
        <artifactId>dropwizard-guicier</artifactId>
        <version>${dropwizard-guicier-version}</version>
    </dependency>
</dependencies>

As of now, following versions of ${dropwizard-guicier-version} are available in Maven Central Artifactory:

Dropwizard version Guice version dropwizard-guicier-version
1.3.5 4.2.2 1.3.5-2
1.3.17 4.2.2 1.3.17-1
1.3.18 4.2.2 1.3.18-1
1.3.19 4.2.2 1.3.19-1

If you have a version of Dropwizard or Guice that isn't listed here, raise an issue or you can build one yourself.

Simply install a new instance of the bundle during your service initialization:

public class ExampleApplication extends Application<ExampleConfiguration> {

  public static void main(String... args) throws Exception {
    new ExampleApplication().run(args);
  }

  @Override
  public void initialize(Bootstrap<ExampleConfiguration> bootstrap) {
    GuiceBundle<ExampleConfiguration> guiceBundle = GuiceBundle.defaultBuilder(ExampleConfiguration.class)
        .modules(new ExampleModule())
        .build();

    bootstrap.addBundle(guiceBundle);
  }

  @Override
  public void run(ExampleConfiguration configuration, Environment environment) throws Exception {}
}

Related links

About

A light-weight library that helps reduce boilerplate code in Dropwizard services by enabling auto-binding of resources using Guice

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%