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

项目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”.


<lifecycleMappingMetadata>
	<pluginExecutions>
		<pluginExecution>
			<pluginExecutionFilter>
				<groupId>org.apache.maven.pluginsgroupId>
				<artifactId>maven-dependency-pluginartifactId>
				<versionRange>2.10versionRange>
				<goals>
					<goal>copy-dependenciesgoal>
				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.

你可能感兴趣的:(Java)