Gradle not generate jar

我们两清 提交于 2021-01-28 08:54:08

问题


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?


回答1:


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

  • 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.

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



来源:https://stackoverflow.com/questions/54716452/gradle-not-generate-jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!