`
vivus
  • 浏览: 113500 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

[maven]Multiple annotations found at this line

 
阅读更多
旧版本m2e插件报以下错:
引用

Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-
compiler-plugin:3.0:compile (execution: default-compile, phase: compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-
compiler-plugin:3.0:testCompile (execution: default-testCompile, phase: test-compile)


解决办法,在pom中加入如下配置:
<build>
	<pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.eclipse.m2e</groupId>
				<artifactId>lifecycle-mapping</artifactId>
				<version>1.0.0</version>
				<configuration>
					<lifecycleMappingMetadata>
						<pluginExecutions>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.apache.maven.plugins</groupId>
									<artifactId>maven-resources-plugin</artifactId>
									<versionRange>[2.0,)</versionRange>
									<goals>
										<goal>resources</goal>
										<goal>testResources</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.apache.maven.plugins</groupId>
									<artifactId>maven-compiler-plugin</artifactId>
									<versionRange>[2.0,)</versionRange>
									<goals>
										<goal>compile</goal>
										<goal>testCompile</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
						</pluginExecutions>
					</lifecycleMappingMetadata>
				</configuration>
			</plugin>
		</plugins>
	</pluginManagement>
</build>


该解决办法有副作用,其中一个见:http://vivus.iteye.com/blog/1741102

这是m2e插件的bug,建议还是升级m2e插件才是根本解决办法。
分享到:
评论
1 楼 mark_2007 2015-09-07  
感谢,解决了我的问题

相关推荐

Global site tag (gtag.js) - Google Analytics