eatSleepCode
eatSleepCode

Reputation: 4637

gradle Difference between jar and assemble task

what is the difference between assemble and jar task of java plugin in gradle?

I tried executing them with a sample Hello world project they both seems to do the same job.

Upvotes: 14

Views: 7812

Answers (1)

Stanislav
Stanislav

Reputation: 28126

Since jar is a single task, which assembles a jar-archive for current project, assemble is, according to documentation:

assemble All archive tasks in the project, including jar. Some plugins add additional archive tasks to the project. Task Assembles all the archives in the project.

It is build-cycle task, which execute all the task of this build-cycle phase. Like a check task, which runs all test and verification task, assemble Runs all task, which essemble some artifacts. And the 'jar' could be not the only such a task in the project, some plugins could add them too.

Upvotes: 15

Related Questions