Eclipse: Cannot edit deployment assembly on java web application

Solution for Eclipse: Cannot edit deployment assembly on java web application
is Given Below:

sometimes newer versiono of eclipse seems to forget how to work: sometimes my web application project lose its “deployment assembly” configuration. when i try to restore it and click “apply and close” nothing change infact if i reopen the “project configuration” window, no one of the previus settled configuration is still in there.

this strange behaviour happens mostly on newer version of Eclipse (2020 and 2021), the project jdk is 1.8. console and log view do not explain the problem.

I already tryed to edit the .project file, delete it as well as the .settings but nothing changes.
has anyone encountered the same problem?

As i searched the web there is no way to prevent this kind of error but here it is an explanation on how to fix it.

  1. copy the project’s .classpath from a previous commit or ask someone of your coworker to pass it to you;

  2. copy the .settings folder, ask to someone of your coworker to pass it to you;

  3. most of the time, eclipse wil tell you this:

**The given project is not a virtual component project**

in this case you have to:
a) go to project facet;
b) check “dynamic web project”, “java” and “java server faces” (check other if you use something different);

  1. update the project or refresh it, compile and run.

if someone knows how to prevent the problem of this question, please share your knowledge