Classpath Scanning in Spring Boot Jar Not Working
See original GitHub issueI have a custom annotation:
@Target(value=ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Pipeline {
String id ();
String name ();
boolean visible () default true;
String role () default "USER";
}
Which I use on interfaces within a Spring Boot App with nested jars:
@Pipeline(id="my-pipeline", name="My Pipeline")
public interface Echo {
...
}
My project structure:
parent-boot-project
|
--- plugin1.jar
--- plugin2.jar <--- interfaces are here
--- ...
Next, I use lukehutch’s fast-classpath-scanner to scan for them:
new FastClasspathScanner(BASE_PACKAGE)
.matchClassesWithAnnotation(PIPELINE_ANNOTATION, aProcessor)
.verbose()
.scan();
Works great on my IDE (eclipse) but not when I build the jar. Tried messing around with the classpath but to no avail. Anyone ran into something like that?
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (12 by maintainers)
Top Results From Across the Web
Classpath Scanning in Spring Boot Jar Not Working
FastClasspathScanner makes assumptions that don't hold true with nested jars. Why not use Spring Framework's classpath scanning support instead?
Read more >My Spring boot application is not scaning my components ...
Many Spring Boot developers have annotated their spring boot application class with @SpringBootApplication annotation. But we noticed that sometimes it failed ...
Read more >Core Features - Spring
This section dives into the details of Spring Boot. Here you can learn about the key features that you may want to use...
Read more >3.10 Classpath scanning and managed components - Spring
The scanning of classpath packages requires the presence of corresponding directory entries in the classpath. When you build JARs with Ant, make sure...
Read more >Spring Boot Reference Documentation
jar files on your classpath. Spring Boot does not require any special tools integration, so you can use any IDE or text editor....
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
thanks… use fast-classpath-scanner in springboot jar, my problem got solved!!
@rmalchow You’re welcome. Should be fixed for good now, I had missed the case that you were triggering. Released in 2.0.19. Thanks again.