我正在使用build-helper-maven-plugin向我的Spring-Boot Java项目添加其他资源。这是POM条目:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>../auditloggerclient/src/main/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
尽管我已经在Spring的组件扫描注释中添加了它,但是Spring在添加的包中没有发现任何Bean。
@ComponentScan(basePackageClasses = {AuditLoggerClient.class})
要包含的类在目标文件夹中可见,因此在编译时已正确包含了它们。
有人对结合使用Spring(-boot)和build-helper-maven-plugin有经验吗?