Eclipse m2e-wtp plugin constantly overwriting application.xml - eclipse

I've inherited a project where we already have an application.xml file for my maven-ear-plugin project. We have to use that. But when I import this bloody project into eclipse, it is constantly overwriting this file - I have to go to local history and recover it.
Every time anyone does a clean build, changes project settings, etc., the file is overwritten by something in eclipse (I am assuming the m2e plugin). How do I tell it to leave the frigging file alone. I'm not supposed to touch it, so neither is it.
The setting to generate the file in the build directory is irrelevant - I do not want it to generate anything.

Simply add <generateApplicationXml>false</generateApplicationXml> to your maven-ear-plugin configuration

It's a bug in m2e-wtp.
I've submitted a similar report for constant modification of org.eclipse.wst.common.component file -> https://issues.sonatype.org/browse/MECLIPSEWTP-146
They claim it's fixed for the next release. Maybe it also fixes your problem.
If it does not, submit a new bug to Sonatype, as you can see they are very responsive.
In the meantime, if you know that you are not changing application.xml, then just delete it and recover it from your source control. That is what I ended up doing with 'component' file.
Guess, that's the price of being on a cutting edge.

Related

An internal error occurred during: "Updating Maven Project". Preference node "org.eclipse.wst.validation" has been removed

I'm trying to open my Maven project with Eclipse Juno, but I'm getting this error:
An internal error occurred during: "Updating Maven Project".
Preference node "org.eclipse.wst.validation" has been removed.
How is this caused and how can I solve it?
Same probleme here, there the solution I fix it
Open the .project file with your prefered text editor.
delete the node that is about "org.eclipse.wst.validation"
Close your project
Open your project
Launch Maven Update...
Should be good.
Another way to fix it, if you don't want to change your .project config
(or if you had several projects that must be fixed)
Close your workspace (or eclipse)
-move out <WorkspaceDir>\.metadata\.plugins\org.eclipse.core.resources\.projects from the workspace directory
-reopen you workspace
close it again
-move back the .projects dir (say yes to replace questions ? )
open you workspace
Launch Maven Update
Should be good
Simpler fix:
Close Project
Open Project
Project > Clean
Run Maven Update
I was using Eclipse Mars and in my case, just close and reopen my IDE did the work.
Dont know, if you still have this problem, but here is the solution worked for me:
It appears that deleting the file org.eclipse.wst.validation.prefs in
the directory .metadata/.plugins/org.eclipse.core.runtime/.settings
(default settings for workspace) or .settings in each individual
project will cause the settings for validation to be reset to their
original settings. You can then use validation without getting error
messages and try resetting the options from there. However, I'm not
sure what combination of settings would cause the problem to reappear.
However, if it does, you can repeat the process.
got this from here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=355012
in my case i didnt have the mentioned file in this folder, but i had a bunch of other org.eclipse.wst.* files. deleting them all did the trick for me.
The problem is not related to the .projects folder as mentioned in another answer.
The solution is to add a file called org.eclipse.wst.validation.prefs in the .settings folder. This will restore the eclipse validation node.
The content of the file, depending on your eclipse version, might look like this:
disabled=06target
eclipse.preferences.version=1
Another Solution is too simple , deleting .project file then clean the project and maven update will success surely
I think this is one error that could be caused by multiple different sources. I just had the same error however, and just figured out why. In my situation, I just tried to force update some code by deleting a few temporary files. Turned out I accidentally deleted that file as well. I thankfully had it under source control, so I pulled the file back and updated the project with Maven. I also made sure any other errors were fixed so that the project would clean / update successfully.
I'm not sure if this will solve your problem, but I hope it helps! Good luck!

P4Eclipse allows me to edit file without checking it out

I installed P4Eclipse plugin in Eclipse. However, I noticed that Eclipse allows me to edit a file, but it doesn't automatically check it out from Perforce repository. So, after I edited the file, then go to P4V, the recently modified file won't show up in default change set. Any suggestion on what to look into here?
Thanks.
Actually, after some investigation, I realized that this is indeed related to file system read/write permission. For other reason, I accidentally changed sources files in my perforce workspace to readable. This is why I get to modify them in eclipse without seeing a warning, and at the same time Perforce doesn't realize that these file have been changed.
Manually fixing the permission on those source files resolved this problem.

Subclipse: How to add the default output folder to version control (*.class files)?

I am using eclipse 4.2 and Subclipse 1.8.20.
I am trying to add the contents of /WebContent/WEB-INF/classes to version control (this is also the default output folder of my project).
First let me state that this is possible with TortoiseSVN. I do understand why by default Subclipse ignores this directory, and I tried to change the Team settings, but I am not seeing a relevant entry for *.class files:
Is this at all possible with Subclipse?
More info:
Old an unanswered similar question: http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=473163
Same topic but opposite question: How can I ignore build directory in Subclipse?
It is a horribly bad idea to version your build directory. Every time Eclipse does an auto-build it will cause all of the files to need to be committed again.
To answer your question, all Eclipse team providers automatically ignore any resource that is marked as "Derived" by Eclipse. The Derived flag is set on files that are created by the Eclipse builders. If you select one of these files that are ignored in Eclipse, right click and choose Properties. Navigate to the Eclipse Resource page. There will be a bunch of checkboxes. You should see that one of these is labelled Derived and will likely be checked.
Do not try to change the checkbox value. I am just pointing out where you can see and confirm this.

Query, while creating a jar?

Resource is out of sync with the file system
This the error that is thrown out while creating a jar in eclipse IDE...
What does this mean? And how to rectify it?...
I'm assuming this is while you're using Eclipse...
I suspect that it means you've changed a file on the file system but the Eclipse workspace is still "looking at" the old version. Hitting Refresh (F5) on either the file or the whole project would usually sort it out. If you're seeing it every time you create a jar file, that suggests your project is looking at your build output, which isn't ideal.
Eclipse caches file content to make things go faster.
It has detected that the version on disk has changed since it was put in the cache, and you need to refresh the workspace to update the cached version.
This typically happen when you fiddle with files outside of Eclipse. If the process doing the fiddling is invoked from within Eclipse you can tell Eclipse to refresh the workspace when the process is finished.
Eclipse keeps metadata about all files within every eclipse project. "Resource is out of sync with the file system..." means that eclipse has noticed that a file has been changed (or deleted) from outside eclipse. Refreshing the project in question (from the context menu in the package explorer) should fix the problem.

In Eclipse, how do I detect where in the code .project is getting updated?

I'm experiencing a problem where somewhere in the an Eclipse Plugin a class is modifying the .project file, but I'm unable to determine which code/class it is.
I'm on a Windows XP machine. Is there a way I can set a breakpoint or setup some sort of a listener so I can see where in the code the .project file is being modified by? (ideally by setting a breakpoint somewhere so I could see the stack where it is occurring).
One suggestion but maybe you've already tried this: set your .project as read-only before firing eclipse, so that you can have at least an idea about the plugin that modify your .project