Maven pom.xml文件报错Artifact has not been packaged yet. When used on reactor artifact...MDEP-187

当Eclipse的m2e插件遇到'Artifact has not been packaged yet'错误时,这通常是由于生命周期映射配置问题导致的。可以忽略该插件执行或更新工作区的生命周期映射元数据,通过添加特定的'lifecycleMappingMetadata'配置来避免错误。此问题不影响Maven的正常编译。
摘要由CSDN通过智能技术生成

项目pom.xml报错:

Artifact has not been packaged yet. When used on reactor artifact, copy should be executed after packaging: see MDEP-187

经过在网上查找资料,这个是eclipse的插件m2e的问题,不是错误。也可以使用maven正常编译。

stackOverflow上有人给出另一种相似的解决方法:

点击Window -> Preferences -> Maven -> Lifecycle Mappings ,点击Open workspace lifecycle mappings metadata,Then add “pluginExecution” entry like in the code below. If the file is empty, copy the entire content below. You might need to change “versionRange”.

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
	<pluginExecutions>
		<pluginExecution>
			<pluginExecutionFilter>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<versionRange>2.10</versionRange>
				<goals>
					<goal>copy-dependencies</goal>
				</goals>
			</pluginExecutionFilter>
			<action>
				<ignore />
			</action>
		</pluginExecution>
	</pluginExecutions>
</lifecycleMappingMetadata>

In order for this to take effect go back to Preferences and click Reload workspace lifecycle mappings metadata. Update maven projects and / or rebuild. The error should be gone.

Useful if you cannot or don’t want to modify pom.xml for any reasons but want to stop your eclipse m2e from executing particular goal of a particular plugin.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值