This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Description
Hi, I'm trying to execute mvn clean install -Dbrms-layer but I get this exception:
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 1
at java.lang.String.charAt(String.java:658)
at java.util.regex.Matcher.appendReplacement(Matcher.java:762)
at java.util.regex.Matcher.replaceAll(Matcher.java:906)
at java.lang.String.replaceAll(String.java:2162)
at org.kie.integration.eap.maven.EAPStaticModulesBuilderMojo.execute(EAPStaticModulesBuilderMojo.java:87)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
... 20 more
After reviewing the code it's clear this error appers only in Windows where the file separator string contains characters that should be escaped when used in a regular expression. The lines with this problem are:
String _outputPath = outputPath.replaceAll("/", File.separator);
...
String moduleLocation = node.getLocation().replaceAll("/", File.separator);
The problem can be solved by replacing those lines with:
String _outputPath = outputPath.replace("/", File.separator);
...
String moduleLocation = node.getLocation().replace("/", File.separator);
or
String _outputPath = outputPath.replaceAll("/", Matcher.quoteReplacement(File.separator));
...
String moduleLocation = node.getLocation().replaceAll("/", Matcher.quoteReplacement(File.separator));