JSF xmlns URI not registered in IntelliJ IDEA
With unregistered resources, the first solution is to use the "Fetch External Resource" quickfix. If that fails, as it has for you in this case, (usually because the "location" is in name only) you need to manually configure it.
To Manually Configure
- If the resource (i.e. the
.xsd
,.dtd
, etc.) exists in one of your library jars, skip to step 2. Otherwise, download a copy of the resource. Put it somewhere convenient on your system. - In IDEA, with your cursor on the error, open the Quick Fix / Intentions menu by typing Alt+Enter and select "Manually Setup External Resource". (If you do not have this option (based on IntelliJ IDEA version) go to the next section for instructions.)
- If the resource is in a jar, select the
Schemas
tab and select the resource from the appropriate jar. If you downloaded it, select theExplorer
tab (may be named Finder in Mac) and navigate to and select the file you downloaded. - Click OK and let IDEA index the resource.
To Edit or Set via IDE Settings
- Open the settings Dialog via Ctrl+Alt+Enter or File > Settings.
- To configure for all future new projects so this schema is avaiable, open the similar dialog via File > Other Settings > Default Settings
- In the
Project Settings
section, find theSchemas and DTDs
node. - Configure the desired schema. There are add, edit and delete icons in the upper right. Like above, you can select a file within a library via the
Schemas
tab, or your file system via theExplorer
tab.
UPDATE
The various JSF Taglib definitions (for JSF 2.x and above) can be found in the com/sun/faces/metadata/taglib
directory of the com.sun.faces:jsf-impl
jar. The jsf-impl
JAR file can be downloaded from maven central among other places.
I tried every thing suggested here to get intellij to recognize the correct version of my jsf. At the end I discovered that I didn't have a direct reference in my web project maven dependencies to jsf-api. In other words, adding
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.29-08</version>
<scope>provided</scope>
</dependency>
to my pom, fixed it. The confusing thing is that intellij was able to resolve a subset of the jsf symbols, which makes you think that the jar was being seen by it, albeit a wrong version of the jar.