The Maven sourcecheck Profile not breaking the build anymore...

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

The Maven sourcecheck Profile not breaking the build anymore...

Babak Vahdat
Hi

AFAIR building Camel source using the sourcecheck Profile enabled used to break the build if there was any Checkstyle issue:

mvn clean install -Psourcecheck

However currently when there’s a Checkstyle issue the build doesn’t seem to break for me, instead I see

[INFO] Starting audit...
[ERROR] …
[ERROR] …
[ERROR] …
[ERROR] …
Audit done.

And then the build continues. The result of Checkstyle are then available unter the target/checkstyle-result.xml folder of the given Maven module.

Do you know how one can enforce the build to break as it was the case before? As otherwise you continuously need to watch the maven log on console or check target/checkstyle-result.xml for each given module.

Babak
Reply | Threaded
Open this post in threaded view
|

Re: The Maven sourcecheck Profile not breaking the build anymore...

Andrea Cosentino-3
This was deliberately done if I remember correctly. It is too strict to
break the build for checkstyle. I don't know what others think about it

Il mer 9 ott 2019, 16:51 Babak Vahdat <[hidden email]> ha
scritto:

> Hi
>
> AFAIR building Camel source using the sourcecheck Profile enabled used to
> break the build if there was any Checkstyle issue:
>
> mvn clean install -Psourcecheck
>
> However currently when there’s a Checkstyle issue the build doesn’t seem
> to break for me, instead I see
>
> [INFO] Starting audit...
> [ERROR] …
> [ERROR] …
> [ERROR] …
> [ERROR] …
> Audit done.
>
> And then the build continues. The result of Checkstyle are then available
> unter the target/checkstyle-result.xml folder of the given Maven module.
>
> Do you know how one can enforce the build to break as it was the case
> before? As otherwise you continuously need to watch the maven log on
> console or check target/checkstyle-result.xml for each given module.
>
> Babak
Reply | Threaded
Open this post in threaded view
|

Re: The Maven sourcecheck Profile not breaking the build anymore...

omarsmak
To be honest, I am not a fan of breaking the build due to a failing
sourcecheck, especially is not something related to tests or whatever as
Andrea mentioned that can be very strict to break.

On Wed, 9 Oct 2019 at 16:55, Andrea Cosentino <[hidden email]> wrote:

> This was deliberately done if I remember correctly. It is too strict to
> break the build for checkstyle. I don't know what others think about it
>
> Il mer 9 ott 2019, 16:51 Babak Vahdat <[hidden email]> ha
> scritto:
>
> > Hi
> >
> > AFAIR building Camel source using the sourcecheck Profile enabled used to
> > break the build if there was any Checkstyle issue:
> >
> > mvn clean install -Psourcecheck
> >
> > However currently when there’s a Checkstyle issue the build doesn’t seem
> > to break for me, instead I see
> >
> > [INFO] Starting audit...
> > [ERROR] …
> > [ERROR] …
> > [ERROR] …
> > [ERROR] …
> > Audit done.
> >
> > And then the build continues. The result of Checkstyle are then available
> > unter the target/checkstyle-result.xml folder of the given Maven module.
> >
> > Do you know how one can enforce the build to break as it was the case
> > before? As otherwise you continuously need to watch the maven log on
> > console or check target/checkstyle-result.xml for each given module.
> >
> > Babak
>
Reply | Threaded
Open this post in threaded view
|

Re: The Maven sourcecheck Profile not breaking the build anymore...

Babak Vahdat
In reply to this post by Andrea Cosentino-3
For the moment I set the corresponding flag locally to true in order to achieve what I’m after:

https://github.com/apache/camel/blob/master/parent/pom.xml#L5372 <https://github.com/apache/camel/blob/master/parent/pom.xml#L5372>

Maybe we can also define another profile which would do strict source checking with the resulting build failure if the source check doesn’t pass.

Babak

