vscode-spring-initializr
vscode-spring-initializr copied to clipboard
Using Add Starters will repeatedly add dependencies
This is the result(On the left is the one before add,On the right is after add)
PS: Every time add starters are used, dependencies will be added
same here
after adding spring data jpa and posgresql driver
I have the same issue when trying to add new dependencies whether I create the project using Spring Initalizr inside VS Code or import an existing project.
Do you mind pasting the entire POM of the original project to which starters are being added please?
I'm trying to reproduce it but with no luck so far... Perhaps there is something in the XML that prevents from finding the existing <dependencies> element
Thank you for your response Below is the complete pom.xml file for the original project:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.1</version>
<relativePath />
<!-- lookup parent from repository -->
</parent>
<groupId>com.openclassrooms</groupId>
<artifactId>watchlist</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>watchlist</name>
<description>Demo project for Spring Boot</description>
<url />
<licenses>
<license />
</licenses>
<developers>
<developer />
</developers>
<scm>
<connection />
<developerConnection />
<tag />
<url />
</scm>
<properties>
<java.version>22</java.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I also attempted to add a new dependency, but instead of appending to the existing <dependencies> block, a new <dependencies> tag was created, and the chosen dependency was added within it.
Let me know if you need more details or have any thoughts on resolving this behavior.
It is likely due to tags like this: <developer /> if these are replaced with <developer></developer> then it might start working...
Namely it is the <url /> under the <project> tag (under the root)
Thank you for your guidance! I replaced the self-closing tags, including