Filter project contributors on the classpath
See original GitHub issueIs there any way to tweak/override/disable out-of-the-box @ProjectGenerationConfiguration
s ?
They are not loaded as auto-config-beans, but with spring.factories
(via ProjectGenerator$CoreConfiguration
). I can’t see any way to filter or customize these ?
I could try to provide my own ProjectGenerationInvoker
bean (overriding the default bean from InitializrAutoConfiguration
) and set up my own ProjectGenerator
, but the interface requires me to construct a ProjectGenerationResult
which has a package-private constructor.
Am I missing something or is this just not supported ? Yet ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
ClassGraph, how to filter the classpath's content - java
I try to find the runtime classpath using ClassGraph: String classpath = new ClassGraph().getClasspath();. The classpath content looks as ...
Read more >Diff. btw jars in contributors,filters,library dependencies,in ...
Diff. btw jars in contributors,filters,library dependencies,in JDev 11g · 1. Application tab -> Project Properties -> Libraries and classpath · 2.
Read more >Application discovery via the classpath - Apache TomEE
This document details the various ways to get OpenEJB to detect applications you would like deployed while in an embedded mode.
Read more >Eclipse Buildship: Eclipse Plug-ins for Gradle 2.2.0
If the project uses Gradle 4.4 or newer then all source directories and binary ... Buildship then filters elements from the runtime classpath...
Read more >“How-to” Guides - Spring
You can automatically expand properties from the Maven project by using resource filtering. If you use the spring-boot-starter-parent ...
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 wonder if we could do this by allowing some control over the configuration class that’s registered when creating the project generation context:
https://github.com/spring-io/initializr/blob/e97233b1077407661660925e7b5383a7ae972736/initializr-generator/src/main/java/io/spring/initializr/generator/project/ProjectGenerator.java#L107-L109
CoreConfiguration
does nothing other than pulling in anImportSelector
that imports all of theProjectGenerationConfiguration
classes registered inspring.factories
. AllowingCoreConfiguration
to be replaced would allow a different import selector to be used. This different selector could usespring.factories
and filter the registrations or it could implement a different registration mechanism entirely.There are a few different way that this customisation could be enabled. We could make it the responsibility of the
ContextCustomizer
, we could pass something in as a new type, or we could perhaps provide a protected method that can be overridden.We thought of that as it would be a natural move with regards to what you can find in Spring Boot. We’ve ruled it out with the current infrastructure as we don’t have any way to debug this (similar to the auto-configuration report and the actuator endpoint). It is also something that can be a bit involved if you want to get this done per request or globally.
This is a valid idea but I am not keen to do such a split at this level. The module with the
@ProjectGenerationConfiguration
would be a shell and the surface area is too small to warrant such work IMO. I’d like to explore how aProjectGenerator
can filter those upfront but I haven’t had the time to look at a solution yet, sorry.