Home > Back-end >  Initializr service call failed, returned Bad Request: Unknown dependency 'rest'
Initializr service call failed, returned Bad Request: Unknown dependency 'rest'

Time:07-26

I would like to replicate this Spring Initializr setup using the spring init cli.

However, the command returns the following error message whenever I try to add 'rest' as a dependency i.e. Rest Repositories that expose Spring Data repositories over REST.

Initializr service call failed using 'https://start.spring.io' - service returned Bad Request: 'Unknown dependency 'rest' check project metadata'

Here is the command I'm running:

spring init --build=maven \
--java-version=11 \
--artifact=explorecali \
--package-name=com.example.ec \
--name=explorecali \
--description="Explore California Microservice" \
--dependencies=web,h2,jpa,rest \
--packaging=jar \
sample-app.zip

If rest isn't the correct dependency name, what is? Moreover, how can one list the available dependencies from the command line to get their correct names.

CodePudding user response:

Take a look at the link you posted, it has the dependency names listed out.

The Rest Repositories are added with data-rest, not rest. Spring Data JPA is added with data-jpa, not jpa.

Hope this helps.

  • Related