As explained in Eclipse & Intellij documentation, Facets define characteristics and requirements (certain configuration, specific for a particular framework/technology).
When you add a facet to a project, that project is configured to perform a certain task, fulfill certain requirements, or have certain characteristics.
In Brief You Have to Follow Some structure to Implement some framework/technology. IDEs have options to implement it for you to make your life easier.
To elaborate it in details I am giving some thorough details directly from Eclipse Documentations. This is Eclipse specific.
While creating a project you will get the option to implement facet for your project. For example, the EAR facet sets up a project to function as an enterprise application by adding a deployment descriptor and setting up the project s classpath.
To add another facet to a project that already exists, complete the following steps:
- In the Project Explorer view of the Java™ EE perspective, right-click the project and then select Properties.
- Select the Project Facets page in the in the Properties window. This page lists the facets in the project and their versions.
- Click Modify Project and select the check boxes next to the facets you want the project to have.
Note: Only the facets that are valid for the project are listed
Some facets may not work together. Thus, you can also choose a preset combination of facets from the Presets list.
- Choose a version number for the facet by clicking the current version number and selecting the version number you want from the drop-down list.
- Optional: To remove a facet, clear its check box. Not all facets can be removed.
- Optional: If you want to limit the project so it will be compatible with one or more runtimes, click on the Runtimes tab and select the runtimes that you want the project to be compatible with. For more information on runtimes, see Specifying target servers for J2EE projects.
- Click Finish to exit the Modify Faceted Project dialog and then click OK.
Facets also have version numbers in Eclipse. You can change the version numbers of facets as long as you stay within the requirements for the facets.
To change the version of a facet in your project, complete the following steps:
- In the Project Explorer view of the Java EE perspective, right-click the project and then select Properties.
- Select the Project Facets page in the in the Properties window. This page lists the facets in the project and their versions.
- Click Modify Project and click the facet you want to change.
- Select the version of the facet from the drop-down box next to the facet s name.
- Click Finish to close the Modify Faceted Project window and then click OK.
You can do more things with the facets. I have given the examples for your better understanding. For details, please go through the documentation of your favorite IDE.