Search code examples
javaspringspring-tool-suite

How to correctly create a simple Spring project running in the console using the last STS version (3.8.4.RELEASE)?


today I downloaded the last STS version (3.8.4.RELEASE) and I have some doubts because it seems to me that something is changed.

I have to create a simple batch application (running in the console).

It seems to me that to create this kind of project in this new realease I have to do:

File --> Spring Legacy Project --> Simple Spring Maven

It seems to me that there is no other way to create a simple console project. Why this kind of project are putted under the Spring Legacy Project? Can I do the same thing in a more modern way?

Another doubt is related to the Spring Version into the pom.xml file:

<spring-framework.version>3.2.3.RELEASE</spring-framework.version>

Why the default version is the 3.2.3.RELEASE? Can I replace it with the more m odern Spring 4^


Solution

  • As its name says "Spring Legacy Project" is a legacy functionality. It create old Spring projects.

    Spring now is promoting Spring Boot applications, these applications have everything you need configured by default. You only need to add the dependencies that you need.

    Now you need to use:

    File -- > New -- Spring Starter Project

    On the first view you configure the project. Where is located, maven or gradle, etc.

    On the second view you choose the libraries that you will use in your porject. You choose if it is a web project, or if you need jdbc or jpa, or batch processing.

    In your case, if you don't need a web application, you just don't added to the project.

    You can see more about Spring boot here

    https://projects.spring.io/spring-boot/