'Beginner Question: Using spring initializr for previous versions or work around?

I've been pretty fond of Spring Initializr for the convenience of it, but I need to use Spring Boot 1.2.7 for a project and I'm not sure how to do that, but I'm thinking I could by just modding out the build.gradle or pom.xml files?

I've done similar where there were unforeseen complications or other conventions, of which I wasn't aware.

I'm a novice with good conceptual understanding of more recent versions and I have very little exposure to Gradle so far, so I'm looking for a beginner's solution and would appreciate any insights that would help me moving forward that I might have taken for granted using Initializr and supplied starter project files in the past.



Solution 1:[1]

This is a bit of a hack and your mileage may vary wildly on this.

Go to http://start.spring.io using Chrome (I'm suggesting this as I'm readily using this and it may be possible in a similar fashion using other browsers but I'm not going into that here).

  • Right click on the version field (I think 2.1.2 the current at this time) and select 'Inspect'
  • Expand the HTML select element
  • Right click on the select element and choose "Edit as HTML"
  • Add the element <option value="1.2.7.RELEASE">1.2.7</option> to the end.
  • Select outside of the element to commit the edit
  • At this point you should be able to select the version as 1.2.7 and create a project from there.

As I said, this may work but is not guaranteed.

You can possibly go to https://github.com/spring-io/initializr/ and run up a local instance of your own.


Taking a deeper look at this I also found that you can use the Spring-Boot CLI (command-line interface - check spring-boot documentation on where to acquire). If you specify the option --boot-version=1.2.7.RELEASE to the init command you can set the version of spring-boot to work with. I believe you can also add --dependencies=web,data,etc to get the bits you need for your project to operate.

Solution 2:[2]

You can do it with Eclipse.

Precondition: For this you need to have "Spring Tools 4" installed (Help -> Eclipse Marketplace -> add Spring Tools and Restart Eclipse).

Then choose File -> New -> Other... -> Spring Starter Project

In the following dialogue you can make the same kind of configurations as on http://start.spring.io (since Spring Tools 4 uses their API)

But (and this is important), in the final step you can review the url that is called and make exactly those changes you wish to make (e.g. choose a different Version of Java or Spring Boot)

For me this worked perfectly.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 gandalf