> On 9 Oct 2019, at 16:54, Andrea Cosentino <[hidden email]> wrote:
>
> This was deliberately done if I remember correctly. It is too strict to
> break the build for checkstyle. I don't know what others think about it
>
> Il mer 9 ott 2019, 16:51 Babak Vahdat <[hidden email]> ha
> scritto:
>
>> Hi
>>
>> AFAIR building Camel source using the sourcecheck Profile enabled used to
>> break the build if there was any Checkstyle issue:
>>
>> mvn clean install -Psourcecheck
>>
>> However currently when there’s a Checkstyle issue the build doesn’t seem
>> to break for me, instead I see
>>
>> [INFO] Starting audit...
>> [ERROR] …
>> [ERROR] …
>> [ERROR] …
>> [ERROR] …
>> Audit done.
>>
>> And then the build continues. The result of Checkstyle are then available
>> unter the target/checkstyle-result.xml folder of the given Maven module.
>>
>> Do you know how one can enforce the build to break as it was the case
>> before? As otherwise you continuously need to watch the maven log on
>> console or check target/checkstyle-result.xml for each given module.
>>
>> Babak

Reply | Threaded
Open this post in threaded view
|

Re: The Maven sourcecheck Profile not breaking the build anymore...

Guillaume Nodet-2
In reply to this post by Andrea Cosentino-3
IIRC, I've seen some projects where a plugin would automatically reformat
the source code if needed, see
https://github.com/revelc/formatter-maven-plugin
That could be a way to help easily / transparently enforcing the rules ...

Le mer. 9 oct. 2019 à 16:55, Andrea Cosentino <[hidden email]> a écrit :

> This was deliberately done if I remember correctly. It is too strict to
> break the build for checkstyle. I don't know what others think about it
>
> Il mer 9 ott 2019, 16:51 Babak Vahdat <[hidden email]> ha
> scritto:
>
> > Hi
> >
> > AFAIR building Camel source using the sourcecheck Profile enabled used to
> > break the build if there was any Checkstyle issue:
> >
> > mvn clean install -Psourcecheck
> >
> > However currently when there’s a Checkstyle issue the build doesn’t seem
> > to break for me, instead I see
> >
> > [INFO] Starting audit...
> > [ERROR] …
> > [ERROR] …
> > [ERROR] …
> > [ERROR] …
> > Audit done.
> >
> > And then the build continues. The result of Checkstyle are then available
> > unter the target/checkstyle-result.xml folder of the given Maven module.
> >
> > Do you know how one can enforce the build to break as it was the case
> > before? As otherwise you continuously need to watch the maven log on
> > console or check target/checkstyle-result.xml for each given module.
> >
> > Babak
>


--
------------------------
Guillaume Nodet
Reply | Threaded
Open this post in threaded view
|

Re: The Maven sourcecheck Profile not breaking the build anymore...

Andrea Cosentino-3
Yeah. It would be helpful Guillaume.

Il mer 9 ott 2019, 17:21 Guillaume Nodet <[hidden email]> ha scritto:

> IIRC, I've seen some projects where a plugin would automatically reformat
> the source code if needed, see
> https://github.com/revelc/formatter-maven-plugin
> That could be a way to help easily / transparently enforcing the rules ...
>
> Le mer. 9 oct. 2019 à 16:55, Andrea Cosentino <[hidden email]> a écrit
> :
>
> > This was deliberately done if I remember correctly. It is too strict to
> > break the build for checkstyle. I don't know what others think about it
> >
> > Il mer 9 ott 2019, 16:51 Babak Vahdat <[hidden email]> ha
> > scritto:
> >
> > > Hi
> > >
> > > AFAIR building Camel source using the sourcecheck Profile enabled used
> to
> > > break the build if there was any Checkstyle issue:
> > >
> > > mvn clean install -Psourcecheck
> > >
> > > However currently when there’s a Checkstyle issue the build doesn’t
> seem
> > > to break for me, instead I see
> > >
> > > [INFO] Starting audit...
> > > [ERROR] …
> > > [ERROR] …
> > > [ERROR] …
> > > [ERROR] …
> > > Audit done.
> > >
> > > And then the build continues. The result of Checkstyle are then
> available
> > > unter the target/checkstyle-result.xml folder of the given Maven
> module.
> > >
> > > Do you know how one can enforce the build to break as it was the case
> > > before? As otherwise you continuously need to watch the maven log on
> > > console or check target/checkstyle-result.xml for each given module.
> > >
> > > Babak
> >
>
>
> --
> ------------------------
> Guillaume Nodet
>
Reply | Threaded
Open this post in threaded view
|

