Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring引导Jar中的类路径扫描不工作_Java_Spring_Spring Boot_Classpath - Fatal编程技术网

Java Spring引导Jar中的类路径扫描不工作

Java Spring引导Jar中的类路径扫描不工作,java,spring,spring-boot,classpath,Java,Spring,Spring Boot,Classpath,我有一个自定义注释: @Target(value=ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Pipeline { String id (); String name (); boolean visible () default true; String role () default "USER"; } 我在带有嵌套JAR的Spring Boot应用程序的接口上使用: @Pi

我有一个自定义注释:

@Target(value=ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Pipeline  {
  String id ();
  String name ();
  boolean visible () default true;
  String role () default "USER";
}
我在带有嵌套JAR的Spring Boot应用程序的接口上使用:

@Pipeline(id="my-pipeline", name="My Pipeline")
public interface Echo {
  ...
}
我的项目结构:

parent-boot-project
   |
   --- plugin1.jar 
   --- plugin2.jar <--- interfaces are here
   --- ...

在我的IDE(eclipse)上非常有效,但在构建jar时就不行了。试图在类路径上乱搞,但没用。有人碰到过这样的事吗

FastClasspathScanner已重命名为ClassGraph,现在支持全Spring启动扫描。

FastClasspathScanner已重命名为ClassGraph,现在支持全Spring启动扫描。

FastClasspathScanner做出的假设在嵌套JAR中不成立。为什么不使用Spring框架的类路径扫描支持呢?我尝试使用
ClassPathScanningCandidateComponentProvider
,但它似乎只适用于bean,而在我的例子中,这些只是带注释的接口。我遗漏了什么吗?FastClasspathScanner做出的假设在嵌套jar中并不成立。为什么不使用Spring框架的类路径扫描支持呢?我尝试使用
ClassPathScanningCandidateComponentProvider
,但它似乎只适用于bean,而在我的例子中,这些只是带注释的接口。我错过什么了吗?
new FastClasspathScanner(BASE_PACKAGE)
    .matchClassesWithAnnotation(PIPELINE_ANNOTATION, aProcessor)
    .verbose()
    .scan();