7

I have converted a maven project to gradle , I am using Spring tool suite and all the dependency jars are uploaded successfully .When I build the project it builds successfully. but I am not getting an idea how to run this web application , I tried to make a war so that I can used tomcat to deploy , I found tomcat plugin for that but when I insert tomcat plugin in my build.gradle file ,it gives me error: Plugin with tomcat id not found

Please help someone I am just stuck , I am assuming the structure it follows is same as gradle and as I am using jsp pages and xml files can I keep these files in my resources folder .

How can i create the war file of project and deploy using eclipse-wtp in tomcat?

Cengiz
  • 5,375
  • 6
  • 52
  • 77
Ruby
  • 873
  • 5
  • 20
  • 47

1 Answers1

14

To create a war just use: apply plugin: 'war'

For WTP add these lines to your build.gradle:

apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'

To deploy the war file with tomcat within your build you can use the cargo plugin. In that way you can start after the deployment e.g. integration tests etc.

To deploy the war file within eclipse tomcat: You must first run gradle eclipse after you put the above apply plugin: ... into your build.gradle. Then refresh within eclipse and add the web project to your tomcat.

Cengiz
  • 5,375
  • 6
  • 52
  • 77
  • where this war file gets stored ?i followed these steps, added eclipse and eclipse-wtp and war plugin but not able to see where the war file is created after successfully build... – Ruby Feb 28 '13 at 07:07
  • look at /build/libs directory – Cengiz Feb 28 '13 at 11:07