classgraph: Classpath Scanning in Spring Boot Jar Not Working
I 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?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (12 by maintainers)
Commits related to this issue
- Support scanning of jars within jars, as needed by Spring. (#46) — committed to classgraph/classgraph by lukehutch 8 years ago
- Patch for #46 (temp files being removed too early) — committed to classgraph/classgraph by lukehutch 7 years ago
- One more patch for #46 — committed to classgraph/classgraph by lukehutch 7 years ago
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.
Ah I see, cheers @lukehutch 👍