yes it's strange. With Jenkins I had the same problem. I had to use a pipeline script like :
node { stage('Prepare') { git ' https://github.com/jenkins-demo/simple-maven-project-with-tests.git' } stage('Build') { withMaven(maven: 'Maven 3.5.3', mavenOpts: '-Djansi.force=true') { ansiColor('xterm') { sh "mvn clean package -Dstyle.color=always -Dmaven.test.failure.ignore=true" } } } } I think jansi.force is required because we don't detect a real terminal On Tue, Apr 10, 2018 at 3:24 PM, Tibor Digana <tibordig...@apache.org> wrote: > I found differences of enabled JANSI between Windows/Ubuntu regarding > combination with "-B". > This is minimum configuration per platform if you want to enable JANSI > together with using -B: > Windows: mvn -B -Dstyle.color=always > Ubuntu: mvn -B -Dstyle.color=always and MAVEN_OPTS=-Djansi.force=true > > Was this configuration in plan? > > Cheers > Tibor > > On Mon, Apr 9, 2018 at 8:28 PM, Tibor Digana <tibordig...@apache.org> > wrote: > > > >> CI servers are known to run in batch mode > > Therefore I asked because I exactly need something like this: "mvn -B > > -Dstyle.color=always ..." in my company on Jenkins CI. > > > > Thx > > > > On Mon, Apr 9, 2018 at 6:53 PM, Robert Scholte <rfscho...@apache.org> > > wrote: > > > >> On Mon, 09 Apr 2018 16:24:39 +0200, Tibor Digana < > tibordig...@apache.org> > >> wrote: > >> > >> Hi all, > >>> > >>> I want to use non-interactive mode, -B, together with JANSI colors. > >>> Is it possible? > >>> > >> Yes. > >> > >> How? > >> Use Maven 3.5.3 and add -Dstyle.color=always to the commandline > >> > >> > >>> Why we bound JANSI to -B ? > >>> > >> > >> To ensure CI servers didn't break after ANSI support. CI servers are > >> known to run in batch mode, or at least they should. > >> > >> > >>> Cheers > >>> Tibor > >>> > >> > > > -- ----- Arnaud Héritier http://aheritier.net Mail/GTalk: aheritier AT gmail DOT com Twitter/Skype : aheritier