Skip to content
Advertisement

Maven: Classpath dependencies and starters?

in this tutorial https://usha-dewasi.medium.com/service-registry-using-spring-cloud-netflix-eureka-cba573c693b under “Installing Eureka on Server Side” there is the instruction to

Add org.springframework.boot:spring-cloud-starter-eureka-server on your classpath.

Now as a beginner with maven and spring I don’t know what is meant both with the term starter, nor do I know how to “add,” what is obviously a groupId and an artifactId on “your classpath.”

I just found the term being used here https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html as well as in this (https://maven.apache.org/plugins-archives/maven-surefire-plugin-2.12.4/examples/configuring-classpath.html) maven-doc entry for classpaths.

I am not exactly sure what I am supposed to do or how to change the pom.xml accordingly. I don’t find an explanation anywhere. Would be glad for your help.

Yours sincerely, von Spotz

Advertisement

Answer

With “add X on our classpath” in a maven project they mean adding the X dependency on your pom.xml as follows:

<dependencies>
    (... Other dependencies ...)
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        <version>3.0.3</version>
    </dependency>
    (... Other dependencies ...)
</dependencies>

Read more here.

Regarding the Spring Boot Starters, they are basically a set of convenient dependency descriptors that you can include in your application, eliminating the need to add a bunch of dependencies on your own. It also guarantees that the versions of the dependencies they include indeed work together. Read more here.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement