refactor module packages for improved organization and use in modular… #267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The package organization of this project is not conducive to usage with a modularized project. Problems include:
com.newrelic.telemetry
. This poses problems with modularized projects because the same packages end up being exported from multiple dependencies, which is a no go.telemetry-all
module attempts to solve this, but falls short in my opinion, since it assumes that you want to use thetelemetry-http-java11
implementation instead oftelemetry-http-okhttp
.telemetry-core
module produced a fat jar using theshadowJar
plugin, and erroneously includes themodule-info.class
file from itscom.google.gson
dependency. This causes modularized projects that depend on it to interpret it as a modularized project that only exportscom.google.gson
! Not good.newrelic-telemetry-sdk-java
: The java 8 project has to take dependencies on the java 8 sdk modules (and NOTtelemetry-all
)telemetry-core
,telemetry
, andtelemetry-http-okhttp
. When the java 11 modularized project depends on the java 8 project using standard gradle plugins, it will attempt to create explicit modules fortelemetry-core
,telemetry
, andtelemetry-http-okhttp
. This will cause a conflict because they all export the samecom.newrelic.telemetry
package.This PR fixes all these deficiencies:
telemetry
module totelemetry-client
, to disambiguate and better reflect its classes purpose.telemetry-client
iscom.newrelic.telemetry.client
telemetry-core
iscom.newrelic.telemetry.core
telemetry-http-java11
iscom.newrelic.telemetry.javahttp
telemetry-http-okhttp
iscom.newrelic.telemetry.okhttp
telemetry-all
module-info.java
has been updated to export the new packages.telemetry-core
shadowJar configuration has been updated to exclude the erroneousmodule-info.class
.This PR touches many files, which is the nature of package reorganization. However, it is strictly a refactor, as there are zero behavior changes.