1

I'm learning how to use gradle to build my java applications. Currently I'm using eclipse with buildship plugin. I have it building my JARs and WARs, and also have gradle running my JUnit and Selenium tests. I like that it pulls in the dependencies I need as I need them during development.

It seems like it would make sense if my build.gradle files define my dependencies to build and run my application in dev then I should be able to use them for deployment. Otherwise I have to retrieve all my dependencies by some other means and deploy to my production environment, and managing 2 different methods of retrieving and deploying dependencies seems to be a risk for problems.

Can I use gradle or at least my build.gradle files in some way for my deployment?

Topani
  • 23
  • 1
  • 6
  • Your JAR or WAR should contain all necessary dependencies in order to deploy your app. – Adam Jan 03 '17 at 20:57

1 Answers1

1

Take a look at the gradle distribution plugin. This plugin adds tasks to create an "install folder" or an archive file (zip or tar) containing all the dependencies you'll need to execute/deploy your application.

Gradle application plugin also generates shell/bat scripts to invoke your application.

piet.t
  • 11,718
  • 21
  • 43
  • 52
RaGe
  • 22,696
  • 11
  • 72
  • 104
  • Thanks for the answer. Between Adam's comment and this Answer I think I was able to get my app packaged. Thank you! – Topani Jan 15 '17 at 20:06