Repository navigation
Clean up package structure - #3233
Conversation
Not sure about that one yet. Do you have any preferences? |
nickbabcock
left a comment
There was a problem hiding this comment.
Yeah looks like the structure needed to be cleaned up to be compliant. Thanks for this and making it backwards compatible.
You also mentioned
We'll need more tests to see, if everything works with Java 9+ ; when using the module path
I'm not sure how one would test the module path. Were you able to include them in the PR?
io.dropwizard.metrics->io.dropwizard.metrics.{common, core}
I'd say, unless you want to make everything use the core suffix, having io.dropwizard.metrics match logging and views with the common suffix make sense
|
I'm worried that the actual changes aren't going to be backwards compatible - if we end up changing the locations of classes it could break consumers. For example, by changing to contract superclass (i.e. from io.dropwizard.Configuration to io.dropwizard.core.Configuration), we may break compatibility. http://wiki.eclipse.org/Evolving_Java-based_APIs_2 is a great reference for these sorts of changes to know the impact. We can also run a tool like https://lvc.github.io/japi-compliance-checker/ to verify the API contract hasn't changed. OkHttp also just updated from Java to Kotlin (https://square.github.io/okhttp/upgrading_to_okhttp_4/) and recommended use of https://github.com/siom79/japicmp to verify no API changes. If we can't make this backwards compatible, then we might want to consider this for a 3.x release and change groupId, package name, and introduce compat packages if we want to support existing codebases. For example:
|
|
After playing around with this branch a little bit more I couldn't come up with a way to not break backward compatibility in one way or the other. So I think it makes sense to rip off the bandaid and introduce the breaking change in Dropwizard 2.1.0 to be done with it. Going forward, this would mean that Dropwizard could be compatible to the JPMS and no other package renaming would have to be done. The other possibility would be to postpone this change to Dropwizard 3.0.0 and do it together with the move to the Jakarta EE namespace (Jetty 11, Jersey 3, Hibernate Validator 7, etc.) and the Java 11 baseline (or drop this altogether). @dropwizard/committers Any opinions? |
|
SonarCloud Quality Gate failed.
|
|
@joschi I think this would surprise people in 2.1.0 even if we heavily documented it. I'd be in favor of starting 3.x with the changes you proposed and maybe at the same time saying 1.x would no longer be maintained/supported (even bug fixes), to encourage people to upgrade to at least 2.x. |
@jplock Thankfully we already did that with Dropwizard 1.3.29. 😃 I don't have a strong opinion on whether to to this change in Dropwizard 2.1.x or 3.0.x. The only thing which might not be desirable is mixing too many breaking changes into Dropwizard 3.0.x. |
|
I'll put in a vote for holding off the change until a 3.0 release. Having breaking changes is much more expected for a major version bump compared to a minor version bump. |
Thanks to our current upgrade plans, Dropwizard 3.0.x won't introduce that much API changes. Since Jersey will bring JPMS support firstly in 3.1.0 on the |
|
@dropwizard/committers I've rebased the branch on |
There was a problem hiding this comment.
@joschi This looks very good, thanks for the effort ❤️
I just have a few minor suggestions:
DefaultServerFactoryTest:18-19multiple imports forEnvironmentandExceptionMapperBinderSimpleServerFactoryTest:17multiple imports forEnvironmentJdbiTest:8multiple imports forEnvironmentgetting-started.rst:196broken importconfiguration.rst:892packagelogging.commoninstead oflogging.filter.commonFilterFactory:15broken JavaDoc
And one question left: Could it become a problem, that the packages in dropwizard-e2e and dropwizard-example are named com.example and com.example.helloworld?
|
@zUniQueX Thanks for the detailed look at this PR! ❤️
No, these are not an issue because neither is being published and consumed by other projects and they never end up in the same application and module path. |
Okay, thanks for taking a look at this 👍 |
|
Kudos, SonarCloud Quality Gate passed! |








In order to properly support the Java Platform Module System (JPMS), the packages in modules must not overlap, or put differently, the packages may not be split into multiple modules.
See also: https://nipafx.dev/java-9-migration-guide/#split-packages
This change set cleans up the overlapping package structure where necessary (and is unfortunately breaking backward compatibility).
Affected packages:
dropwizard-core:io.dropwizard->io.drowizard.coredropwizard-views:io.dropwizard.views->io.dropwizard.views.commondropwizard-metrics:io.dropwizard.metrics->io.dropwizard.metrics.commondropwizard-logging:io.dropwizard.logging->io.dropwizard.logging.commonRefs #2926
Refs #3131
Refs #3654