简体   繁体   English

m2e-wtp错误:<path> /target/m2e-wtp/web-resources/META-INF/MANIFEST.MF(没有这样的文件或目录)

[英]m2e-wtp error: <path>/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF (No such file or directory)

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. 通过执行Maven->Update project...可以暂时解决问题Maven->Update project...但是错误会在一段时间后回来。 Not sure what exactly the trigger is.... 不知道触发器到底是什么......

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. [编辑]我发现当我直接使用Maven命令行在外部构建项目时会触发该问题。 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. 这将删除m2e-wtp生成的默认MANIFEST.MF,并且在Eclipse中进行重建之前,它显然不会重新生成。

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 here with 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" 仅在您的项目上:右键单击项目>属性> Maven> WTP:选中“启用项目特定设置”并取消选中“Maven Archiver在构建目录下生成文件”
  • on the whole workspace : Window > Preferences > Maven > WTP : uncheck "Maven Archiver generates files under the build directory" 在整个工作区:窗口>首选项> 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. 当我们真正想要打包/构建项目时,我们实际上生成了我们的清单条目作为maven-war-plugin的一部分,但我不认为m2e-wtp使用它。 In any event, the manifest file is irrelevant for us in the build that m2e-wtp creates for use within eclipse. 无论如何,清单文件与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部分没有路径

此解决方案适用于我右键单击项目 - >属性 - > Maven - > Java EE集成 - >检查启用项目特定设置并禁用Maven归档程序生成文件

Try to select your project, and clean it by using the menu : 尝试选择您的项目,并使用菜单清除它:

Project>Clean 项目>清除

Then refresh your pom.xml. 然后刷新你的pom.xml。 That worked for me . 这对我有用。

Try Eclipse -> Project -> Clean 尝试Eclipse - > Project - > Clean

Then right click Your project --> Team --> Share Project --> SVN --> Choose your svn and ok 然后右键单击您的项目 - >团队 - >共享项目 - > SVN - >选择您的svn和确定

Everything should be solved 一切都应该解决

右键单击Your Project,转到属性,然后转到Project Facets,现在转到右侧的Runtime选项卡并选择服务器并单击apply,错误消息将消失。

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>

manifest.mf is getting destroyed when we try to do maven build using mvn clean install. 当我们尝试使用mvn clean install进行maven构建时,manifest.mf会被破坏。 If we don't want to destroy manifest.mf file, just enter the command mvn install in the command prompt. 如果我们不想销毁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中的“Maven归档器生成文件在构建目录下”选项 - 如你所说的JAVA EE集成。

清洁所有项目将解决此问题。

Right click on project > properties > maven > update project > select last three options > click ok 右键单击项目>属性> maven>更新项目>选择最后三个选项>单击确定

Done. 完成。 It worked for me 它对我有用

Replacing manen to an external installation solved it for me. 将manen更换为外部设备为我解决了这个问题。
Window -> Preferences -> [search maven in the search box] -> Installation Add a full external maven installation and select its checkbox. 窗口 - >首选项 - > [在搜索框中搜索maven] - >安装添加完整的外部maven安装并选中其复选框。 apply and restart. 申请并重启。

清理项目没有做到这一点,有两个外部jar被添加到构建路径中删除它们并将它们移动到pom.xml中真的解决了我的问题。

I use eclipse Luna and find it useless to enable project specific settings. 我使用eclipse Luna并发现它无用于启用项目特定设置。 Finally, I found the configure file org.eclipse.m2e.wtp.prefs in project .settings and change the configuration "org.eclipse.m2e.wtp.enableM2eWtp=true". 最后,我在项目.settings中找到了配置文件org.eclipse.m2e.wtp.prefs并更改了配置“org.eclipse.m2e.wtp.enableM2eWtp = true”。 It works after maven build the project. 它在maven构建项目之后工作。 Hope this is help to people meets the same case as me. 希望这有助于人们遇到与我相同的情况。 :D :d

For Marte Eclipse: 对于Marte Eclipse:

Go to: Window > Preference > Marven > Java EE Integration 转到:Window> Preference> Marven> Java EE Integration

Uncheck Marven Archiver generates files under the build directory. 取消选中Marven Archiver会在构建目录下生成文件。

It's Works 其作品

To make sure resources are properly refreshed, as maven cleans up target, you can setup maven build to automatically refresh project + target folder, etc.,. 为确保资源得到正确刷新,当maven清理目标时,您可以设置maven构建以自动刷新项目+目标文件夹等。

Check the option to automatically refresh resources in your maven build 选中选项以自动刷新maven构建中的资源

在我的情况下(Eclipse Neon),我启用了Maven Archiver在build目录下生成文件

  1. Go to pom.xml 转到pom.xml
  2. Ctrl+a then Ctrl+x then Ctrl+s then Ctrl+v then Ctrl+s 按Ctrl + a然后按Ctrl + x然后按Ctrl + s然后按Ctrl + v然后按Ctrl + s
  3. Right Click on project. 右键单击项目。 Maven -> update project Maven - >更新项目

This got solved for me. 这个解决了我。

m2e-wtp plugin might generating an almost empty MANIFEST.MF in /target/m2e-wtp/web-resources/META-INF folder, no matter where you place the real MANIFEST.MF have a look at Virgo's admin console. m2e-wtp插件可能会在/ target / m2e-wtp / web-resources / META-INF文件夹中生成一个几乎为空的MANIFEST.MF,无论你在哪里放置真正的MANIFEST.MF都可以查看Virgo的管理控制台。 Just browse the "bundles" category the bundle. 只需浏览捆绑包的“捆绑”类别即可。 You'll see what packages are being imported and exported FOR REAL. 您将看到正在导入和导出FOR REAL的包。

So what you can do is copy the MANIFEST.MF to the /$VIRGO_BASE/stage/$BUNDLE_WEBAPP/META-INF directory and hit "redeploy" in Eclipse's Server View. 因此,您可以将MANIFEST.MF复制到/ $ VIRGO_BASE / stage / $ BUNDLE_WEBAPP / META-INF目录,并在Eclipse的Server View中点击“redeploy”。

在上面一行的下方,我得到一个额外的信息说“不同步”我只运行项目清理“我的项目”和宾果游戏,它对我有用..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM