最近在启动项目的时候,一直报org.eclipse.jst.jee.server:xxx' did not find a matching property异常;网上看了不少资料,各种解决方案都不行;后来直接移除server;打算新建server之后,再添加项目。但是,发现新建server之后,之前的项目找不到了。
后来发现是Project facets没有配置好,没有勾选动态web那一项,勾选之后,项目添加并正常启动。
后来找了关于Project facets的资料详细看了下;贴上来分享一下
Project facets Facets define characteristics and requirements for Java EE projects and are used as part of the runtime configuration. 项目面 项目面定义了项目运行时的特性和需求,配置的项目面将作为项目运行时配置的一部分。 When you add a facet to a project, that project is configured to perform a certain task, fulfill certain requirements, or have certain characteristics. 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. 当你向项目中加入项目面时,这个项目就会被配置为一个特定的任务,这个任务可以满足特定要求或者具有某些特征。例如,EAR面通过添加部署描述符并设置项目的类路径来将一个项目构建为企业级应用。 You can add facets only to Java EE projects and other types of projects that are based on J2EE projects, such as enterprise application projects, dynamic Web projects, and EJB projects. You cannot add facets to a Java™ project or plug-in project, for example. Typically, a facet-enabled project has at least one facet when it is created, allowing you to add more facets if necessary. For example, a new EJB project has the EJB Module facet. You can then add other facets to this project like the EJBDoclet (XDoclet) facet. To add a facet to a project, see Adding a facet to a Java EE project. 你可以仅将项目面添加到JavaEE项目和基于J2EE项目的其他类型的项目,例如,企业应用程序项目,动态Web项目和EJB项目。不能将项目面添加到Java™项目或插件项目。通常,启用构面的项目在创建时至少有一个构面,从而允许你在必要时添加更多构面。例如,新的EJB项目具有EJB模块构面。然后,可以将其他构面添加到此项目,如EJBDoclet(XDoclet)构面。 Some facets require other facets as prerequisites. Other facets cannot be in the same project together. For example, you cannot add the Dynamic Web Module facet to an EJB project because the EJB project already has the EJB Module facet. Some facets can be removed from a project and others cannot. 一些项目面需要其他项目面作为先决条件。而有一些项目面不能添加在同一个项目中。例如,不能将动态Web模块构面添加到EJB项目,因为EJB项目已具有EJB模块构面。一些项目面可以从项目中删除,而有些则不能。 Facets also have version numbers. You can change the version numbers of facets as long as you stay within the requirements for the facets. To change the version number of a facet, see Changing the version of a facet. Facets也有版本号。你可以更改构面的版本号,只要符合构面的要求。要更改构面的版本号,请参阅更改构面的版本。