Vaibhav More
Vaibhav More

Reputation: 1092

Spring Boot project in IntelliJ community edition

I am new to IntelliJ Community edition. Can anyone help me with creating spring boot project in intelliJ Community edition. For ultimate edition there is spring-boot initializer but I cannot find anything for community edition. I followed this links but cannot find any solutions

Upvotes: 58

Views: 149291

Answers (9)

yoAlex5
yoAlex5

Reputation: 34175

IntelliJ IDEA CE and Spring Boot

You can create Application configuration

  • Set correct SDK
  • Enable and set Environment Variables(using Modify options)
    • set Spring Boot profile using SPRING_PROFILES_ACTIVE key

Upvotes: 0

user404
user404

Reputation: 2028

Pretty simple, as both link you attached say you created your project with Spring Initializr, and if it is a maven project, then follow these steps mentioned below:

  • click on File option
  • click Open option
  • navigate to your project and choose pom.xml file [if not a maven project, choose your configuration.xml file, if something else, just select the project folder]
  • press Ok. And you are done
  • now, open idea terminal and run mvn clean install(I assume you have installed maven) or, just select project->right click->choose maven-> click on Reimport maven option. Now run mvn clean build All are set now.

Upvotes: 9

likejudo
likejudo

Reputation: 3726

As everyone else mentioned, use https://start.spring.io to start your Spring Boot project. Download and open in IntelliJ Community Edition.

Where you will face some difficulty is in running the project; - Ultimate Edition has a Spring Boot plugin that is missing in Community Edition.

You may get errors especially if your main folder of your project is one level higher than the root of your IntelliJ project.

For this, use the Maven run option.

Edit Configuration and Click the + to create a new Maven configuration

maven run

Upvotes: 7

Prajval Singh
Prajval Singh

Reputation: 1111

Apart from the spring initialiser, in my experience no where else do you need an ultimate edition to work with spring boot, you can use Spring Intialiser

But there is a plugin as rightly mentioned by other Spring assistant which you can download from the plugin section which you can access from setting inside intellJ Idea.

For configuration instead of actually going in the edit configuration option of intellJ Idea you can just run the application and that would automatically have your configuration loaded and there onwards you can always use it.

Upvotes: 0

Maninder
Maninder

Reputation: 1919

Just go to the below mentioned:

https://start.spring.io/

Fill the information regarding Project(Maven, Java, spring-version(Select version only have digits(for eg:2.6.2))). Don't select "snapshot" version.

Fill project Metadata information and click on Generate file. It will create jar file. Unzip it and open your IntelliJ and select "Open->select this Unzip folder and select "pom.xml" file inside this package and open as project.

Upvotes: 1

Toshal Agrawal
Toshal Agrawal

Reputation: 335

You can follow these steps.

  1. Click on Add / Edit configuration enter image description here

  2. Then select configuration type as application. enter image description here

  3. Fill in appropriate details. Note: In place of <no module> add directory / module in which the entry class is present. enter image description here

  4. Save the configuration and click on Run / Debug symbol shown in first screenshot.

Upvotes: 6

Hamza Khanzada
Hamza Khanzada

Reputation: 1529

Extending @Prashant's answer

If you are not able to find Spring Assistant plugin within IntelliJ Community Edition, Go to Plugin's website and then click on GET button, Choose Compatibility with IntelliJ IDEA Community and then click Download.

Spring Assistant Plugin Website

The rest of the procedure remains the same as described by @Prashant.

Also if you want to change your Port, then select Modify Options and select Add VM Options, and paste

-Dserver.port=8090

in that VM Options textbox and then run the application.

Modifying Configuration for port

Upvotes: 1

Prashant
Prashant

Reputation: 5383

You can install a plugin called Spring Assistant: Spring Assistant Now you can use the initializer as: Using initializer Personally, however, I use Spring initializer at start.spring.io

EDIT: Adding run configuration
Select Edit Configuration from the Run menu Run menu Now in the dialog box, lick on the + button and select Application. Run Configuration dialog Now you just need to provide the name of the main class. You could click on the browse button(...) to get a list of files having main(...). Select class with main()

Upvotes: 33

Dulaj Kulathunga
Dulaj Kulathunga

Reputation: 1250

If you have done your spring project with SPRING IO

Then You can import it as maven project and follow this steps to import spring project

  1. Open IntelliJ IDEA

  2. You can see Welcome screen, click Import Project. The Select File

  3. Navigate to your Maven project and select

  4. Click OK.

Upvotes: 7

Related Questions