Skip to content

Commit 8177b6b

Browse files
committed
Remove dependency to 'javax.inject'
This is packaged in the Gradle API already and thus the dependency adds duplicated classes to the plugin compilation and runtime classpaths. I discovered this by running dependency analysis on a Gradle plugin build. It prompted me to add the dependency to 'inject', although I did not have the dependency before, because I want to use it from the Gradle API directly. Other Gradle plugins also do not have this dependency, despite using `@Inject`. Signed-off-by: Jendrik Johannes <jendrik@onepiece.software>
1 parent d42dd31 commit 8177b6b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

build-logic/convention/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ gradlePlugin {
5555
}
5656

5757
dependencies {
58-
api(libs.javax.inject)
5958
api(libs.mavenPublishPlugin)
6059

6160
implementation(platform(libs.kotlin.bom))
62-
implementation(libs.dependencyAnalysisPlugin)
61+
implementation(libs.dependencyAnalysisPlugin) {
62+
// TODO can be removed after plugin update to 3.5.2
63+
exclude(group = "javax.inject")
64+
}
6365
implementation(libs.gradleTestKitPlugin)
6466
implementation(libs.gradle.publish.plugin) {
6567
because("For extending Gradle Plugin-Publish Plugin functionality")

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ gradleTestKitSupport {
107107
}
108108

109109
dependencies {
110-
api(libs.javax.inject)
111110
api(libs.moshi.core)
112111
api(libs.moshix.sealed.runtime)
113112

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ gradleTestKitPlugin = { module = "com.autonomousapps:gradle-testkit-plugin", ver
5454
grammar = { module = "com.autonomousapps:gradle-script-grammar", version.ref = "grammar" }
5555
groovy = { module = "org.apache.groovy:groovy", version.ref = "groovy" }
5656
guava = { module = "com.google.guava:guava", version.ref = "guava" }
57-
javax-inject = "javax.inject:javax.inject:1"
5857
jspecify = { module = "org.jspecify:jspecify", version.ref = "jspecify" }
5958
junit-api = { module = "org.junit.jupiter:junit-jupiter-api" }
6059
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" }

0 commit comments

Comments
 (0)