项目作者: xvik

项目描述 :
Dropwizard-guicey extensions
高级语言: Java
项目地址: git://github.com/xvik/dropwizard-guicey-ext.git
创建时间: 2016-12-03T08:41:04Z
项目社区:https://github.com/xvik/dropwizard-guicey-ext

开源协议:MIT License

下载


Dropwizard-guicey extensions

License
CI
Appveyor build status
codecov

About

IMPORTANT Modules were moved into the core repository
in order to unify versions and release cycles (for guicey 6, dropwizard 3 and beyond)

Dropwizard-guicey 5.x extensions and integrations.
Provided modules may be used directly and for educational purposes (as examples for custom integrations).

NOTE: Extension modules version is derived from guicey version: guiceyVersion-Number
(the same convention as for dropwizard modules). For example version 5.0.0-1 means
first extensions release (1) for guicey 5.0.0.

Also, guicey base package ru.vyarus.dropwizard.guice is different from extensions base package ru.vyarus.guicey.

Older versions:

Setup

Maven Central

You can either use modules directly (in this case see module page for setup) or use provided BOM
to unify versions management.

BOM

Provides:

  • Guicey bom
  • Guice bom
  • Dropwizard bom

Maven:

  1. <!-- Implicitly imports Dropwizard and Guice BOMs -->
  2. <dependencyManagement>
  3. <dependencies>
  4. <dependency>
  5. <groupId>ru.vyarus.guicey</groupId>
  6. <artifactId>guicey-bom</artifactId>
  7. <version>5.7.1-1</version>
  8. <type>pom</type>
  9. <scope>import</scope>
  10. </dependency>
  11. <!-- uncomment to override dropwizard and its dependencies versions
  12. <dependency>
  13. <groupId>io.dropwizard/groupId>
  14. <artifactId>dropwizard-dependencies</artifactId>
  15. <version>2.1.5</version>
  16. <type>pom</type>
  17. <scope>import</scope>
  18. </dependency> -->
  19. </dependencies>
  20. </dependencyManagement>
  21. <!-- declare guice and ext modules without versions -->
  22. <dependencies>
  23. <dependency>
  24. <groupId>ru.vyarus</groupId>
  25. <artifactId>dropwizard-guicey</artifactId>
  26. </dependency>
  27. <!-- For example, using dropwizard module (without version) -->
  28. <dependency>
  29. <groupId>io.dropwizard</groupId>
  30. <artifactId>dropwizard-auth</artifactId>
  31. </dependency>
  32. <!-- Example of extension module usage -->
  33. <dependency>
  34. <groupId>ru.vyarus.guicey</groupId>
  35. <artifactId>guicey-eventbus</artifactId>
  36. </dependency>
  37. </dependencies>

Gradle:

  1. dependencies {
  2. implementation platform('ru.vyarus.guicey:guicey-bom:5.7.1-1')
  3. // uncomment to override dropwizard and its dependencies versions
  4. //implementation platform('io.dropwizard:dropwizard-dependencies:2.1.5')
  5. // declare guice and ext modules without versions
  6. implementation 'ru.vyarus:dropwizard-guicey'
  7. implementation 'io.dropwizard:dropwizard-auth'
  8. implementation 'ru.vyarus.guicey:guicey-eventbus'
  9. }
Dependencies override

You may override BOM version for any dependency by simply specifying exact version in dependency declaration section.

If you want to use newer version (then provided by guicey BOM) of dropwizard or guice then import also their BOMs directly:

  • io.dropwizard:dropwizard-dependencies:$VERSION for dropwizard
  • com.google.inject:guice-bom:$VERSION for guice

Snapshots


Snapshots may be used through JitPack

WARNING: snapshot may not contain today’s commits due to ~1day publication lag!

WARNING2: master-SHAPSHOT versions are not working due to incorrect pom generation (yet unkown reason), use exact commits instead

Add JitPack repository:

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

For spring dependencies plugin:

groovy dependencyManagement { resolutionStrategy { cacheChangingModulesFor 0, 'seconds' } imports { mavenBom "ru.vyarus.guicey:guicey-bom:COMMIT-HASH" } } dependencies { implementation 'ru.vyarus.guicey:guicey-validation' }

If you don’t use BOM:

groovy configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } dependencies { implementation 'ru.vyarus.guicey:guicey-validation:COMMIT-HASH' }

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:

Go to JitPack project page Select Commits section and click Get it on commit you want to use and
use commit hash as version: ru.vyarus.guicey:guicey-bom:8585300d12


Maven:

xml <repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories> <dependencyManagement> <dependencies> <dependency> <groupId>ru.vyarus.guicey</groupId> <artifactId>guicey-bom</artifactId> <version>COMMIT-HASH</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>ru.vyarus.guicey</groupId> <artifactId>guicey-validation</artifactId> </dependency> </dependencies>

Or simply change dependency version if BOM not used (repository definition is still required).

Modules

Admin REST

Admin context rest support (mirror main rest).

Lifecycle annotations

Support for @PostConstruct, @PreDestroy, @PostStartup annotations on guice beans.

Validation

Allows using validation annotations on any guice bean method (the same way as dropwizard rest validation)

Guava EventBus integration

Module provides integration with Guava EventBus: automates subscriptions, report events with subscriptions and registers EventBus for inject.

JDBI integration

Based on dropwizard integration. Introduce thread bound transactions, defined with annotations.
Sql proxies could be used as usual guice beans without extra efforts to use them in the same transaction.

JDBI3 integration

Jdbi3 integration, based on dropwizard module. Introduce thread bound transactions, defined with annotations.
Sql proxies could be used as usual guice beans without extra efforts to use them in the same transaction.

Single page applications

Correct redirect to index page for html5 client routing urls (e.g. html5 routing enabled by default in Angular 2).

Guicey Server Pages

JSP like simplicity for dropwizard-views.

JUnit 4

JUnit 4 rules.

Spock 1

Spock 1 extensions.


java lib generator