【问题标题】:Multiple Source Folder within a single eclipse project using MAVEN使用 MAVEN 的单个 Eclipse 项目中的多个源文件夹
【发布时间】:2012-04-12 16:38:57
【问题描述】:

我想使用 MAVEN 创建多源文件夹

项目/src/main/java/persistence 项目/src/main/java/business 项目/src/main/java/presentation

那么目标文件夹结构应该是: 目标/类/持久性 项目/src/main/java/business 项目/src/main/java/presentation

我在 stackoverflow 中搜索了这个问题。但我想不出解决办法。

我尝试使用“build-helper-maven-plugin”。但没有运气。

                       <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                <id>add-source</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>add-source</goal>
                </goals>
                <configuration>
                <sources>
                    <source>src/main/java/persistence</source>
                    <source>src/main/java/business</source>
                    <source>src/main/java/presentation</source>
                    <source>src/main/java/systemutil</source>
                    <source>src/main/java/service</source>
                </sources>
                </configuration>
            </execution>            </executions>

有什么帮助吗?

【问题讨论】:

  • 为什么要拥有多个来源?这听起来像是对 Maven 概念的误解。

标签: maven-2


【解决方案1】:

你的方法是正确的。配置文件夹中的Java文件应由maven编译。但是所有这些编译都被带到类文件夹本身。因此可以使用多源文件夹,但使用 build-helper-maven-plugin 无法实现多输出。

【讨论】:

    猜你喜欢
    • 2014-12-04
    • 1970-01-01
    • 2010-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-24
    相关资源
    最近更新 更多