Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creation of Gradle based web application in Intellij IDEA

I'm trying to create a gradle based java project in Intellij IDEA.

Steps are below:

Opening Intellij IDEA, Community edition > New project... > Gradle > selecting Auto import, create directories for empty content roots and use default gradle wrapper.

Now project has been created and added Webapp(inside WEB-INF created) folder to java directory.

I need to know the following:

  • What do I need to add in build.gradle?
  • How and where to configure server tomcat?
  • How to run the build.gradle?

Please help me finish this.

like image 249
user3762876 Avatar asked Nov 11 '22 06:11

user3762876


1 Answers

I am new to all of this and I was trying to do the same thing, so I did some research and I hope this will help you.

  1. You can imagine build.gradle as a build script, although strictly speaking it is a build configuration script. You run it by using the gradle command. The gradle command looks for a file called build.gradle in the current directory. The build script defines a project and its tasks. When you create the Gradle project, it should be created by itself so I don't think you should do anything about it.

  2. Do Alt+Ctrl+S > Build, Execution, Deployment > Application Servers and add your server.

  3. https://docs.gradle.org/current/userguide/userguide.html Here is the Gradle documentation, I hope it will help with the 3rd step))

like image 157
Aneta Baloyan Avatar answered Nov 14 '22 23:11

Aneta Baloyan