eclipse m2e-wtp 错误:<path>/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF(没有那个文件或目录)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14659891/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
m2e-wtp error: <path>/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF (No such file or directory)
提问by Jelle van Geuns
I use m2e 1.2.0 and m2e-wtp 0.16.0, and occasionally my Eclipse build fails with the error:
我使用 m2e 1.2.0 和 m2e-wtp 0.16.0,偶尔我的 Eclipse 构建失败并显示错误:
<path>/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF (No such file or directory)
The problem can be temporarily solved by doing a Maven->Update project...
, but the error will come back after a while. Not sure what exactly the trigger is....
问题可以通过做一个 暂时解决Maven->Update project...
,但过一段时间又会出现错误。不知道具体是什么触发....
Any suggestions on how to fix the issue permanently?
关于如何永久解决问题的任何建议?
[Edit] I found that the issue is triggered when I build the project externally using the Maven command line directly. This will remove the default MANIFEST.MF that m2e-wtp generates, and it apparently doesn't get regenerated until you do a rebuild in Eclipse.
[编辑]我发现当我直接使用Maven命令行在外部构建项目时会触发该问题。这将删除 m2e-wtp 生成的默认 MANIFEST.MF,并且在您在 Eclipse 中进行重建之前它显然不会重新生成。
回答by cosjav
Eclipse versions earlier than Luna
早于 Luna 的 Eclipse 版本
I'm not certain if this is the best thing to do but I followed the instructions mentioned herewith regards to getting rid of the auto generated web resources folder and this seems to also resolve the issue with the missing MANIFEST.MF:
我不确定这是否是最好的做法,但我遵循了此处提到的 有关摆脱自动生成的 Web 资源文件夹的说明,这似乎也解决了缺少 MANIFEST.MF 的问题:
- on your project only : right-click on the project > Properties > Maven > WTP : check "Enable Project Specific Settings" and uncheck "Maven Archiver generates files under the build directory"
- on the whole workspace : Window > Preferences > Maven > WTP : uncheck "Maven Archiver generates files under the build directory"
- 仅在您的项目上:右键单击项目 > 属性 > Maven > WTP:选中“启用项目特定设置”并取消选中“Maven Archiver 在构建目录下生成文件”
- 在整个工作区:窗口 > 首选项 > Maven > WTP:取消选中“Maven Archiver 在构建目录下生成文件”
We actually generate our manifest entries as part of the maven-war-plugin when we actually want to package/build the project, but I dont think m2e-wtp uses this. In any event, the manifest file is irrelevant for us in the build that m2e-wtp creates for use within eclipse.
当我们真正想要打包/构建项目时,我们实际上将清单条目生成为 maven-war-plugin 的一部分,但我不认为 m2e-wtp 使用它。无论如何,在 m2e-wtp 为在 eclipse 中使用而创建的构建中,清单文件与我们无关。
Eclipse Luna and later
Eclipse Luna 及更高版本
For Eclipse Luna you have to go:
对于 Eclipse Luna,你必须去:
Preferences > Maven > Java EE Integration and uncheck "Maven Archiver generates files under the build directory".
首选项 > Maven > Java EE 集成并取消选中“Maven Archiver 在构建目录下生成文件”。
Eclipse Luna does not have the path at project Properties and the WTP section
Eclipse Luna 在项目属性和 WTP 部分没有路径
回答by VijayaKumar Thangavel
This solution works for me Rightclick on Project --> Properties --> Maven --> Java EE Integration --> check enable project specific settings and disable Maven archiver generates files
此解决方案适用于我右键单击项目 --> 属性 --> Maven --> Java EE 集成 --> 检查启用项目特定设置并禁用 Maven 归档程序生成文件
回答by Mehdi
Try to select your project, and clean it by using the menu :
尝试选择您的项目,并使用菜单清理它:
Project>Clean
项目>清洁
Then refresh your pom.xml. That worked for me .
然后刷新你的 pom.xml。那对我有用。
回答by Senthil kumar
Try Eclipse -> Project -> Clean
尝试 Eclipse -> 项目 -> 清理
Then right click Your project --> Team --> Share Project --> SVN --> Choose your svn and ok
然后右键单击您的项目 --> 团队 --> 共享项目 --> SVN --> 选择您的 svn 并确定
Everything should be solved
一切都应该解决
回答by sunny
Right click on Your Project, go to properties and then to Project Facets, now go to Runtime tab on the right and select the server and click on apply, the error message would be gone.
右键单击您的项目,转到属性,然后转到 Project Facets,现在转到右侧的运行时选项卡并选择服务器并单击应用,错误消息将消失。
回答by Vivek Gondliya
In your pom.xml file check the following thing,
在您的 pom.xml 文件中检查以下内容,
<build>
<finalName>Write a file name which is Your Maven Buid Name</finalName>
</build>
回答by Shubham Gupta
Right click on project > properties > maven > update project > select last three options > click ok
右键单击项目> 属性> maven > 更新项目> 选择最后三个选项> 单击确定
Done. It worked for me
完毕。它对我有用
回答by vishal pathode
- Go to pom.xml
- Ctrl+athen Ctrl+xthen Ctrl+sthen Ctrl+vthen Ctrl+s
- Right Click on project. Maven -> update project
- 转到 pom.xml
- Ctrl+a然后Ctrl+x然后Ctrl+s然后Ctrl+v然后Ctrl+s
- 右键单击项目。Maven -> 更新项目
This got solved for me.
这已经为我解决了。
回答by Dev Kashyap
Clean All Projects will solve this issue.
Clean All Projects 将解决这个问题。
回答by Nagappan
manifest.mf is getting destroyed when we try to do maven build using mvn cleaninstall. If we don't want to destroy manifest.mf file, just enter the command mvn install in the command prompt.
当我们尝试使用 mvn cleaninstall进行 maven 构建时,manifest.mf 被破坏了。如果我们不想破坏 manifest.mf 文件,只需在命令提示符中输入命令 mvn install 即可。
And if we missed the manifest.mf file, we can generate by uncheck & check the "Maven archiver generates files under the build directory" option in maven - JAVA EE integration as you said.
如果我们错过了 manifest.mf 文件,我们可以通过取消选中并选中 maven - JAVA EE 集成中的“Maven 归档程序在构建目录下生成文件”选项来生成,如您所说。