解析生命周期处理指令时出错
Error parsing lifecycle processing instructions
下面是我的 pom.xml 文件。在第一行,我收到
错误
Error parsing lifecycle processing instructions.
我需要帮助找出导致错误的原因。
<?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.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>First</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.4.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-web</artifactId>
</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>
</project>
我也遇到过同样的问题。
我正在使用新的 Eclipse Neon。可能是这个新版本中包含的 Maven 版本的问题。
我已经使用 Gradle 而不是 Maven 解决了这个问题。
注意:您可以尝试在旧版本的Eclipse中使用Maven。
这是由于旧版本的 m2e-wtp 集成插件。要解决此问题,在 Eclipse(Neon) 中,您可以转到帮助 --> 安装新软件.. --> 输入 http://download.eclipse.org/m2e-wtp/milestones/neon/1.3/ in the Work with box and press enter. Tick all the checkboxes, install the plugins and restart the IDE. It should work. Similarly, for other versions, you might refer the following link https://www.eclipse.org/m2e-wtp/ 并根据您的 Eclipse 版本尝试 latest/previous 构建。
这个问题让我抓狂,我终于设法通过删除位于以下位置的整个 Maven 存储库来解决它:
Windows: c:\Users\<username>\.m2\
之后我刚刚更新了项目(Eclipse 中的 Alt+F5)。问题消失了!
可能是不同版本 Maven 的冲突(我使用了几个不同版本的 Eclipse + m2e 插件)。
看看eclipse web
http://marketplace.eclipse.org/content/maven-integration-eclipse-wtp
m2eclipse-wtp 项目已移至 Eclipse 基金会。 m2eclipse-wtp 插件现已弃用,取而代之的是更新的 m2e-wtp
来自市场的自动安装已暂停。 m2eclipse-wtp 0.15.3 可以从 http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/
手动安装
您需要先卸载 Eclipse 中的所有 m2e-wtp 插件,然后从 jboss url
安装它们
.m2 文件夹中有一些依赖项已损坏。
- 您需要从 .m2 文件夹中删除该依赖项。
- 如果您无法找到损坏的那一个,则删除所有
在 pom.xml 文件中声明的依赖项。
试试这个,它可能会有帮助。
<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.demo</groupId>
<artifactId>test1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java-version>1.8</java-version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>HelloWorld</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<warName>SpringWebExample</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
无需清理.m2文件夹,我通过在eclipse中添加相应的maven解决了这个问题
尽管添加了新路径并更改了用户设置,错误 "Error parsing lifecycle processing instructions" 仍然存在。我重新启动了服务器。是否需要任何其他更改?
在我的例子中,同样的问题是由于不同版本的 maven。一个是我手动安装的,另一个是随 STS 一起嵌入的。
我使用以下步骤解决了这个问题:
1.删除.M2文件夹(c:\Users\.m2)
已下载嵌入 STS 并在 env 中配置相同的 maven 的确切版本。变量和路径变量。
STS Embedded maven- Image
更新项目(右键单击项目 -> Maven -> 更新项目...)
更新步骤花费了一些时间,因为所有依赖项都再次下载到 .M2 文件夹中。问题终于解决了。
在我对 .xml
进行修改之前,我在同一文件夹中制作了一份副本。制作我的模组后,我开始遇到问题。
将备份移出 .m2
文件夹解决了我的问题。
我在工作区的几个项目中遇到了同样的问题,这些项目属于同一个父级。我只安装了一个 Maven 版本,我的本地 .m2 存储库在我的工作空间中的一堆其他 Maven 项目中工作正常。
在我的例子中,原因是父 pom 中的一个简单的 XML 语法错误。我修复了它,刷新了受影响的 Maven 项目,一切正常。
下面是我的 pom.xml 文件。在第一行,我收到
错误Error parsing lifecycle processing instructions.
我需要帮助找出导致错误的原因。
<?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.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>First</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.4.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-web</artifactId>
</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>
</project>
我也遇到过同样的问题。
我正在使用新的 Eclipse Neon。可能是这个新版本中包含的 Maven 版本的问题。
我已经使用 Gradle 而不是 Maven 解决了这个问题。
注意:您可以尝试在旧版本的Eclipse中使用Maven。
这是由于旧版本的 m2e-wtp 集成插件。要解决此问题,在 Eclipse(Neon) 中,您可以转到帮助 --> 安装新软件.. --> 输入 http://download.eclipse.org/m2e-wtp/milestones/neon/1.3/ in the Work with box and press enter. Tick all the checkboxes, install the plugins and restart the IDE. It should work. Similarly, for other versions, you might refer the following link https://www.eclipse.org/m2e-wtp/ 并根据您的 Eclipse 版本尝试 latest/previous 构建。
这个问题让我抓狂,我终于设法通过删除位于以下位置的整个 Maven 存储库来解决它:
Windows: c:\Users\<username>\.m2\
之后我刚刚更新了项目(Eclipse 中的 Alt+F5)。问题消失了!
可能是不同版本 Maven 的冲突(我使用了几个不同版本的 Eclipse + m2e 插件)。
看看eclipse web http://marketplace.eclipse.org/content/maven-integration-eclipse-wtp
m2eclipse-wtp 项目已移至 Eclipse 基金会。 m2eclipse-wtp 插件现已弃用,取而代之的是更新的 m2e-wtp
来自市场的自动安装已暂停。 m2eclipse-wtp 0.15.3 可以从 http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/
手动安装您需要先卸载 Eclipse 中的所有 m2e-wtp 插件,然后从 jboss url
安装它们.m2 文件夹中有一些依赖项已损坏。
- 您需要从 .m2 文件夹中删除该依赖项。
- 如果您无法找到损坏的那一个,则删除所有 在 pom.xml 文件中声明的依赖项。
试试这个,它可能会有帮助。
<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.demo</groupId>
<artifactId>test1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java-version>1.8</java-version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>HelloWorld</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<warName>SpringWebExample</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
无需清理.m2文件夹,我通过在eclipse中添加相应的maven解决了这个问题
尽管添加了新路径并更改了用户设置,错误 "Error parsing lifecycle processing instructions" 仍然存在。我重新启动了服务器。是否需要任何其他更改?
在我的例子中,同样的问题是由于不同版本的 maven。一个是我手动安装的,另一个是随 STS 一起嵌入的。 我使用以下步骤解决了这个问题: 1.删除.M2文件夹(c:\Users\.m2)
已下载嵌入 STS 并在 env 中配置相同的 maven 的确切版本。变量和路径变量。 STS Embedded maven- Image
更新项目(右键单击项目 -> Maven -> 更新项目...)
更新步骤花费了一些时间,因为所有依赖项都再次下载到 .M2 文件夹中。问题终于解决了。
在我对 .xml
进行修改之前,我在同一文件夹中制作了一份副本。制作我的模组后,我开始遇到问题。
将备份移出 .m2
文件夹解决了我的问题。
我在工作区的几个项目中遇到了同样的问题,这些项目属于同一个父级。我只安装了一个 Maven 版本,我的本地 .m2 存储库在我的工作空间中的一堆其他 Maven 项目中工作正常。
在我的例子中,原因是父 pom 中的一个简单的 XML 语法错误。我修复了它,刷新了受影响的 Maven 项目,一切正常。