You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Stefan Seifert <ss...@pro-vision.de> on 2019/11/01 10:48:24 UTC

issues switching to bnd baseline maven plugin

i've started migrating my first non-trivial projects to parent 35 including bnd-maven-plugin and ran in some issues:

1. bnd-baseline-maven-plugin demands for package version increases where it's not appropriate
- in [1] i switched to bnd maven plugins (1st commit in this branch)
- if I compile the project the baseline plugin wants to raise the last digit in the package, it complains that null annotations where added to several methods
- but: these annotations where already present in the previous release baseline was comparing to
- the problem can be solved by just incrementing the package versions (2nd commit), but this does not seem to like a proper solution
- and will it do the same for future releases?

2. i'm missing the very nice console output of the baseline check for the maven-bundle-plugin
- the bnd-baseline-maven-plugin by default just outputs the error messages "version xy needs to be increased to z", but not the detail info what was changed
- the documentation lists a fullReport config flag [2] which outputs the necessary infos (although in a format that is not so nice readable as the maven-bundle-plugin)
- reading the documentation the plugin should output this information also without setting fullReport to true, and not if everything is ok. but in reality it outputs the info in error case only if this flag is set to true, and never is everything is ok (which is sad, I found it useful to inspect the changes even if the build is running fine)

3. no warning in case of "excessive version increase"
- unlike the maven-bundle-plugin the bnd-baseline-maven-plugin does not seem to any longer output a warning if a package version is increased accidentally to a higher number than required (e.g. to 1.0.2 instead of 1.0.1)

4. we already know the open issue about the bundle version checking [3]

did you encounter these issues as well? this makes me a bit hesitating on pressing migration from maven-bundle-plugin to the bnd maven plugins.

stefan

[1] https://github.com/apache/sling-org-apache-sling-caconfig-api/tree/feature/SLING-8824-parent25
[2] https://github.com/bndtools/bnd/tree/master/maven/bnd-baseline-maven-plugin#full-reporting
[3] https://issues.apache.org/jira/browse/SLING-8735



RE: issues switching to bnd baseline maven plugin

Posted by Stefan Seifert <ss...@pro-vision.de>.
>> 3. no warning in case of "excessive version increase"
>> - unlike the maven-bundle-plugin the bnd-baseline-maven-plugin does not
>seem to any longer output a warning if a package version is increased
>accidentally to a higher number than required (e.g. to 1.0.2 instead of
>1.0.1)
>Please create a bug at bnd for that.

the issue also occurs with bnd-baseline-maven-plugin 4.3.0, i've created a bug issue
https://github.com/bndtools/bnd/issues/3563

stefan


RE: issues switching to bnd baseline maven plugin

Posted by Stefan Seifert <ss...@pro-vision.de>.
>> 2. i'm missing the very nice console output of the baseline check for
>the maven-bundle-plugin
>> - the bnd-baseline-maven-plugin by default just outputs the error
>messages "version xy needs to be increased to z", but not the detail info
>what was changed
>> - the documentation lists a fullReport config flag [2] which outputs
>the necessary infos (although in a format that is not so nice readable as
>the maven-bundle-plugin)
>> - reading the documentation the plugin should output this information
>also without setting fullReport to true, and not if everything is ok. but
>in reality it outputs the info in error case only if this flag is set to
>true, and never is everything is ok (which is sad, I found it useful to
>inspect the chan
>
>> ges even if the build is running fine)
>I agree. Should we set fullReport to true in the upcoming parent?

this is not very helpful either. i've created a new issue for asking to take over the very good baseline command line reporting from the maven-bundle-plugin to the bnd baseline plugin
https://github.com/bndtools/bnd/issues/3545

stefan


Re: issues switching to bnd baseline maven plugin

Posted by Konrad Windszus <ko...@gmx.de>.
Hi Stefan,

> Am 01.11.2019 um 11:56 schrieb Stefan Seifert <ss...@pro-vision.de>:
> 
> i've started migrating my first non-trivial projects to parent 35 including bnd-maven-plugin and ran in some issues:
> 
> 1. bnd-baseline-maven-plugin demands for package version increases where it's not appropriate
> - in [1] i switched to bnd maven plugins (1st commit in this branch)
> - if I compile the project the baseline plugin wants to raise the last digit in the package, it complains that null annotations where added to several methods
> - but: these annotations where already present in the previous release baseline was comparing to
> - the problem can be solved by just incrementing the package versions (2nd commit), but this does not seem to like a proper solution
> - and will it do the same for future releases?
> 
The code base for the actual base lining is in bnd (for both maven plug-ins). Therefore for the same underlying bnd version both should emit the same recommendations. Try upgrading to version 4.3 and otherwise please create a bug for bnd.

