Skip to content

Commit

Permalink
update to dropwizard 5 (requires java 17);
Browse files Browse the repository at this point in the history
update gradle and dependencies;
add option in admin-ext module to explicitly mark rest calls in admin context (because admin rest calls are also logged)
  • Loading branch information
xvik committed Sep 17, 2024
1 parent c342384 commit 586f66e
Show file tree
Hide file tree
Showing 36 changed files with 272 additions and 98 deletions.
5 changes: 3 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ version: '{build}'

environment:
matrix:
- job_name: Java 11
JAVA_HOME: C:\Program Files\Java\jdk11
- job_name: Java 17
appveyor_build_worker_image: Visual Studio 2019
JAVA_HOME: C:\Program Files\Java\jdk17
- job_name: Java 21
appveyor_build_worker_image: Visual Studio 2022
JAVA_HOME: C:\Program Files\Java\jdk21

build_script:
- ./gradlew assemble --no-daemon
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
# don't cancel remaining matrix steps on failure
fail-fast: false
matrix:
java: [11, 17, 21]
java: [17, 21]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
java-version: 17

- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v3
uses: gradle/actions/dependency-submission@v4
2 changes: 1 addition & 1 deletion .github/workflows/examples-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Java ${{ matrix.java }}
strategy:
matrix:
java: [11, 17]
java: [17, 21]

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Update to dropwizard 5 (requires java 17)
* [admin-rest]
- Add identifyAdminContextInRequestLogs bundle option to highlight admin requests in logs

### 7.1.4 (2024-09-14)
* Update to dropwizard 4.0.8

Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,16 @@ Features:

### Supported versions

Due to 3 major changes in dropwizard recently, 3 guicey versions supported:
All active (not EOL) dropwizard versions supported.

