1

I would like to fork the Spring Initializr from GitHub and add my own nexus repo and common dependencies we use.

Forking and modifying the code is no issue. I do have a few questions: 1. How can I tell the Spring Boot CLI to use my custom initializr? 2. How can I tell Spring Tool Suite to use my custom initializr?

Stephane Nicoll
  • 31,977
  • 9
  • 97
  • 89
dmfrey
  • 1,230
  • 1
  • 17
  • 33

2 Answers2

0

In the CLI you add the --target parameter:

spring init --target http://your.service.url

In Spring Tool Suite it seems it's not possible.

dunni
  • 43,386
  • 10
  • 104
  • 99
  • 1
    In STS you can also manually set the target in the "New Spring Starter" dialogue (instead of clicking Finish at the end click Next and edit the URL there). There used to be an undocumented way to change it with a properties file, but I have a feeling that is not available now. – Dave Syer Jan 27 '16 at 16:56
  • You're right, Dave. But if you change the URL after the dependencies selection, how would it pick up custom artifacts, which you want to add to your own initializr? I guess STS queries the Initializr to get the list of available dependencies, in that case i would expect to be able to change the URL before the dependencies selection (like in IntelliJ). – dunni Jan 27 '16 at 19:21
  • plus one on being able to configure where to find the initializr in STS. – George Smith Mar 17 '16 at 04:46
  • The information about STS is inaccurate. It is possible via a system property. Granted... it would be hard for anyone to discover this unless they read the STS source code. I've added an answer to explain how to use system property to change the url for STS. – Kris Jun 04 '16 at 22:23
0

In Spring Tool Suite you can add a system property to your STS.ini file to change the url the wizard uses. E.g add something like this right after -vmargs

-Dspring.initializr.json.url=http://start.spring.io

Of course... change the url to the one where your modified version the intialzr service is deployed.

Kris
  • 3,898
  • 1
  • 23
  • 32