Community
Participate
Working Groups
Build Identifier: I20110613-1736 It seems that the only way to install Web Fragment facet is using New Faceted Project Wizard. If I already have a project, I can't find a way to install this facet. Reproducible: Always Steps to Reproduce: 1. Create a Java (1.6) project. 2. Convert it to a faceted project. 3. Open Project Propeties->Project Facets 4. Click on Java Facet (1.6) to install it. Apply button is enabled. 5. Click on Web Fragment Module Facet to install it. Apply button is disabled.
Created attachment 198986 [details] Screenshot of Project Facets properties page.
The problem is in WebFragmentFacetInstallDataModelProvider: this class does not provide a default value for the CONFIG_FOLDER property, and the parent class (J2EEModuleFacetInstallDataModelProvider) validates that the CONFIG_FOLDER property is not null nor empty. So, when the data model is validated by the facets property page, the validation returns an error, and therefore the OK button is never enabled. The fix could be either override the validate method in WebFragmentFacetInstallDataModelProvider to always return an OK status for CONFIG_FOLDER, or provide a valid default value for CONFIG in WebFragmentFacetInstallDataModelProvider (could use something similar to the code in UtilityFacetInstallDataModelProvider, to get the first source folder defined by the java facet).
Created attachment 249908 [details] Proposed fix I0m following the approach of setting the default value to the first src folder found, like in the case of utility facet. I tested creating new web fragment projects using the wizard, and using the facets property page to add the web fragment facet, and works fine.
Fix looks good - I assume everything is ok is multiple src folders are defined? we don't actually generate any src in this action, so its just to satisfy the validation.
Yes, multiple src folders behave correctly. Committed to master for WTP 3.6.3 and 3.7 http://git.eclipse.org/c/jeetools/webtools.javaee.git/commit/?id=68c0e1b5cfcf191245ca8ef5dcbf91b6648beb8d I did not update the version of the feature because it was increased by another bug.
*** Bug 430843 has been marked as a duplicate of this bug. ***