问题
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 onjar
task: this is why when you executegradlew 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 onlygradlew 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