Spring 生命周期配置不包括插件执行
初春 背景:到目前为止,我一直在研究核心JAVA,现在我需要切换到MVCSpring 生命周期配置不包括插件执行,spring,maven,spring-mvc,pom.xml,eclipse-kepler,Spring,Maven,Spring Mvc,Pom.xml,Eclipse Kepler,初春 背景:到目前为止,我一直在研究核心JAVA,现在我需要切换到MVC 尝试制作我的第一个Spring MVC Hello World示例,我在pom.xml上遇到以下错误: Multiple annotations found at this line: - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin: 2.3.
尝试制作我的第一个Spring MVC Hello World示例,我在
pom.xml
上遇到以下错误:
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:
2.3.2:compile (execution: default-compile, phase: compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin:
2.5:testResources (execution: default-testResources, phase: process-test-resources)
- <packaging>war</packaging>
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin:
2.5:resources (execution: default-resources, phase: process-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:
2.3.2:testCompile (execution: default-testCompile, phase: test-compile)
在此行找到多个批注:
-生命周期配置未涵盖插件执行:org.apache.maven.plugins:maven编译器插件:
2.3.2:编译(执行:默认编译,阶段:编译)
-生命周期配置未涵盖插件执行:org.apache.maven.plugins:maven资源插件:
2.5:testResources(执行:默认testResources,阶段:流程测试资源)
-战争
-生命周期配置未涵盖插件执行:org.apache.maven.plugins:maven资源插件:
2.5:资源(执行:默认资源,阶段:流程资源)
-生命周期配置未涵盖插件执行:org.apache.maven.plugins:maven编译器插件:
2.3.2:testCompile(执行:默认testCompile,阶段:测试编译)
pom.xml的此行生成错误:
<packaging>war</packaging>
战争
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.javacodegeeks.snippets.enterprise</groupId>
<artifactId>springexample</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>springexample Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
<build>
<finalName>springexample</finalName>
</build>
<properties>
<spring.version>4.0.2.RELEASE</spring.version>
</properties>
</project>
4.0.0
com.javacodegeeks.snippets.enterprise
请放轻松,这个问题是为了尝试学习一些对我来说全新的东西。
我需要一些插件或什么来解决这个问题吗?如果是这样的话,有没有通用的插件来避免将来出现这样的错误?
IDE:Eclipse开普勒
附言:
我已经浏览了旧线程,但没有运气:
问题在于,m2e需要为您使用的每个maven插件提供一个eclipse插件(实际上比这要复杂一些,但在实践中,eclipse插件和maven插件之间几乎存在一对一的对应关系)
有两种解决方案:
使用maven eclipse插件自动生成所有eclipse项目文件。从命令行运行mvneclipse:eclipse
。您还应该卸载m2e,这样它就不会试图管理您的maven项目
安装。我建议重新安装,但也可以将其安装到现有的Eclipse实例中。这是预装的所有m2e插件,您将需要
这并不是停止使用m2e的理由,只需右键单击错误并使用QuickFix命令即可修复这些错误。您可以选择在Marketplace中搜索可用的生命周期配置程序来自动处理它,或者,如果没有,您可以告诉m2e忽略该插件。我是否需要先卸载m2e
,然后运行mvn eclipse:eclipse
?在IDE中执行此操作最简单。帮助->关于Eclipse->安装的软件->(选择m2e)->卸载…有一种命令行方法可以做到这一点。请参阅p2控制器应用程序(已随Eclipse一起安装):不,您根本不需要卸载m2e。我只是看到m2e在与maven Eclipse插件结合时会感到困惑。太棒了…POM错误解决了,但是我的项目仍然在主项目名称上显示小的红色十字标记,尽管任何子文件夹都没有显示它…对此有什么想法吗?非常有用的答案。我还没有看过像这样的maven eclipse项目。谢谢