当前位置: 首页 > 知识库问答 >
问题:

使用STS生成Spring Boot Maven项目错误

东郭海阳
2023-03-14

在spring STS中创建一个新的spring starter项目时,我收到以下错误消息

项目生成错误:COM的父POM不可解析。test:security:1.3.8-快照:无法传输org.springframework.boot:spring-boot-starter-parent:POM:1.3.8.来自https://repo.maven.apache.org/maven2的版本已缓存在本地存储库中,在经过central的更新间隔或强制更新之前,不会重新尝试解析。原始错误:无法传输项目org.springframework.boot:spring-boot-starter-parent:POM:1.3.8。从/到central发布(https://repo.maven.apache.org/maven2):连接超时,且“parent.relativePath”不指向本地POM

pom.xml:

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.test</groupId>
   <artifactId>security</artifactId>
   <version>1.3.8-SNAPSHOT</version>
   <packaging>jar</packaging>
   <name>security</name>
   <description>Demo project for Spring Boot</description>

   <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>1.3.8.RELEASE</version>
      <relativePath />
      <!-- lookup parent from repository -->
   </parent>

   <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
      <java.version>1.8</java.version>
   </properties>

   <dependencies>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-security</artifactId>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-test</artifactId>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
         </plugin>
      </plugins>
   </build>
</project>

对于每个spring starter项目,我都会收到上面的错误消息。

共有1个答案

程亦
2023-03-14

您应该将Spring boot父级依赖项更新到最新的realease 1.5.3:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.3.RELEASE</version>
</dependency>
 类似资料:
  • 当我尝试构建我的解决方案时,我得到以下错误消息: 严重性代码描述项目文件行禁止显示状态错误此项目引用了此计算机上缺少的NuGet包。使用NuGet包还原来下载它们。如需详细资讯,请参阅http://go.microsoft.com/fwlink/?LinkID=322105.遗失的档案是..\包\Microsoft。net . compilers . 1 . 1 . 1 \ build \ Mic

  • 当我使用Android Studio构建android项目时,出现了一个未知错误,具体错误如下扭曲了我。 ' '错误:C:\ Users \ username . gradle \ caches \ 3.3 \ scripts \ ao 5 yh 51 kitdkvn 790 wbtokixe \ init \ init 2c e2b 8 bb 7806 b 691787 e 7 BD 8 \ c

  • 当我想将我的项目导入到sts(eclipse)时,我得到了一个错误。我用spring roo和它的工作在另一台笔记本电脑上生成这个项目,所以我只想导入并在tomcat服务器上运行。有人知道这是什么,我看dependecies和这个类在那里(我使用Windows): 2012-10-16 23:32:42,540[main]错误org.springframework.web.Context.cont

  • 我正在使用Jenkins构建Xamarin Android项目。 我看到了错误: /图书馆/框架/Xamarin。Androidframework/Versions/Current/bin/mono-symbolicate:line 6:exec:mono:notfound/Library/Frameworks/mono。framework/External/xbuild/Xamarin/Andr

  • 我用无数次的谷歌搜索尝试了这么多次。但这行不通。它给出了一个BeanCreationException。 pom.xml```https://maven.apache.org/xsd/maven-4.0.0.xsd“>4.0.0 org.springframework.Boot spring-boot-starter-parent 2.2.6.release com.example Registe

  • 我得到以下指定错误, 错误:(115)***Android NDK:正在中止。停下来。错误:执行任务“:un7zip:CompileReleAsendk”失败。 com.android.ide.common.process.processException:使用参数{ndk_project_path=null app_build_script=e:\apprizort\rizortCardboar