You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Tibor Digana <ti...@apache.org> on 2018/04/09 14:24:39 UTC

How to use JANSI together with -B

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

Re: How to use JANSI together with -B

Posted by Raphael Ackermann <ra...@gmail.com>.
see also the comment at
https://issues.jenkins-ci.org/browse/JENKINS-44543?focusedCommentId=331874&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-331874

"(jenkins jobs don't have a terminal that jansi recognizes)."

On Tue, Apr 10, 2018 at 3:39 PM Arnaud Héritier <ah...@gmail.com> wrote:

> 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 <ti...@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 <ti...@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 <rf...@apache.org>
> > > wrote:
> > >
> > >> On Mon, 09 Apr 2018 16:24:39 +0200, Tibor Digana <
> > tibordigana@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
>

Re: How to use JANSI together with -B

Posted by Arnaud Héritier <ah...@gmail.com>.
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 <ti...@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 <ti...@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 <rf...@apache.org>
> > wrote:
> >
> >> On Mon, 09 Apr 2018 16:24:39 +0200, Tibor Digana <
> tibordigana@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

Re: How to use JANSI together with -B

Posted by Tibor Digana <ti...@apache.org>.
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 <ti...@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 <rf...@apache.org>
> wrote:
>
>> On Mon, 09 Apr 2018 16:24:39 +0200, Tibor Digana <ti...@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
>>>
>>
>

Re: How to use JANSI together with -B

Posted by Robert Scholte <rf...@apache.org>.
On Mon, 09 Apr 2018 16:24:39 +0200, Tibor Digana <ti...@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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org