繁体   English   中英

Maven Spring 使用 spring-boot-starter-data-rest 引导项目未检测到目标源中自动生成的存储库

[英]Maven Spring Boot project with spring-boot-starter-data-rest does not detect auto generated repository in target source

我制作了一个插件,可以自动生成 spring 数据 JPA 类:需要的实体、存储库和配置。

我希望所有类都保持在target上,以便在清理项目时能够删除,并在安装时自动生成。

问题是当我运行项目时,目标中的存储库不可见。 我在生成的源中添加了目标文件夹:

 <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>add-source</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>${project.build.directory}/generatedjpaclasses</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>

有人知道这是否可能吗?

我尝试使用 RepositoryDe​​tectionStrategies.ANNOTATED 配置 RepositoryRestConfiguration。

谢谢。 努里亚

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM