Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/rewrite/jakarta-faces-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ recipeList:
- org.openrewrite.xml.ChangeTagAttribute:
attributeName: xsi:schemaLocation
elementName: web-app
oldValue: .*xml/ns/javaee.*
oldValue: (?s).*xml/ns/javaee.*
newValue: https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd
regex: true
- org.openrewrite.text.FindAndReplace:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,41 @@ void migrateJCP() {
);
}

@Test
void migrateMultilineSchemaLocation() {
rewriteRun(
//language=xml
xml(
"""
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
</web-fragment>
""",
"""
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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-app_5_0.xsd"
version="5.0">
<context-param>
<param-name>jakarta.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
</web-fragment>
""",
sourceSpecs -> sourceSpecs.path("web.xml")
)
);
}

@Nested
class NoChanges {
@Test
Expand Down