Re: The Maven sourcecheck Profile not breaking the build anymore...

John Poth
'mvn clean install -Psourcecheck -Dcheckstyle.failOnViolation=true' will
make the build fail on checkstyle errors

On Wed, Oct 9, 2019 at 5:23 PM Andrea Cosentino <[hidden email]> wrote:

> Yeah. It would be helpful Guillaume.
>
> Il mer 9 ott 2019, 17:21 Guillaume Nodet <[hidden email]> ha scritto:
>
> > IIRC, I've seen some projects where a plugin would automatically reformat
> > the source code if needed, see
> > https://github.com/revelc/formatter-maven-plugin
> > That could be a way to help easily / transparently enforcing the rules
> ...
> >
> > Le mer. 9 oct. 2019 à 16:55, Andrea Cosentino <[hidden email]> a
> écrit
> > :
> >
> > > This was deliberately done if I remember correctly. It is too strict to
> > > break the build for checkstyle. I don't know what others think about it
> > >
> > > Il mer 9 ott 2019, 16:51 Babak Vahdat <[hidden email]> ha
> > > scritto:
> > >
> > > > Hi
> > > >
> > > > AFAIR building Camel source using the sourcecheck Profile enabled
> used
> > to
> > > > break the build if there was any Checkstyle issue:
> > > >
> > > > mvn clean install -Psourcecheck
> > > >
> > > > However currently when there’s a Checkstyle issue the build doesn’t
> > seem
> > > > to break for me, instead I see
> > > >
> > > > [INFO] Starting audit...
> > > > [ERROR] …
> > > > [ERROR] …
> > > > [ERROR] …
> > > > [ERROR] …
> > > > Audit done.
> > > >
> > > > And then the build continues. The result of Checkstyle are then
> > available
> > > > unter the target/checkstyle-result.xml folder of the given Maven
> > module.
> > > >
> > > > Do you know how one can enforce the build to break as it was the case
> > > > before? As otherwise you continuously need to watch the maven log on
> > > > console or check target/checkstyle-result.xml for each given module.
> > > >
> > > > Babak
> > >
> >
> >
> > --
> > ------------------------
> > Guillaume Nodet
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: The Maven sourcecheck Profile not breaking the build anymore...

Babak Vahdat
Thanks John.

Babak

> Am 10.10.2019 um 09:26 schrieb John Poth <[hidden email]>:
>
> 'mvn clean install -Psourcecheck -Dcheckstyle.failOnViolation=true' will
> make the build fail on checkstyle errors
>
>> On Wed, Oct 9, 2019 at 5:23 PM Andrea Cosentino <[hidden email]> wrote:
>>
>> Yeah. It would be helpful Guillaume.
>>
>> Il mer 9 ott 2019, 17:21 Guillaume Nodet <[hidden email]> ha scritto:
>>
>>> IIRC, I've seen some projects where a plugin would automatically reformat
>>> the source code if needed, see
>>> https://github.com/revelc/formatter-maven-plugin
>>> That could be a way to help easily / transparently enforcing the rules
>> ...
>>>
>>> Le mer. 9 oct. 2019 à 16:55, Andrea Cosentino <[hidden email]> a
>> écrit
>>> :
>>>
>>>> This was deliberately done if I remember correctly. It is too strict to
>>>> break the build for checkstyle. I don't know what others think about it
>>>>
>>>> Il mer 9 ott 2019, 16:51 Babak Vahdat <[hidden email]> ha
>>>> scritto:
>>>>
>>>>> Hi
>>>>>
>>>>> AFAIR building Camel source using the sourcecheck Profile enabled
>> used
>>> to
>>>>> break the build if there was any Checkstyle issue:
>>>>>
>>>>> mvn clean install -Psourcecheck
>>>>>
>>>>> However currently when there’s a Checkstyle issue the build doesn’t
>>> seem
>>>>> to break for me, instead I see
>>>>>
>>>>> [INFO] Starting audit...
>>>>> [ERROR] …
>>>>> [ERROR] …
>>>>> [ERROR] …
>>>>> [ERROR] …
>>>>> Audit done.
>>>>>
>>>>> And then the build continues. The result of Checkstyle are then
>>> available
>>>>> unter the target/checkstyle-result.xml folder of the given Maven
>>> module.
>>>>>
>>>>> Do you know how one can enforce the build to break as it was the case
>>>>> before? As otherwise you continuously need to watch the maven log on
>>>>> console or check target/checkstyle-result.xml for each given module.
>>>>>
>>>>> Babak
>>>>
>>>
>>>
>>> --
>>> ------------------------
>>> Guillaume Nodet
>>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: The Maven sourcecheck Profile not breaking the build anymore...

Peter Palaga
+1 for formatter-maven-plugin. That's the most painless source
formatting approach I have seen so far. There is no need to do anything,
it just works. They have it in Quarkus [1] and I like it very much.

The drawback of the present non-enforcing approach is that people forget
(my case) about checkstyle, do not know about it or even ignore it
deliberately. Formatting afterwards produces unnecessary clutter in the
git history.

[1]
https://github.com/quarkusio/quarkus/blob/master/build-parent/pom.xml#L238-L246

Thanks,

-- P

On 10/10/2019 12:19, Babak Vahdat wrote:

> Thanks John.
>
> Babak
>
>> Am 10.10.2019 um 09:26 schrieb John Poth <[hidden email]>:
>>
>> 'mvn clean install -Psourcecheck -Dcheckstyle.failOnViolation=true' will
>> make the build fail on checkstyle errors
>>
>>> On Wed, Oct 9, 2019 at 5:23 PM Andrea Cosentino <[hidden email]> wrote:
>>>
>>> Yeah. It would be helpful Guillaume.
>>>
>>> Il mer 9 ott 2019, 17:21 Guillaume Nodet <[hidden email]> ha scritto:
>>>
>>>> IIRC, I've seen some projects where a plugin would automatically reformat
>>>> the source code if needed, see
>>>> https://github.com/revelc/formatter-maven-plugin
>>>> That could be a way to help easily / transparently enforcing the rules
>>> ...
>>>>
>>>> Le mer. 9 oct. 2019 à 16:55, Andrea Cosentino <[hidden email]> a
>>> écrit
>>>> :
>>>>
>>>>> This was deliberately done if I remember correctly. It is too strict to
>>>>> break the build for checkstyle. I don't know what others think about it
>>>>>
>>>>> Il mer 9 ott 2019, 16:51 Babak Vahdat <[hidden email]> ha
>>>>> scritto:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> AFAIR building Camel source using the sourcecheck Profile enabled
>>> used
>>>> to
>>>>>> break the build if there was any Checkstyle issue:
>>>>>>
>>>>>> mvn clean install -Psourcecheck
>>>>>>
>>>>>> However currently when there’s a Checkstyle issue the build doesn’t
>>>> seem
>>>>>> to break for me, instead I see
>>>>>>
>>>>>> [INFO] Starting audit...
>>>>>> [ERROR] …
>>>>>> [ERROR] …
>>>>>> [ERROR] …
>>>>>> [ERROR] …
>>>>>> Audit done.
>>>>>>
>>>>>> And then the build continues. The result of Checkstyle are then
>>>> available
>>>>>> unter the target/checkstyle-result.xml folder of the given Maven
>>>> module.
>>>>>>
>>>>>> Do you know how one can enforce the build to break as it was the case
>>>>>> before? As otherwise you continuously need to watch the maven log on
>>>>>> console or check target/checkstyle-result.xml for each given module.
>>>>>>
>>>>>> Babak
>>>>>
>>>>
>>>>
>>>> --
>>>> ------------------------
>>>> Guillaume Nodet
>>>>
>>>
>