您可以更改项目结构,以将该文件夹添加为“源”目录。
项目结构→模块→ 单击
generated-sources文件夹并使其成为
sources文件夹。
要么:
<plugin> <groupId>org.prehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.4</version> <executions> <execution> <id>test</id> <phase>generate-sources</phase> <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>${basedir}/target/generated-sources</source> </sources> </configuration> </execution> </executions></plugin>


