【问题标题】:How to resolve the maven build failure?如何解决maven构建失败?
【发布时间】:2017-03-08 19:05:54
【问题描述】:

我已经创建了 Spring Boot 应用程序。当我以清洁和安装为目标运行 pom.xml 时,出现构建失败并出现以下错误。

[ERROR] 未能执行目标 org.springframework.boot:spring-boot-maven-plugin:2.0.0.BUILD-SNAPSHOT:repackage (默认)在项目第一:

<groupId>First</groupId>
<artifactId>First</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<name>First</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.BUILD-SNAPSHOT</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-data-jpa</artifactId>
    </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>
</dependencies>

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

<repositories>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

对此有任何建议。

【问题讨论】:

  • 这是您得到的唯一错误吗?您是否使用 -X 或 -e 标志运行 maven 以获取更多信息?
  • 我还没有使用 -x 和 -e 运行 maven。但我已经在eclipse中运行干净并安装了maven

标签: maven spring-boot


【解决方案1】:

我认为您使用的快照存储库不正确,应该是https://repo.spring.io/libs-snapshot,而不是https://repo.spring.io/snapshot

【讨论】:

  • 是的,我知道了。缺少快照
猜你喜欢
  • 2020-11-02
  • 2014-02-06
  • 1970-01-01
  • 1970-01-01
  • 2021-07-24
  • 2019-07-10
  • 2021-11-08
  • 2019-03-26
  • 1970-01-01
相关资源
最近更新 更多