gpt4 book ai didi

gradle - Gradle Java插件的构建类软件包结构不一致

转载 作者:行者123 更新时间:2023-12-03 04:16:42 25 4
gpt4 key购买 nike

我正在尝试在build.gradle中仅一行运行简单的gradle构建:

apply plugin: 'java'

Java文件放置在 src / main / java / hello / Hello.java下

当我运行build.gradle时,在下面生成已编译的Hello.class

build / classes / java / main / hello / Hello.class

我期望的是:

build / classes / main / java / hello / Hello.class

你好.java-
package hello;
class Hello{
public static void main(String args[]){
System.out.println("Hello Java");
}
}

有人可以解释一下吗?谢谢。

最佳答案

这在Gradle 3.x和4.x之间发生了变化。

The reason we went with build/classes/java/main vs build/classes/main/java is that it was less likely to break in strange ways with builds and plugins that hardcoded the path to build/classes/main or snuck outputs into build/classes/main.



来自 Gradle forum discussion

关于gradle - Gradle Java插件的构建类软件包结构不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54813851/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com