摇篮不生成罐子 [英] Gradle not generate jar

查看:83
本文介绍了摇篮不生成罐子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的gradle有问题. 我的项目它包含几个模块(osgi). 当我运行命令时: ./gradlew清洁组装 Gradle为每个模块生成jar文件,但我想使用以下命令: ./gradlew clean compileJava 为了加快工作速度,但是使用此命令gradle不会为两个模块生成jar文件. 可能是什么原因?

I have a problem with gradle. My project It consists of several modules (osgi). When I run command: ./gradlew clean assemble Gradle generate the jar file for each module, but I want use the command: ./gradlew clean compileJava to speed up the work, but with this command gradle don't generate the jar file for two module. what could be the reason?

推荐答案

您可以从

You can see in the diagram in figure 1 from this documentation the dependencies between Java plugin tasks:

  • 看到assemble任务取决于jar任务:这就是为什么当您执行gradlew assemble Gradle会为每个模块构建jar的原因
  • 看到compileJava任务没有依赖性:此任务将简单地将Java源文件编译为.class文件.这就是为什么仅执行gradlew clean compileJava不会产生jar的原因.
  • see that assemble tasks dependes on jar task: this is why when you execute gradlew assemble Gradle will build the jar for each module
  • see that compileJava task has no dependency: this task will simply compile your java source file into .class files. That's why no jar will be produced if you execute only gradlew clean compileJava.

奇怪的是,您说您在调用gradle compileJave时得到了罐子:摇篮通常不应该生产这些罐子.

What is strange is that you say you get the jar procuded when invoking gradle compileJave : Gradle should normally not produce these jars.

这篇关于摇篮不生成罐子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