在 spring 引导项目中添加 apache derby 的依赖项时出错
Error adding the dependency for apache derby in spring boot project
我正在从 starter.spring.io 创建一个新的 maven 项目,其依赖项为 web、spring data JPA 和 Apache Derby,即使没有编写任何代码,它也显示 error 在 POM.xml 文件中!
请帮我解决这个错误。
这是完整文件 pom.xml。
'''
4.0.0
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>io.abhinav</groupId>
<artifactId>coutse-api-data</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>coutse-api-data</name>
<description>course api data prohect for spring starter</description>
<properties>
<java.version>1.4</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.derby/derby -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
'''
因为 Maven Central Repository 不再支持通过 HTTP 进行通信您应该将此声明添加到您的 pom.xml:
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
通过添加此语句,您更新了 Maven 的中央存储库并使用 HTTPS 而不是 HTTP。
这个帖子可以让您更深入地了解这个主题:。
我正在从 starter.spring.io 创建一个新的 maven 项目,其依赖项为 web、spring data JPA 和 Apache Derby,即使没有编写任何代码,它也显示 error 在 POM.xml 文件中!
请帮我解决这个错误。 这是完整文件 pom.xml。
'''
4.0.0
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>io.abhinav</groupId>
<artifactId>coutse-api-data</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>coutse-api-data</name>
<description>course api data prohect for spring starter</description>
<properties>
<java.version>1.4</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.derby/derby -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
'''
因为 Maven Central Repository 不再支持通过 HTTP 进行通信您应该将此声明添加到您的 pom.xml:
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
通过添加此语句,您更新了 Maven 的中央存储库并使用 HTTPS 而不是 HTTP。
这个帖子可以让您更深入地了解这个主题: