m2e-wtp error: /target/m2e-wtp/web-resources

2019-01-21 08:45发布

I use m2e 1.2.0 and m2e-wtp 0.16.0, and occasionally my Eclipse build fails with the error:

<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....

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.

标签: eclipse m2e
17条回答
在下西门庆
2楼-- · 2019-01-21 09:09

manifest.mf is getting destroyed when we try to do maven build using mvn clean install. If we don't want to destroy manifest.mf file, just enter the command mvn install in the command prompt.

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.

查看更多
孤傲高冷的网名
3楼-- · 2019-01-21 09:12

Just below the above line, I was getting an additional info saying "Out of Sync" I only ran project clean "my project" and bingo, it worked for me..

查看更多
Juvenile、少年°
4楼-- · 2019-01-21 09:14

In your pom.xml file check the following thing,

<build>
<finalName>Write a file name which is Your Maven Buid Name</finalName>
</build>
查看更多
看我几分像从前
5楼-- · 2019-01-21 09:16

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.

查看更多
Bombasti
6楼-- · 2019-01-21 09:17

Eclipse versions earlier than Luna

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:

  • 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"

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.

Eclipse Luna and later

For Eclipse Luna you have to go:

Preferences > Maven > Java EE Integration and uncheck "Maven Archiver generates files under the build directory".

Eclipse Luna does not have the path at project Properties and the WTP section

查看更多
冷血范
7楼-- · 2019-01-21 09:17

This solution works for me Rightclick on Project --> Properties --> Maven --> Java EE Integration --> check enable project specific settings and disable Maven archiver generates files

查看更多
登录 后发表回答