Java 解析生命周期处理指令时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38943612/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error parsing lifecycle processing instructions
提问by idiotduffer
Below is my pom.xml file. On the very first line, I am getting an error of
下面是我的 pom.xml 文件。在第一行,我收到一个错误
Error parsing lifecycle processing instructions.
解析生命周期处理指令时出错。
I need help finding what caused the error.
我需要帮助找出导致错误的原因。
<?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>
采纳答案by Alessandro Alessandra
This issue was driving me insane, I've finally managed to solve it by deleting the whole maven repository located in:
这个问题让我发疯了,我终于设法通过删除位于以下位置的整个 Maven 存储库来解决它:
Windows: c:\Users\<username>\.m2\
After that I just updated the project (Alt+F5 in Eclipse). Issue gone!
之后,我刚刚更新了项目(Eclipse 中的 Alt+F5)。问题没了!
Maybe a clash of different versions of Maven (I use several different versions of Eclipse + m2e plugins).
也许是 Maven 不同版本的冲突(我使用了几个不同版本的 Eclipse + m2e 插件)。
回答by Raffael Bechara Rameh
This same problem happened to me.
同样的问题也发生在我身上。
I'm using the new Eclipse Neon. Maybe it's an issue related to the Maven version included in this new release.
我正在使用新的 Eclipse Neon。也许这是与此新版本中包含的 Maven 版本相关的问题。
I have solved it by using Gradle instead of Maven.
我已经通过使用 Gradle 而不是 Maven 解决了它。
Note: you can try to use Maven with the previous version of Eclipse.
注意:您可以尝试将 Maven 与以前版本的 Eclipse 一起使用。
回答by arpane4c5
It is due to an older version of m2e-wtp integration plugin. To resolve the issue, in Eclipse(Neon) you can go to Help --> Install New Software.. --> Enter 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/and try the latest/previous builds depending on your Eclipse version.
这是由于旧版本的 m2e-wtp 集成插件。要解决此问题,在 Eclipse(Neon) 中,您可以转到 Help --> Install New Software.. -->在 Work 中输入http://download.eclipse.org/m2e-wtp/milestones/neon/1.3/带框并按回车键。勾选所有复选框,安装插件并重新启动 IDE。它应该工作。同样,对于其他版本,您可以参考以下链接https://www.eclipse.org/m2e-wtp/并根据您的 Eclipse 版本尝试最新/以前的版本。
回答by Silvanus
Take a look at eclipse web http://marketplace.eclipse.org/content/maven-integration-eclipse-wtp
看看日食网站 http://marketplace.eclipse.org/content/maven-integration-eclipse-wtp
The m2eclipse-wtp project has moved to the Eclipse Foundation. The m2eclipse-wtp plugin is now deprecated in favor of the newer m2e-wtp
m2eclipse-wtp 项目已转移到 Eclipse 基金会。m2eclipse-wtp 插件现已弃用,取而代之的是较新的 m2e-wtp
Automatic installation from the marketplace has been suspended. m2eclipse-wtp 0.15.3 can be manually installed from http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/
从市场自动安装已暂停。m2eclipse-wtp 0.15.3 可以从http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/手动安装
You need to first uninstall all m2e-wtp plugins in Eclipse, then install them from jboss url
需要先卸载Eclipse中所有的m2e-wtp插件,然后从jboss url安装
回答by Vijay
There is some dependency got corrupted into .m2 folder.
有一些依赖被破坏到 .m2 文件夹中。
- You need to delete that dependency from .m2 folder.
- If you are not able to find which one is corrupted then delete all the dependency which are declared into pom.xml file.
- 您需要从 .m2 文件夹中删除该依赖项。
- 如果您无法找到哪个损坏,则删除所有声明到 pom.xml 文件中的依赖项。
回答by Mitul Panchal
Try this, it might be helpful.
试试这个,它可能会有所帮助。
<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>
回答by TINH CAO
No need to clean .m2 folder, I fixed this issue by adding corresponding maven to eclipse
无需清理 .m2 文件夹,我通过向 eclipse 添加相应的 maven 解决了这个问题
Inspite of adding the new path and making changes to the user settings the error "Error parsing lifecycle processing instructions" persists. I restarted the server. Is there any other change required?
尽管添加了新路径并对用户设置进行了更改,但错误“解析生命周期处理指令时出错”仍然存在。我重新启动了服务器。是否需要其他更改?
回答by itspxj
In my case the same issue was due to different version of maven. One which I installed manualy and other one which came Embedded with STS. I resolved this issue using below steps: 1. Deleted .M2 folder (c:\Users\.m2)
在我的情况下,同样的问题是由于不同版本的 maven。一个是我手动安装的,另一个是嵌入 STS 的。我使用以下步骤解决了这个问题: 1. 删除 .M2 文件夹 (c:\Users\.m2)
Downloaded exact version of maven which is embedded with STS and configured same in env. variables and path variable. STS Embedded maven- Image
Updated projects (Right click on project -> Maven -> Update Project...)
下载了嵌入 STS 并在 env 中配置相同的 maven 的确切版本。变量和路径变量。 STS 嵌入式 maven-图像
更新的项目(右键单击项目 -> Maven -> 更新项目...)
It took some time in update step as all dependencies downloaded again in .M2 folder. Finally issue is resolved.
由于所有依赖项再次下载到 .M2 文件夹中,因此更新步骤需要一些时间。终于问题解决了。
回答by jc1234567
Before I made modifications to the .xml
I made a copy in the same folder. After making my mods I began having issues.
在我修改之前,我.xml
在同一个文件夹中复制了一份。在制作我的模组后,我开始遇到问题。
Moving the backup out of the .m2
folder resolved the issue for me.
将备份移出.m2
文件夹解决了我的问题。