Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Error on jboss-modules-plugin in Windows #1

Open
juanprats opened this issue Oct 28, 2015 · 0 comments
Open

Error on jboss-modules-plugin in Windows #1

juanprats opened this issue Oct 28, 2015 · 0 comments

Comments

@juanprats
Copy link

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));
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant