我可以删除Gradle构建中的'jar'任务吗? [英] Can I remove the 'jar' task in gradle build?
问题描述
apply plugin'java'$ 使用下面的代码时,会生成一个jar文件。 b $ b
是否有任何设置不会生成jar文件?
我可以编写一个自定义插件,但下面的代码是错误的。
依赖关系{
编译项目(':crm.common')
testCompile组:'junit',名称:'junit',版本:'4.12'
}
我想要找到一种不会生成jar文件的方法。
并且可以在依赖关系中运行编译。
有什么办法可以做到吗?
-
从执行中明确排除
jar
任务:
gradle build -x jar
-
禁用
jar
build.gradle
:
应用插件:'java'
中的
When I use the code below, a file of jar will generate after gradle build.
apply plugin 'java'
Is there any settings won't generate the file of jar??
I can write a custom plugins,but the code below was wrong.
dependencies {
compile project(':crm.common')
testCompile group: 'junit', name: 'junit', version: '4.12'
}
I want find a way that donot generate the file of jar. And can run compile in dependencies. Is there any way can do that???
You can do that by 2 ways:
explicitly exclude the
jar
task from execution:gradle build -x jar
disable the
jar
task inbuild.gradle
:apply plugin: 'java' jar.enabled = false
这篇关于我可以删除Gradle构建中的'jar'任务吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!