Issue
I would like to replicate href="https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.7.2&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=explorecali&name=explorecali&description=Explore%20California%20Microservice&packageName=com.example.explorecali&dependencies=web,data-rest,h2,data-jpa" rel="nofollow noreferrer">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.
Solution
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.
Answered By - lane.maxwell
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)