本文主要是介绍Artifact has not been packaged yet. When used on reactor artifact, copy should be executed after pac,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
导入一个新项目后pom.xml报错:
Artifact has not been packaged yet. When used on reactor artifact, copy should be executed after packaging: see MDEP-187 is thrown
经过在网上查找资料,将解决方案整理如下:
首先,这个是eclipse的插件m2e的问题,并不是真正的错误。
解决方案一:
可以用一个<pluginManagement>把插件包住,这样eclipse里就不报错了。但是<pluginManagement>的使用场景是父项目里定义,然后子项目里继承使用。 这里加一个<pluginManagement>只是为了看不到这个错误感觉有点名不正言不顺。 最好的办法就是忽略,不去管他。
解决方案二:
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.
(上面的英文应该都看得懂,就懒得翻译了)
这篇关于Artifact has not been packaged yet. When used on reactor artifact, copy should be executed after pac的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!