有没有办法在一个maven项目中编译多个java源目录?

推荐答案

您可以使用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>

Java相关问答推荐

判断大写字符串的Java方法总是返回假

使用hibiter中特定字段的where条款自定义映射

javafx getHostServices(). showDocument()调出Chrome而不是默认浏览器(Linux)

即使我正在使用并发方法,使用Javascript的应用程序也会继续冻结'

我不能再在Android Studio Hedgehog上用Java语言创建新项目了吗?

由于 list 中的权限错误,Android未生成

生成桥方法以解决具有相同擦除的冲突方法

如何在Spring Java中从数据库列中获取JSON中的具体数据

如何在JavaFX中处理多个按钮

解析方法";javax/imageio/metadata/IIOMetadata.getAsTree(Ljava/lang/String;)Lorg/w3c/dom/Node时加载约束冲突

Instancio未在日志(log)中显示测试失败消息

如何在Java中为thunk创建映射器函数

在Oracle db中,当我们提供字符串而不是数字时,比较是如何工作的?

如何在IntelliJ IDEA的Build.sbt中添加外部JAR文件?

如何处理两个几乎相同的XSD文件?

如何对存储为字符串的大数字数组进行排序?

我无法在我的Spring Boot应用程序中导入CSV依赖项

为什么Instant没有从UTC转换为PostgreSQL的时区?

如何在JSP中从select中获取值并将其放入另一个select

使用Java线程进行并行编程