Spring classpath filtering via Gradle plugin
See original GitHub issueWe should be able to do that with something like:
compile("org.springframework:spring-web") {
registerTransform {
from.attribute(filtered, false).attribute(artifactType, "jar")
to.attribute(filtered, true).attribute(artifactType, "jar")
artifactTransform(FilterClasses::class.java)
}
}
}
// Same for spring-webflux, spring-context, spring-data-commons, etc.
class SpringFuWebFilter : ArtifactTransform() {
private val classesToFilter = arrayOf(
"org/springframework/remoting/**",
"org/springframework/web/accept/**",
"org/springframework/web/bind/**",
"org/springframework/web/client/**",
"org/springframework/web/context/**",
"org/springframework/web/filter/**",
"org/springframework/web/jsf/**",
"org/springframework/web/method/**",
"org/springframework/web/multipart/**",
)
)
override fun transform(input: File): List<File> {
return if (...) listOf(input) else emptyList()
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top Results From Across the Web
Spring classpath filtering via Gradle plugin · Issue #34 - GitHub
We should be able to do that with something like: compile("org.springframework:spring-web") { registerTransform { from.attribute(filtered, ...
Read more >73. Properties and Configuration - Spring
Only production configuration is filtered that way (in other words, ... You can then refer to your Gradle project's properties via placeholders, as...
Read more >The Java Plugin - Gradle User Manual
The Java plugin adds the java extension to the project. This allows to configure a number of Java related properties inside a dedicated...
Read more >Filtering artifacts by capabilities/attributes - Gradle Forums
Hi! I hope my question is not too weird, I would like to create a Gradle plugin that is capable of finding Jar...
Read more >Testing in Java & JVM projects - Gradle User Manual
You can enable filtering either in the build script or via the --tests command-line option. Here's an example of some filters that are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think GraalVM native images or Jlink are better solution to this need.
Gradle 5.5 with official support and documentation for artifact transformation has been released.