【问题标题】:Missing artifact org.springframework:spring-core:jar:4.3.0.RELEASE缺少工件 org.springframework:spring-core:jar:4.3.0.RELEASE
【发布时间】:2021-10-18 11:35:14
【问题描述】:

我尝试使用 maven-springboot 创建一个 webbservice。以下是我在 pom 文件中使用的依赖项。


<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>org.springframework</groupId>
  <artifactId>SpringService</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>

  <name>SpringService Maven Webapp</name>
  <url>http://www.example.com</url>

  <properties>
        <springframework.version>4.3.0.RELEASE</springframework.version>
        <jackson.library>2.7.5</jackson.library>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>${springframework.version}</version>
</dependency>
    <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-core</artifactId>
         <version>${springframework.version}</version>
    </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${springframework.version}</version>
        </dependency>
          <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.library}</version>
        </dependency>
  </dependencies>

但是,我收到一个错误 Missing artifact org.springframework:spring-core:jar:4.3.0.RELEASE for spring-web, spring -corespring-webmvc。请提出解决方案。

【问题讨论】:

  • &lt;version&gt;4${springframework.version}&lt;/version&gt; : 你有一个错字,看到 4 了吗?
  • 抱歉,问这个问题时弄错了。我已经在我的问题中更正了它。
  • 我试过你的配置,对我来说似乎是文件。尝试使用-X 标志在详细日志中查找线索。

标签: java spring spring-boot maven


【解决方案1】:

删除文件夹 /Users/username/.m2/repository/org/springframework 然后运行 ​​maven install 对我有用。

【讨论】:

  • 接受您的正确答案;)
猜你喜欢
  • 2017-09-14
  • 2016-08-12
  • 2018-02-02
  • 1970-01-01
  • 1970-01-01
  • 2018-10-17
  • 2016-06-15
  • 2019-04-06
  • 1970-01-01
相关资源
最近更新 更多