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

18

72

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.

Cassock answered 2/2, 2013 at 7:59 Comment(0)
E
113

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

Elyse answered 3/6, 2013 at 7:17 Comment(7)
I've since removed m2e-wtp which has solved the problem for me by default. So I can't easily verify this answer, but it certainly looks like a good optionCassock
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.Determinate
Answer is outdated - see @VitorBraga's commentSalespeople
For me I could fix it by unchecking - Resolve dependencies from workspace projectsMuraida
having Eclipse Neon, I enabled (checked) Maven Archiver generates files under build directoryRakel
issue appears to be captured by Jelle van Geuns's <edit> section. If parent module was built using mvn clean install, it will remove some required files for app deployment, which apparently can only be generated through IDE. There may be other arguments from commandLine to generate those. However, above fix worked for me in Eclipse Oxygen.Steib
why? what's the reason that make it run?Legal
F
34

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

Fairleigh answered 28/3, 2014 at 7:31 Comment(0)
C
30

Try to select your project, and clean it by using the menu :

Project>Clean

Then refresh your pom.xml. That worked for me .

Conceal answered 12/11, 2014 at 4:49 Comment(0)
F
6

Try Eclipse -> Project -> Clean

Then right click Your project --> Team --> Share Project --> SVN --> Choose your svn and ok

Everything should be solved

Fetlock answered 6/10, 2014 at 6:12 Comment(0)
M
4

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.

Monochromatism answered 19/12, 2015 at 11:38 Comment(0)
D
4
  1. Go to pom.xml
  2. Ctrl+a then Ctrl+x then Ctrl+s then Ctrl+v then Ctrl+s
  3. Right Click on project. Maven -> update project

This got solved for me.

Despotism answered 3/3, 2019 at 18:8 Comment(0)
N
3

In your pom.xml file check the following thing,

<build>
<finalName>Write a file name which is Your Maven Buid Name</finalName>
</build>
Neon answered 1/10, 2015 at 13:48 Comment(0)
A
3

Right click on project > properties > maven > update project > select last three options > click ok

Done. It worked for me

Archive answered 27/2, 2018 at 4:35 Comment(0)
B
2

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.

Bagging answered 18/7, 2014 at 7:31 Comment(0)
M
2

Clean All Projects will solve this issue.

Murmur answered 25/6, 2016 at 19:35 Comment(0)
I
0

Replacing manen to an external installation solved it for me.
Window -> Preferences -> [search maven in the search box] -> Installation Add a full external maven installation and select its checkbox. apply and restart.

Indohittite answered 25/12, 2014 at 6:6 Comment(0)
C
0

Cleaning the project didn't do the trick,There were 2 external jars that were added to the build path removing them and moving them inside pom.xml really fixed the issue for me.

Constraint answered 28/4, 2015 at 9:54 Comment(0)
M
0

I use eclipse Luna and find it useless to enable project specific settings. Finally, I found the configure file org.eclipse.m2e.wtp.prefs in project .settings and change the configuration "org.eclipse.m2e.wtp.enableM2eWtp=true". It works after maven build the project. Hope this is help to people meets the same case as me. :D

Meow answered 6/10, 2015 at 5:43 Comment(0)
S
0

For Marte Eclipse:

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

Uncheck Marven Archiver generates files under the build directory.

It's Works

Shoreless answered 16/12, 2015 at 13:44 Comment(0)
P
0

To make sure resources are properly refreshed, as maven cleans up target, you can setup maven build to automatically refresh project + target folder, etc.,.

Check the option to automatically refresh resources in your maven build

Postbox answered 7/6, 2017 at 4:14 Comment(0)
R
0

in my case (Eclipse Neon), I enabled Maven Archiver generates files under build directory

Rakel answered 28/11, 2017 at 13:42 Comment(0)
M
-1

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. Just browse the "bundles" category the bundle. You'll see what packages are being imported and exported 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.

Mush answered 2/2, 2013 at 8:8 Comment(1)
the problem seems to be the reverse: I don't have a MANIFEST.MF file and m2e-wtp is looking for one. After doing a Maven->Update project... a default empty MANIFEST.MF will be generated, but somehow this gets removed in certain cases and not reliably regenerated. Not sure what Virgo is but I'm not using that.Cassock
S
-2

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

Sidon answered 28/7, 2014 at 13:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.