What is the difference between installDist in distribution plugin and build in java plugin, gradle?

Viewed 3704

What is the difference between installDist task in gradle distribution plugin and build task in gradle java plugin? and how can we run the application generated by these two plugin? The scene i meet is that: i am learning hyperledger fabric, and found some java contract application in the tutorial using gradle distributon plugin and thus using installDist task, but there also some java contract using gradle java plugin instead of distribution plugin and the tutorial do not tell me how to deploy this kind of java contract.

1 Answers

installDist is a task from bundled Distrubution Plugin. Its output can be found at build/install/[project-name]. To detect what should be packaged, it relies on other plugins, for example Application Plugin. If that's present, after invoking ./gradlew installDist you'll find bulild/install/[project-name]/bin/[project-name].bat, which should run the application.

build is a common task to assemble and test the project. It often does not provide distribution which can be pulled into a separate directory or executed easily. Aforementioned Application Plugin adds run task which assembles and then runs the app directly from the project tree. Depending on the configuration of your project, there may be some custom tasks to deploy the contract.

Related