【发布时间】:2019-10-08 13:26:58
【问题描述】:
我正在尝试学习 Spring Boot 并将 Spring Boot 安装到 Eclipse IDE。当我创建我的第一个项目时,它在 pom.xml 的第一行显示错误。它显示为未知错误。
我尝试了许多来自 stackoverflow 的解决方案。但它们都不适合我。
Maven pom.xml error in eclipse When maven says "resolution will not be reattempted until the update interval of MyRepo has elapsed", where is that interval specified?
我的 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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<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>
</project>
谁能帮我解决这个问题。
【问题讨论】:
-
使用 -X 参数运行 maven 以获得更多调试信息和共享。例如, mvn -e -X clean package
-
可以添加错误信息吗?
-
@akuma8 org.apache.maven.lifecycle.MissingProjectException: 你指定的目标需要一个项目来执行但是这个目录下没有POM
-
你跑了什么目标,你在哪里跑的?
there is no POM in this directory -
该错误表示您尝试在文件夹(项目)中运行maven命令但没有pom.xml。
标签: spring-boot pom.xml