且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

M2E 并让 maven 生成源文件夹作为 Eclipse 源文件夹

更新时间:2022-04-25 01:16:00

您需要使用 build-helper-plugin.

像这样:

 <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}/generated-sources/java/</source>
                </sources>
            </configuration>
        </execution>
    </executions>
 </plugin>

您还需要: