Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid replace caracter in Web target on Windows #1249

Open
Thihup opened this issue May 8, 2024 · 0 comments
Open

Invalid replace caracter in Web target on Windows #1249

Thihup opened this issue May 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Thihup
Copy link

Thihup commented May 8, 2024

Trying to build to web target from Windows fail due to file separator being used as invalid Regex.

Current Behavior

java.util.regex.PatternSyntaxException: Unescaped trailing backslash near index 1
\ 
        at java.base/java.util.regex.Pattern.error(Pattern.java:2204)
        at java.base/java.util.regex.Pattern.compile(Pattern.java:1951)
        at java.base/java.util.regex.Pattern.<init>(Pattern.java:1576)
        at java.base/java.util.regex.Pattern.compile(Pattern.java:1101)
        at java.base/java.lang.String.replaceAll(String.java:3111)
        at com.gluonhq.substrate.target.WebTargetConfiguration$1Work.setArtifact(WebTargetConfiguration.java:239)

Source

String groupId = path.subpath(m2Index + 1, path.getNameCount() - 3).toString().replaceAll(File.separator, ".");

It could include two slashes instead of just one, use a regex like: "(\\\\|/)" or change the call from String::replaceAll to String::replace

Your Environment

Windows 11 - GluonFX 1.0.22

@Thihup Thihup added the bug Something isn't working label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant