jpa – Eclipse cannot find the declaration of JavaEE 10 root elements in deployment descriptors

In Eclipse I created a new maven project for a Java Web Application.
Adding the corresponding deployment descriptors for Servlet, Faces, Persistance, etc.
I am getting exceptions for the root element:

<?xml version="1.0" encoding="UTF-8"?>
<persistence 
    xmlns="http://jakarta.ee/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd">
    <persistence-unit name="project"
    version="3.1">
    </persistence-unit>
</persistence>

Also for the faces-config deployment descriptor the root element is not found:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="https://jakarta.ee/xml/ns/jakartaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_4_0.xsd"
    version="4.0">

</faces-config>
  • Cannot find the declaration of element ‘persistence’
  • Cannot find the declaration of element ‘faces-config’
  • Downloading external resources is disabled.

enter image description here

Seems like Eclipse does not download the xsd and so cannot validate the correct xml root.

How to enabled Eclipse to correctly download and validate? Honour all xml schema locations is enabled.

Thanks for ideas!

Read more here: Source link