*/ ( "/api/example" ) public class ExampleController Package br._spring_idea_ntrollers import import .annotation.GetMapping import .annotation.RequestMapping import .annotation.RestController /** Write the name of the package, in my example was: br._spring_idea_example, and create a class inside this package named ExampleApplication.java, and write the following code: Remember that creating a class in default package is not a good java practice, so, click in source folder main/java and create a package: Now we’ll create a class that will contain the main function of the project. 4.0.0 spring-boot-starter-parent 2.1.4.RELEASE br.com.danielpadua java-spring-idea-example 0.0.1-SNAPSHOT java-spring-idea-example Demo project for Spring Boot 1.8 spring-boot-starter-web spring-boot-starter-test test spring-boot-maven-plugin Īfter updating pom.xml a notification will pop-up at the bottom right corner of the screen:Ĭlick Import Changes for Maven refresh all project dependencies. With the project created, configure pom.xml according to the following snippet: In the next screen specify the GroupId, ArtifactId and the Version and click next:Īfter you just have to name your project and click finish: When selecting the archetype, IntelliJ IDEA will assume that you will use Quickstart archetype, which is ok for our goal. In IntelliJ IDEA’s initial screen, select Create New Project, located on the left side tab and select Maven, on the right side, select the JDK version and click next: Creating a Maven project and add Spring manually In the next screen confirm the project name and click finish. In the next screen, set the JDK version that you installed: Select the project to import and click next: You’ll see a window that is responsible for importing the Maven project, leave the defaults configs: Navigate to project’s directory and select the pom.xml file. Extract it to a directory of your choice, go back to IntelliJ IDEA and select Import Project. Click Generate Project to download the project zip file. So, we have two choices that we can explore: Use Spring Initializr WebĪccess:, and fill the fields like below:Ĭonfiguring project creation in Spring Initializrĭon’t forget to select Web as dependency. Unfortunately using IntelliJ IDEA Community, according to the documentation, there’s no support to create Spring Boot projects using Spring Initializr through the IDE in Community version, only in the Ultimate Edition. Creating the projectĪs soon as it starts, you’ll see the following screen:įor this example, we’ll be using Maven as build-tool. When you execute IDEA you will be questioned about some configurations like: theme color, shortcut key mapping and plugins. With IntelliJ IDEA installed, the configuration is pretty simple. Open your favorite terminal and install IntelliJ IDEA using the following command line: If you don’t know Homebrew, take a look at this post Go to jetbrains download page, select the latest version (on the writing date of this guide is the 2019.1.1) and install it as usual, dragging the app from the. Search the best way to install IntelliJ IDEA using your package manager. For Red Hat (or RHEL) based distros use yum or dnf. For instance, debian based distros, like the popular ubuntu, use apt-get.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |