25
votes

I have very good pure Java basic knowledge. As long as there are no XML config and no project management tools involved, I am very good.

The things that really confused me are the project management tools, e.g.: Maven, Gradle.

I am learning Spring, and it is so confusing to me since it involves many XML files and there is no clear explanation for it.

I am learning Spring from this set of video tutorials, Lecture 6
Spring "Hello World".

I couldn't get a Spring hello world done because it requires a xxxxx.xml file to config the beans (Java object). To generate the XML files, I need to generate an XML file using a plugin on IntelliJ 2016.

The question is I can't find the plugin to generate a XML file for the bean by following this official tutorial. There is no such plugin called " Spring Support".

What should I do to generate the beans.xml? (The file to manage beans for Spring)

5

5 Answers

25
votes

You can't enable Spring support with IntelliJ community Edition, it only available with paying version (Ultimate).
However, you can create the .xml file manually and CE version also supports it (a little bit).
To working with Spring or J2EE, you should get familiar with build tools like Maven, Gradle (or Ant in some special case). The concept is simple and you can get it easily from the official website (https://maven.apache.org/ - http://gradle.org/).
For Spring, if you are not familiar with creating a .xml file, you can use Java configuration instead or move to use Spring-boot to forget this configuration file (almost).
However, at first, I think you should get the basic concept of Spring and try to work well with .xml files configure. It'll be helpful in the future when you work with it deeply.

13
votes

Let's take things one by one:

  1. Your problem understanding builds management tools like maven and gradle. Try these links for tutorials: Maven in 5 Minutes, gradle is very advance build automation tool with continuous Integration features, you can find a good comparison between gradle and maven here.

  2. If you are confused about spring to try this book: Spring in Action 3rd Edition (4th Edition is also available, I recommend 3rd edition as you will be able to link XML to annotations.)

  3. You do not need any tool to generate XML files. Copy a sample spring configuration file from the internet, remove unwanted elements and write your own beans.

8
votes

The Spring support plugin is a feature of IntelliJ IDEA Ultimate, which is a commercial IDE. It's not available in the free Community Edition.

You don't need any plugin to generate the beans.xml file; you can write it manually in the source code editor.

7
votes

For Spring support, did you try "Spring Assistant" plugin ?

https://plugins.jetbrains.com/plugin/10229-spring-assistant

Good part it is it has active development.

Edit on Aug 21, 2020:
Seems like this plugin has no more active development. Its last release was in 2018 April.

No need to worry. We sill have some good news :-)

Its Github repository is here. We can clone the repo and make necessary changes what ever we specifically need.

0
votes

I know you are asking about IntelliJ Idea but as it is a commercial tool, you should pay to let you use its plugins. Another way is using "Spring Tools for Eclipse" which is a great environment to develop Spring applications. But you need to be familiar with eclipse. It can be downloaded from: Spring Tools 4 for Eclipse