-
Feature Request
-
Resolution: Done
-
Major
-
1.3.3.Final
-
None
-
None
Based on FORGE-1101, facets that are not declared via @RequiresFacet may not be visible via Project.hasFacet() at the right time since the ProjectFactory's registry may not process these facets in the right order. It would be a good idea to hint the ProjectFactory that a particular Facet may have to be registered.
To explain further, the RestFacet does not declare any dependencies on the RestWebXmlFacet and the RestApplicationFacet. These facets are therefore not always detected via the project.hasFacet() invocations.
Declaring them as facets via a @RequiresOnlyOneFacet annotation could be one solution to ensure that only one facet within a group should be sufficient to satisfy the desired constraints on a Faceted type. Likewise, we could also add support for optional facets that are may be installed if possible, via a @OptionalFacets annotation.
This would probably be better supported in 2.x instead of 1.x.