I have added a common JAR to my project. The jar looks something like...
CommonWeb.jar
|-- META-INF
| |-- resources
| | `-- common
| | |-- css
| | | `-- my.css
| | |-- js
| | | `-- my.js
| | |-- images
| | | `-- my.png
| | |-- components
| | | `-- mycomposite.xhtml
| | `-- templates
| | `-- mytemplate.xhtml
| |-- faces-config.xml
| `-- MANIFEST.MF
:
Everything is working except that Netbeans will not recognise my composite component. The page trying to use the component looks something like this...
<ui:composition template="/resources/common/templates/mytemplate.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:cmn="http://java.sun.com/jsf/composite/common/components">
<ui:define name="content">
...
<cmn:mycomposite ... />
...
</ui:define>
</ui:composition>
The project will compile and run, no worries. But the IDE gives me red squiggly lines on <cmn:mycomposite ... />
and does not auto-complete, etc. It will all work fine if I copy the component into the project's own resources folder, so it seems netbeans just isn't looking to the jar.
There are quite a few questions around with similar problems, eg:
- JSF Composite Component into JAR in NetBeans
- JSF Composite Component Netbeans
- Composite components in an external JAR are not recognized in Netbeans
...but there are no satisfactory solutions or workarounds.
Also there have been a few netbeans bug reports on the matter but these all seem to be 'fixed'
Is there some configuration that I'm missing? Has anyone actually managed to get this working with the latest version of NetBeans (NetBeans 7.4 Patch 2 at time of writing)? Has anyone found a work-around that actually works?
UPDATE:
This problem continues to occur in NetBeans 8