I had some problem with a docker:build hanging, so I tried to use -X flag: mvn -X docker:build
And I got the following exception (and maven terminated):
Caused by: java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Integer
at org.fusesource.jansi.AnsiOutputStream.optionInt(AnsiOutputStream.java:502)
at org.fusesource.jansi.AnsiOutputStream.processEscapeCommand(AnsiOutputStream.java:258)
at org.fusesource.jansi.AnsiOutputStream.write(AnsiOutputStream.java:112)
at java.io.FilterOutputStream.write(FilterOutputStream.java:125)
at java.io.PrintStream.write(PrintStream.java:480)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:104)
at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:185)
at java.io.PrintStream.write(PrintStream.java:527)
at java.io.PrintStream.print(PrintStream.java:669)
at java.io.PrintStream.println(PrintStream.java:806)
at org.slf4j.impl.SimpleLogger.write(SimpleLogger.java:373)
at org.slf4j.impl.SimpleLogger.log(SimpleLogger.java:368)
at org.slf4j.impl.SimpleLogger.debug(SimpleLogger.java:487)
at org.apache.maven.cli.logging.Slf4jLogger.debug(Slf4jLogger.java:44)
at org.apache.maven.monitor.logging.DefaultLog.debug(DefaultLog.java:41)
at io.fabric8.maven.docker.util.AnsiLogger.debug(AnsiLogger.java:70)`
Then I shortened my Dockerfile until docker:build executed successfully (without -X flag).
Adding however again the -X flag caused the same error.
mvn -v) : Apache Maven 3.5.0my configuration
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.22.1</version>
<configuration>
<images>
<image>
<name>wildfly10.1.0-oracle-jdk8</name>
<build>
<dockerFileDir>${basedir}/docker-build</dockerFileDir>
<tags>
<tag>latest</tag>
</tags>
</build>
</image>
</images>
</configuration>
</plugin>
</plugins>
Sound like a bug indeed. I'm going to fix that but are currently very busy. A PR is highly welcome.
This bug still exists and I see it occurring on 0.26.0 version as well.
Sorry, looks like an issue with in the ANSI logger. If you switch of ansi output, this should help as a workaround (set useColor to false in the plugin configuration).
I'm trying to investigate this issue asap (though no promises, super loaded these days ..)
@rhuss I have raised a PR with a workaround. See if it helps. https://github.com/fabric8io/docker-maven-plugin/pull/1039
Fixed with #1039
Most helpful comment
Fixed with #1039