升级到m2eclipse 0.9.7版本后,发现一个问题,maven Assembly plugin无法工作,具体是在eclipse下执行"run as" --> "maven package"时,报错:
(我在pom.xml中重定义了package的行为,会执行maven-assembly-plugin插件)
<!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to create assembly: Error adding file
'
net.runafter.nptt:NpttCore:jar:0.1.0
'
to archive:
G:\workspace\
private
\tools\nptt\trunk\NpttCore\target\classes isn
'
t a file.
如果在windows命令行下直接执行mvn package,绕过eclipse和m2eclipse,就可以成功。
window -> preferences -> maven, 勾选"Debug output" 打开maven的debug开关,细看错误日志:
可以看到,maven Assembly plugin试图以操作文件的方式操作目录NpttCore\target\classes,因此失败造成整个package命令执行失败。
查了好一段时间,没有结果,因为之前一直都是ok的,而且在命令行下可以正常,有些糊涂。最后没有办法了,只好google,终于有所收获,同样的问题之前有人遇到过:
http://jira.codehaus.org/browse/MNGECLIPSE-1201
而且给maven的官方提过comments:
http://jira.codehaus.org/browse/MASSEMBLY-396
似乎maven的维护人员给出了答案:
This is related to workspace resolution feature
that is enabled automatically if project has workspace resolution enabled. You can disable it in the Maven launch configuration.
The workspace resolution is not a new feature, you can read about it at [1]. In 0.9.7 defaults for the Maven launch configuration been changed to pickup setting for workspace dependency resolution from the project settings, so defaults for compile-time dependency resolution match Maven launch dependency resolution. Unfortunately not all Maven plugins can properly work when workspace dependency resolution is enabled, so I would recommend to submit bug reports to the Maven projects for such plugins.
The m2eclipse allows to disable workspace resolution for compile time and for Maven launch config separately, so you have some flexibility.
简单的说就是和workspace resolution这个特性有关,In 0.9.7默认的maven的启动配置已经被修改为“pickup setting for workspace dependency resolution from the project settings”,而不是所有的maven插件都可以在workspace dependency resolution开启的情况下工作。比如这次maven Assembly plugin就犯错了,可以通过在maven的启动配置中关闭这个特性来解决这个问题。
解决的方法很简单,右键单击要执行package的project,"properties for ***" -> maven,将"resolve dependencies from workspace projects"前的勾取消。
重新执行maven package成功,问题解决。
分享到:
相关推荐
maven-t7-plugin-0.9.7.jar
maven-easyb-plugin-0.9.7.jar
maven-t7-plugin-0.9.7-sources.jar
maven-t7-plugin-0.9.7.m1.jar
maven-easyb-plugin-0.9.7-sources.jar
maven-easyb-plugin-0.9.7-1.jar
maven-t7-plugin-0.9.7.m1-sources.jar
maven-easyb-plugin-0.9.7-1-sources.jar
openssl的早先版本,测试网络使用。windows下安装使用。 安装完之后,C:\Program Files\GnuWin32\bin下有openssl.exe执行文件。
eclipse 开发插件 ADT-0.9.7 下载 已经打好包,配置好路径,下载后解开压缩将 两个文件夹放在 Eclipse 根目录即可. 附带2个插件: 1.Android ADT 0.9.7 Eclipse 插件版 2.Easyexplore 快速定位文件在磁盘上位置的.很爽...
openssl0.9.7执行版。是OpenSSL-0.9.7在Windows平台下编译好的完整软件包,可以直接下载使用,不用再进行编译。
Redis desktop manager 0.9.7 for mac,最新版 Release。
eclipse 开发插件(adt),版本为:android adt 0.9.7.记住不要随便更新eclipse。
Redis Desktop Manager 0.9.7 for Mac.You can also build from github.
mac Redis Desktop Manager 0.9.7 怎么又升级了呢, 赶快来下载.
官方更新0.9.7版本,本安装包编译日期2018年9月25日,版本定义为0.9.7.180925 Windows10的32位、64位系统验证可用。 程序运行依赖visual studio 2015 redistributable文件vc_redist.x86.exe已经打包在安装包中,所以...
gmpi patched source code
cmdftp-0.9.7.tar.gz
KEmulator0.9.7汉化版 向大家推荐的这款小软件可以在电脑上模拟运行JAR程序,省去了装机的麻烦。 KEmulator Lite无论是运行速度还是兼容性都很不错,截图也非常方便,相较于其他的同类软件都要出色不少。可以说比较...
完美编译podofo0.9.7开源PDF读写库,附带podofo所需的编译好的freetype、libjpeg、libpng、libtiff、lua(部分例子需要)、openssl(文档加密需要)、zlib(压缩文档)、cppunit(部分例子用到)、crypto(头文件在...