> 2. i'm missing the very nice console output of the baseline check for the maven-bundle-plugin
> - the bnd-baseline-maven-plugin by default just outputs the error messages "version xy needs to be increased to z", but not the detail info what was changed
> - the documentation lists a fullReport config flag [2] which outputs the necessary infos (although in a format that is not so nice readable as the maven-bundle-plugin)
> - reading the documentation the plugin should output this information also without setting fullReport to true, and not if everything is ok. but in reality it outputs the info in error case only if this flag is set to true, and never is everything is ok (which is sad, I found it useful to inspect the chan

> ges even if the build is running fine)
I agree. Should we set fullReport to true in the upcoming parent?

> 3. no warning in case of "excessive version increase"
> - unlike the maven-bundle-plugin the bnd-baseline-maven-plugin does not seem to any longer output a warning if a package version is increased accidentally to a higher number than required (e.g. to 1.0.2 instead of 1.0.1)
Please create a bug at bnd for that.
> 
> 4. we already know the open issue about the bundle version checking [3]
> 
> did you encounter these issues as well? this makes me a bit hesitating on pressing migration from maven-bundle-plugin to the bnd maven plugins.
> 
> stefan
> 
> [1] https://github.com/apache/sling-org-apache-sling-caconfig-api/tree/feature/SLING-8824-parent25
> [2] https://github.com/bndtools/bnd/tree/master/maven/bnd-baseline-maven-plugin#full-reporting
> [3] https://issues.apache.org/jira/browse/SLING-8735
> 
> 


RE: issues switching to bnd baseline maven plugin

Posted by Stefan Seifert <ss...@pro-vision.de>.
>> 1. bnd-baseline-maven-plugin demands for package version increases
>where it's not appropriate
>
>I experienced the same issue regarding the JSR-305 annotations in [4],
>but Karl and I think we found the explanation: parent 35 defines
>sling.java.version as 8 by default. Most of the projects which were not
>yet migrated to parent 35 were built with Java 7. In [5] there’s a
>mention that the baseline check also applies to the resulted bytecode,
>therefore implying that it could trigger warnings when you’re baselining
>against the same codebase, but with the artifact built with a different
>JDK.
>
>I guess we’ll just have to bump those micro versions once and see if the
>history repeats itself for subsequent releases with the same JDK, or if
>[5] is indeed the correct explanation.
>
>Regards,
>Radu
>
>[4] - https://issues.apache.org/jira/browse/SLING-8827
><https://issues.apache.org/jira/browse/SLING-8827>
>[5] - https://github.com/bndtools/bnd/issues/2177
><https://github.com/bndtools/bnd/issues/2177>

this sounds like a good explanation. the problem did not occur when updating sling-mock to parent 35, but this was an update from parent 34 which was already set to java 8. api and caconfig was updating from older parent versions with java 7.
let's have an eye on it once one of the affected modules get released.

stefan

Re: issues switching to bnd baseline maven plugin

Posted by Radu Cotescu <ra...@apache.org>.
Hi Stefan,

> On 1 Nov 2019, at 11:48, Stefan Seifert <ss...@pro-vision.de> wrote:
> 
> i've started migrating my first non-trivial projects to parent 35 including bnd-maven-plugin and ran in some issues:
> 
> 1. bnd-baseline-maven-plugin demands for package version increases where it's not appropriate
> - in [1] i switched to bnd maven plugins (1st commit in this branch)
> - if I compile the project the baseline plugin wants to raise the last digit in the package, it complains that null annotations where added to several methods
> - but: these annotations where already present in the previous release baseline was comparing to
> - the problem can be solved by just incrementing the package versions (2nd commit), but this does not seem to like a proper solution
> - and will it do the same for future releases?
> 
> 
> [1] https://github.com/apache/sling-org-apache-sling-caconfig-api/tree/feature/SLING-8824-parent25

I experienced the same issue regarding the JSR-305 annotations in [4], but Karl and I think we found the explanation: parent 35 defines sling.java.version as 8 by default. Most of the projects which were not yet migrated to parent 35 were built with Java 7. In [5] there’s a mention that the baseline check also applies to the resulted bytecode, therefore implying that it could trigger warnings when you’re baselining against the same codebase, but with the artifact built with a different JDK.

I guess we’ll just have to bump those micro versions once and see if the history repeats itself for subsequent releases with the same JDK, or if [5] is indeed the correct explanation.

Regards,
Radu

[4] - https://issues.apache.org/jira/browse/SLING-8827 <https://issues.apache.org/jira/browse/SLING-8827>
[5] - https://github.com/bndtools/bnd/issues/2177 <https://github.com/bndtools/bnd/issues/2177>