Dropwizard | Guicey | Reason
----------|--------------------------------------------------------------|-------
2.1.x| [5.x](https://github.com/xvik/dropwizard-guicey/tree/dw-2.1) | Last java 8 compatible version (EOL [January 31 2024](https://github.com/dropwizard/dropwizard/discussions/7880))
3.x | [6.x](https://github.com/xvik/dropwizard-guicey/tree/dw-3) | [Changed core dropwizard packages](https://github.com/dropwizard/dropwizard/blob/release/3.0.x/docs/source/manual/upgrade-notes/upgrade-notes-3_0_x.rst) - old 3rd paty bundles would be incompatible
4.x | 7.x | [Jakarta namespace migration](https://github.com/dropwizard/dropwizard/blob/release/4.0.x/docs/source/manual/upgrade-notes/upgrade-notes-4_0_x.rst) - 3rd party guice modules might be incompatible
3.x | [6.x](https://github.com/xvik/dropwizard-guicey/tree/dw-3) | [Changed core dropwizard packages](https://github.com/dropwizard/dropwizard/blob/release/3.0.x/docs/source/manual/upgrade-notes/upgrade-notes-3_0_x.rst) - old 3rd paty bundles would be incompatible; Java 11 required
4.x | [7.x](https://github.com/xvik/dropwizard-guicey/tree/dw-4) | [Jakarta namespace migration](https://github.com/dropwizard/dropwizard/blob/release/4.0.x/docs/source/manual/upgrade-notes/upgrade-notes-4_0_x.rst) - 3rd party guice modules might be incompatible
5.x | Trunk compatible (8.x), not released | Java 17 required

All branches use the same project structure: core guicey merged with extension modules.
It greatly simplifies releases and keeps actual examples in one branch.

Upcoming guicey changes would be ported in all 3 branches.
Upcoming guicey changes would be ported in all active branches.

### Setup

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ plugins {
}

wrapper {
gradleVersion = '8.6'
gradleVersion = '8.10.1'
}

description = 'Dropwizard guice integration'

ext {
dropwizard = '4.0.8'
dropwizard = '5.0.0-alpha.2'
guice = '7.0.0'
hk2 = '3.0.6'
spockJunit5 = '1.2.0'
Expand Down Expand Up @@ -116,7 +116,7 @@ subprojects {
apply plugin: 'org.cyclonedx.bom'

java {
sourceCompatibility = 11
sourceCompatibility = JavaVersion.VERSION_17
}

dependencies {
Expand Down Expand Up @@ -159,7 +159,7 @@ subprojects {
}
dependencies {
testImplementation 'ru.vyarus:spock-junit5'
testImplementation 'org.spockframework:spock-core:2.4-M2-groovy-4.0'
testImplementation 'org.spockframework:spock-core:2.4-M4-groovy-4.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.dropwizard.jetty.MutableServletContextHandler;
import io.dropwizard.core.setup.Environment;
import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.FilterMapping;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.servlet.ServletMapping;
import org.eclipse.jetty.ee10.servlet.FilterHolder;
import org.eclipse.jetty.ee10.servlet.FilterMapping;
import org.eclipse.jetty.ee10.servlet.ServletHolder;
import org.eclipse.jetty.ee10.servlet.ServletMapping;
import ru.vyarus.dropwizard.guice.debug.report.ReportRenderer;
import ru.vyarus.dropwizard.guice.debug.report.guice.util.GuiceModelUtils;
import ru.vyarus.dropwizard.guice.debug.report.web.model.WebElementModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.google.common.collect.Multimap;
import io.dropwizard.jetty.MutableServletContextHandler;
import io.dropwizard.lifecycle.Managed;
import org.eclipse.jetty.server.session.SessionHandler;
import org.eclipse.jetty.ee10.servlet.SessionHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.vyarus.dropwizard.guice.module.installer.util.FeatureUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class GuiceRendererCasesTest extends Specification {
expect:
render(new GuiceConfig()) == """
8 MODULES with 113 bindings
8 MODULES with 106 bindings
├── CasesModule (r.v.d.g.d.r.g.support)
│ ├── <typelistener> CustomTypeListener at ru.vyarus.dropwizard.guice.debug.renderer.guice.support.CasesModule.configure(CasesModule.java:19)
Expand Down Expand Up @@ -205,7 +205,6 @@ class GuiceRendererCasesTest extends Specification {
├── instance [@Singleton] @Config MetricsFactory at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindUniqueSubConfigurations(ConfigBindingModule.java:117)
├── instance [@Singleton] @Config RequestLogFactory<Object> at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindUniqueSubConfigurations(ConfigBindingModule.java:117)
├── instance [@Singleton] @Config ServerFactory at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindUniqueSubConfigurations(ConfigBindingModule.java:117)
├── instance [@Singleton] @Config ServerPushFilterFactory at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindUniqueSubConfigurations(ConfigBindingModule.java:117)
├── instance [@Singleton] @Config TaskConfiguration at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindUniqueSubConfigurations(ConfigBindingModule.java:117)
├── instance [@Singleton] @Config("admin") AdminFactory at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── instance [@Singleton] @Config("admin.healthChecks") HealthCheckConfiguration at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
Expand Down Expand Up @@ -253,10 +252,6 @@ class GuiceRendererCasesTest extends Specification {
├── instance [@Singleton] @Config("server.requestLog.appenders") List<AppenderFactory<IAccessEvent>> at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── instance [@Singleton] @Config("server.responseMeteredLevel") ResponseMeteredLevel at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── instance [@Singleton] @Config("server.rootPath") Optional<String> at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── instance [@Singleton] @Config("server.serverPush") ServerPushFilterFactory at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── instance [@Singleton] @Config("server.serverPush.associatePeriod") Duration at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── instance [@Singleton] @Config("server.serverPush.enabled") Boolean at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── instance [@Singleton] @Config("server.serverPush.maxAssociations") Integer at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── instance [@Singleton] @Config("server.shutdownGracePeriod") Duration at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── providerinstance [@Prototype] @Config("server.gid") Integer at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── providerinstance [@Prototype] @Config("server.group") String at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
Expand All @@ -268,8 +263,6 @@ class GuiceRendererCasesTest extends Specification {
├── providerinstance [@Prototype] @Config("server.metricPrefix") String at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── providerinstance [@Prototype] @Config("server.nofileHardLimit") Integer at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── providerinstance [@Prototype] @Config("server.nofileSoftLimit") Integer at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── providerinstance [@Prototype] @Config("server.serverPush.refererHosts") List<String> at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── providerinstance [@Prototype] @Config("server.serverPush.refererPorts") List<Integer> at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── providerinstance [@Prototype] @Config("server.startsAsRoot") Boolean at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── providerinstance [@Prototype] @Config("server.uid") Integer at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
├── providerinstance [@Prototype] @Config("server.umask") String at ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule.bindValuePaths(ConfigBindingModule.java:129)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class CompleteRenderTest extends Specification {
Exception mappers
Throwable ExceptionMapperBinder\$1 (i.d.core.setup)
Throwable DefaultExceptionMapper (o.g.jersey.server)
EofException EarlyEofExceptionMapper (i.d.jersey.errors)
EmptyOptionalException EmptyOptionalExceptionMapper (i.d.jersey.optional)
IOException GuiceExceptionMapper (r.v.d.g.c.h.support)
Expand Down Expand Up @@ -66,6 +67,7 @@ class CompleteRenderTest extends Specification {
byte[] ByteArrayProvider (o.g.j.m.internal) [application/octet-stream, */*]
DataSource DataSourceProvider (o.g.j.m.internal) [application/octet-stream, */*]
Document DocumentProvider (o.g.j.jaxb.internal) [application/xml, text/xml, */*]
List<EntityPart> EntityPartReader (o.g.j.m.m.internal) [multipart/form-data]
Enum EnumMessageProvider (o.g.j.m.internal) [text/plain]
File FileProvider (o.g.j.m.internal) [application/octet-stream, */*]
MultivaluedMap<String, String> FormMultivaluedMapProvider (o.g.j.m.internal) [application/x-www-form-urlencoded]
Expand All @@ -75,8 +77,11 @@ class CompleteRenderTest extends Specification {
InputStream InputStreamProvider (o.g.j.m.internal) [application/octet-stream, */*]
Object JacksonJsonProvider (c.f.j.j.rs.json) [*/*]
Object JacksonMessageBodyProvider (i.d.jersey.jackson) [*/*]
MultiPart MultiPartReaderServerSide (o.g.j.m.m.internal) [multipart/*]
Path PathProvider (o.g.j.m.internal) [application/octet-stream, */*]
Reader ReaderProvider (o.g.j.m.internal) [text/plain, */*]
RenderedImage RenderedImageProvider (o.g.j.m.internal) [image/*, application/octet-stream]
EntityPart SingleEntityPartReader (o.g.j.m.m.internal)
DOMSource DomSourceReader (o.g.j.m.i.SourceProvider) [application/xml, text/xml, */*]
SAXSource SaxSourceReader (o.g.j.m.i.SourceProvider) [application/xml, text/xml, */*]
StreamSource StreamSourceReader (o.g.j.m.i.SourceProvider) [application/xml, text/xml, */*]
Expand All @@ -100,6 +105,7 @@ class CompleteRenderTest extends Specification {
ChunkedOutput<Object> ChunkedResponseWriter (o.g.jersey.server)
DataSource DataSourceProvider (o.g.j.m.internal) [application/octet-stream, */*]
Document DocumentProvider (o.g.j.jaxb.internal) [application/xml, text/xml, */*]
List<EntityPart> EntityPartWriter (o.g.j.m.m.internal) [multipart/form-data]
Enum EnumMessageProvider (o.g.j.m.internal) [text/plain]
File FileProvider (o.g.j.m.internal) [application/octet-stream, */*]
MultivaluedMap<String, String> FormMultivaluedMapProvider (o.g.j.m.internal) [application/x-www-form-urlencoded]
Expand All @@ -109,13 +115,16 @@ class CompleteRenderTest extends Specification {
InputStream InputStreamProvider (o.g.j.m.internal) [application/octet-stream, */*]
Object JacksonJsonProvider (c.f.j.j.rs.json) [*/*]
Object JacksonMessageBodyProvider (i.d.jersey.jackson) [*/*]
MultiPart MultiPartWriter (o.g.j.m.m.internal) [multipart/*]
OptionalDouble OptionalDoubleMessageBodyWriter (i.d.jersey.optional) [*/*]
OptionalInt OptionalIntMessageBodyWriter (i.d.jersey.optional) [*/*]
OptionalLong OptionalLongMessageBodyWriter (i.d.jersey.optional) [*/*]
Optional<Object> OptionalMessageBodyWriter (i.d.jersey.guava) [*/*]
Optional<Object> OptionalMessageBodyWriter (i.d.jersey.optional) [*/*]
Path PathProvider (o.g.j.m.internal) [application/octet-stream, */*]
Reader ReaderProvider (o.g.j.m.internal) [text/plain, */*]
RenderedImage RenderedImageProvider (o.g.j.m.internal) [image/*]
EntityPart SingleEntityPartWriter (o.g.j.m.m.internal)
Source SourceWriter (o.g.j.m.i.SourceProvider) [application/xml, text/xml, */*]
StreamingOutput StreamingOutputProvider (o.g.j.m.internal) [application/octet-stream, */*]
String StringMessageProvider (o.g.j.m.internal) [text/plain, */*]
Expand Down Expand Up @@ -161,6 +170,7 @@ class CompleteRenderTest extends Specification {
CookieParamValueParamProvider (o.g.j.s.i.inject)
DelegatedInjectionValueParamProvider (o.g.j.s.i.inject)
EntityParamValueParamProvider (o.g.j.s.i.inject)
FormDataParamValueParamProvider (o.g.j.m.m.internal)
FormParamValueParamProvider (o.g.j.s.i.inject)
GuiceValueParamProvider (r.v.d.g.c.h.support)
HKValueParamProvider (r.v.d.g.c.h.s.hk) *jersey managed
Expand All @@ -184,6 +194,7 @@ class CompleteRenderTest extends Specification {
@QueryParam ParamInjectionResolver (o.g.j.s.i.inject) using QueryParamValueParamProvider
@Uri ParamInjectionResolver (o.g.j.s.i.inject) using WebTargetValueParamProvider
@BeanParam ParamInjectionResolver (o.g.j.s.i.inject) using BeanParamValueParamProvider
@FormDataParam ParamInjectionResolver (o.g.j.s.i.inject) using FormDataParamValueParamProvider
""" as String;
}

Expand Down
Loading

0 comments on commit 586f66e

Please sign in to comment.