猿问
回到首页
个人中心
反馈问题
注册登录
下载APP
首页
课程
实战
体系课
手记
专栏
慕课教程
Maven编译多个src目录
有没有办法在单个Maven项目中编译多个Java源目录?
千万里不及你
浏览 1193
回答 3
3回答
至尊宝的传说
您可以使用build-helper添加新的源目录:<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <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>
0
0
0
子衿沉夜
通过定义资源标签,这也适用于maven。您可以随意命名src文件夹名称。 <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.java</include> <include>**/*.properties</include> <include>**/*.xml</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.java</include> <include>**/*.properties</include> <include>**/*.xml</include> </includes> </resource> <resource> <directory>src/main/generated</directory> <includes> <include>**/*.java</include> <include>**/*.properties</include> <include>**/*.xml</include> </includes> </resource> </resources>
0
0
0
打开App,查看更多内容
随时随地看视频
慕课网APP
相关分类
Java
继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续