Skip to content

Dropwizard with Guice: a light-weight library that helps auto-binding of resources

License

Notifications You must be signed in to change notification settings

flipkart-incubator/dropwizard-guicier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dropwizard-Guicier (Dropwizard with Guice)

Build Status

About

This is a fork of HubSpot/dropwizard-guicier (with embedded dependency Squarespace/jersey2-guice) with following improvements:

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

Usage

Add this library 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-2
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

Dropwizard with Guice: a light-weight library that helps auto-binding of resources

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Java 100.0%