Migrate web.xml xsi:schemaLocation from J2EE 1.4 namespace - #1177
Merged
Conversation
The web.xml Jakarta migration updated xmlns and version attributes on J2EE 1.4 descriptors (http://java.sun.com/xml/ns/j2ee) but left the xsi:schemaLocation pointing at the old j2ee schema, because the oldValue regex only matched the newer 'javaee' namespace. Broaden the regex to also match 'j2ee' so schemaLocation is rewritten to the Jakarta EE 9 web-app_5_0.xsd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
JavaxWebXmlToJakartaWebXmlrecipe updatedxmlnsandversionattributes on J2EE 1.4 web.xml descriptors (http://java.sun.com/xml/ns/j2ee,version="2.4") but leftxsi:schemaLocationpointing at the old j2ee schema. TheChangeTagAttributestep forxsi:schemaLocationgated on a regex(?s).*xml/ns/javaee.*that only matched the newerjavaeenamespace, so J2EE 1.4 descriptors fell through and produced this inconsistent output:Broaden the regex to
(?s).*xml/ns/(j2ee|javaee).*so J2EE 1.4 descriptors also havexsi:schemaLocationrewritten to the Jakarta EE 9web-app_5_0.xsd, per the Eclipse Foundation's Jakarta EE XML Schemas index (Jakarta EE 9+ descriptors share thehttps://jakarta.ee/xml/ns/jakartaeenamespace, andweb-app_5_0.xsdis the Servlet 5.0 deployment descriptor schema).Sibling recipes for
faces-config,facelet-taglib, andweb-fragmentoverwritexsi:schemaLocationunconditionally (nooldValue), so they don't have this bug. Added amigrateJ2eetest covering the 2.4 → 5.0 case.