How to use JANSI together with -B

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use JANSI together with -B

Tibor Digana
Hi all,

I want to use non-interactive mode, -B, together with JANSI colors.
Is it possible?

Why we bound JANSI to -B ?

Cheers
Tibor
Reply | Threaded
Open this post in threaded view
|

Re: How to use JANSI together with -B

Robert Scholte-8
On Mon, 09 Apr 2018 16:24:39 +0200, Tibor Digana <[hidden email]>  
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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to use JANSI together with -B

Tibor Digana
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 <[hidden email]> 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 <[hidden email]>
> wrote:
>
>> On Mon, 09 Apr 2018 16:24:39 +0200, Tibor Digana <[hidden email]>
>> 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
>>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: How to use JANSI together with -B

Arnaud Héritier
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 <[hidden email]>
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 <[hidden email]>
> 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 <[hidden email]>
> > wrote:
> >
> >> On Mon, 09 Apr 2018 16:24:39 +0200, Tibor Digana <
> [hidden email]>
> >> 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