Maven 使用多个 src 目录编译 [英] Maven compile with multiple src directories
本文介绍了Maven 使用多个 src 目录编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在单个 maven 项目中编译多个 java 源目录?
Is there a way to compile multiple java source directories in a single maven project?
推荐答案
您可以使用 build-helper 添加新的源目录:
You can add a new source directory with build-helper:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/generated</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
这篇关于Maven 使用多个 src 目录编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文