Skip to content

Commit 7349c13

Browse files
committed
services loader can contains any classname so if not mapping just do not touch it
Signed-off-by: Olivier Lamy <[email protected]>
1 parent d387698 commit 7349c13

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/org/eclipse/jetty/toolchain/modifysources/ModifyEE9ToEE8ServiceLoaderFiles.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void execute()
6969
String newFileName = changeEE9TypeToEE8(fileName);
7070
File newFile = new File(metaInfDirectory, newFileName == null ? fileName : newFileName);
7171
List<String> newContent = Files.readAllLines(file.toPath(), StandardCharsets.UTF_8).
72-
stream().map(ModifyEE9ToEE8::changeEE9TypeToEE8).collect(Collectors.toList());
72+
stream().map(s -> mapFileName(s)).collect(Collectors.toList());
7373
Files.write(newFile.toPath(), newContent, StandardCharsets.UTF_8);
7474
if (newFileName != null) {
7575
Files.delete(file.toPath());
@@ -85,6 +85,11 @@ public void execute()
8585

8686
}
8787

88+
private String mapFileName(String className) {
89+
String newType = ModifyEE9ToEE8.changeEE9TypeToEE8(className);
90+
return newType == null ? className : newType;
91+
}
92+
8893
public void setOutputDirectory(File outputDirectory) {
8994
this.outputDirectory = outputDirectory;
9095
}

src/main/java/org/eclipse/jetty/toolchain/modifysources/ResourcesFiltering.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ public void copyFile(File from, final File to, boolean filtering, List<FilterWra
8181
content = StringUtils.replace(content, "https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd",
8282
"http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd");
8383

84+
85+
content = StringUtils.replace(content, "https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd",
86+
"http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd");
87+
8488
content = StringUtils.replace(content, "https://jakarta.ee/xml/ns/jakartaee",
8589
"http://xmlns.jcp.org/xml/ns/javaee");
8690

0 commit comments

Comments
 (0)