Reputation: 57
I am working on a really basic program in spring. This is a snippet of my pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
This is the error I am getting:
[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter:jar is missing. [ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-mail:jar is missing. [ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-test:jar is missing.
I get that this is because my dependencies don't have a < version > section. However, in all the other java applications that I have worked on, including the one I am referencing right now, the versions for these basic dependencies are never included. Is there something else in my pom that I am supposed to include beforehand, that may be included in the files that I am referencing but not the one I have created from scratch? If not, how are they working without the version included in their pom dependencies? Additionally, how would I go about finding the version for these basic dependencies?
Upvotes: 0
Views: 4184
Reputation: 351
Please add Spring Starter Web Maven Dependency in Pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.5.7.RELEASE</version>
</dependency>
As Spring downloads latest version of dependency so we do not have to declare explcitly.
Upvotes: 1