任何方法在使用Gradle时,如果软件包名称错误,导致构建失败吗?

huangapple 未分类评论52阅读模式
英文:

Any way to fail a build if package name is wrong using gradle?

问题

我们有一个CompilingClassloader,它使用包名称来查找源*.java文件,但最近有人修改了名称,使其与位置不匹配,因此它以一种奇怪的方式完全失败了。

无论如何,当包名称与Java文件的位置不匹配时,我们是否可以让Gradle构建失败?

嗯,我想根据mentallurg的说法,这个构建本应该失败(那将是很棒的)...但实际上它通过了。注意:我使用'head -3'命令查看了有错误的文件的前三行(您可以阅读文件路径以查看差异)。我知道javac允许这样,但想知道Gradle是否与不允许这样的Eclipse相匹配(那会很好)。

任何方法在使用Gradle时,如果软件包名称错误,导致构建失败吗?

Gradle的版本是5.6.3

英文:

We have a CompilingClassloader that uses package names to find the source *.java files but someone recently modified the name to not match location, so it completely failed in a bizarre way.

Anyway we can have gradle fail the build when package name does not match java file location?

hmm, I guess according to mentallurg, this build was supposed to fail(which would rock)...instead it passed. NOTE: I 'head -3' the file in question that has the wrong package name(you can read the file path to see how it is different). I know javac allows that, but wondering if gradle matches eclipse which does not(that would be nice).

任何方法在使用Gradle时,如果软件包名称错误,导致构建失败吗?

The version of gradle is 5.6.3

huangapple
  • 本文由 发表于 2020年5月29日 06:09:08
  • 转载请务必保留本文链接:https://java.coder-hub.com/62075361.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定