Message Boards
BLADE watch task fails on Windows
Federico Stendardi, modified 4 Years ago.
BLADE watch task fails on Windows
New Member Posts: 12 Join Date: 2/3/20 Recent Posts
Hi guys,
I'm trying the blade watch command on my local pc, but it fails with an Exception, here the command line flow:
The replaceAll method takes a regular expression as input, that on windows fails because File.separator = "\"
the solution is to "escape" the input string:
I don't have an account
I'm trying the blade watch command on my local pc, but it fails with an Exception, here the command line flow:
blade version
blade version 3.9.0.202001232132
blade watch --trace
error: java.util.regex.PatternSyntaxException :: Unexpected internal error near index 1
\
java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.<init>(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.lang.String.replaceAll(Unknown Source)
at com.liferay.blade.cli.command.WatchCommand._getGradlePath(WatchCommand.java:116)
at com.liferay.blade.cli.command.WatchCommand.access$000(WatchCommand.java:56)
at com.liferay.blade.cli.command.WatchCommand$1.preVisitDirectory(WatchCommand.java:209)
at com.liferay.blade.cli.command.WatchCommand$1.preVisitDirectory(WatchCommand.java:178)
at java.nio.file.Files.walkFileTree(Unknown Source)
at java.nio.file.Files.walkFileTree(Unknown Source)
at com.liferay.blade.cli.command.WatchCommand._getProjectPaths(WatchCommand.java:176)
at com.liferay.blade.cli.command.WatchCommand.execute(WatchCommand.java:79)
at com.liferay.blade.cli.BladeCLI._runCommand(BladeCLI.java:1150)
at com.liferay.blade.cli.BladeCLI.runCommand(BladeCLI.java:519)
at com.liferay.blade.cli.BladeCLI.run(BladeCLI.java:467)
at com.liferay.blade.cli.BladeCLI.main(BladeCLI.java:123)
</init>
I've checked on github project, and I've found the origin of the bug:private String _getGradlePath(Path path, Path basePath) {
Path relativePath = basePath.relativize(path);
String gradlePath = ":" + relativePath.toString();
[b]gradlePath = gradlePath.replaceAll(File.separator, ":");[/b]
return gradlePath;
}
The replaceAll method takes a regular expression as input, that on windows fails because File.separator = "\"
the solution is to "escape" the input string:
private String _getGradlePath(Path path, Path basePath) {
Path relativePath = basePath.relativize(path);
String gradlePath = ":" + relativePath.toString();
gradlePath = gradlePath.replaceAll([b]Matcher.quoteReplacement(File.separator)[/b], ":");
return gradlePath;
}
Could you help me to submit this issue to JIRA? I don't have an account
Jorge Díaz, modified 4 Years ago.
RE: BLADE watch task fails on Windows
Liferay Master Posts: 753 Join Date: 1/9/14 Recent Posts
You can request for a JIRA account here: https://issues.liferay.com/secure/ContactAdministrators!default.jspa
They should create it in 1-2 days.
They should create it in 1-2 days.