bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
527 stars 305 forks source link

bnd-baseline-plugin: Baseline mismatch for package xxx MAJOR change. Current is 2.4.0, repo is 2.4.0, suggest 3.0.0 or 2.4.0 #5082

Closed kwin closed 2 years ago

kwin commented 2 years ago

Why do I get the error Baseline mismatch for package org.apache.jackrabbit.vault.fs.spi, MAJOR change. Current is 2.4.0, repo is 2.4.0, suggest 3.0.0 or 2.4.0 which fails the build, if it states that either version 2.4.0 or 3.0.0 should work and 2.4.0 is set? It should only fail if 3.0.0 is required (which should be reflected in the error message).

You can reproduce with https://github.com/apache/jackrabbit-filevault/pull/169 (https://ci-builds.apache.org/blue/organizations/jenkins/Jackrabbit%2Ffilevault/detail/PR-169/4/pipeline/22/)

The full error is

[INFO] --- bnd-baseline-maven-plugin:6.1.0:baseline (baseline) @ org.apache.jackrabbit.vault ---
[INFO] Determining the baseline version for org.apache.jackrabbit.vault:org.apache.jackrabbit.vault:jar:(,3.5.9-SNAPSHOT) using repositories [nexus (https://repo.int.netcentric.biz/nexus/content/groups/public/, default, releases+snapshots)]
Downloading from nexus: https://repo.int.netcentric.biz/nexus/content/groups/public/org/apache/jackrabbit/vault/org.apache.jackrabbit.vault/maven-metadata.xml
Downloaded from nexus: https://repo.int.netcentric.biz/nexus/content/groups/public/org/apache/jackrabbit/vault/org.apache.jackrabbit.vault/maven-metadata.xml (1.9 kB at 228 B/s)
[INFO] The baseline version was found to be 3.5.8
[ERROR] Baseline mismatch for package org.apache.jackrabbit.vault.fs.spi, MAJOR change. Current is 2.4.0, repo is 2.4.0, suggest 3.0.0 or 2.4.0
MAJOR                PACKAGE    org.apache.jackrabbit.vault.fs.spi
  MAJOR              INTERFACE  org.apache.jackrabbit.vault.fs.spi.UserManagement
    ADDED            METHOD     getAuthorizableId(org.apache.jackrabbit.vault.util.DocViewNode2)
      ADDED          ACCESS     abstract
      ADDED          RETURN     java.lang.String
...
[ERROR] Failed to execute goal biz.aQute.bnd:bnd-baseline-maven-plugin:6.1.0:baseline (baseline) on project org.apache.jackrabbit.vault: An error occurred while calculating the baseline: The baselining plugin detected versioning errors -> [Help 1]
bjhargrave commented 2 years ago

The message text is not great. What it is trying to say is that if you changed the type to be @ProviderType (instead of the default of @ConsumerType), then the version 2.4.0 would be suggested.

https://github.com/bndtools/bnd/blob/86ab8661af69eae05e51f62d16e0c0fd3b811e14/biz.aQute.bndlib/src/aQute/bnd/differ/Baseline.java#L217-L239

kwin commented 2 years ago

I see, the message should be more verbose. Something along the lines of suggest 3.0.0 (or 2.4.0 when the type is changed to @ProviderType for the affected classes)

bjhargrave commented 2 years ago

Yes, something like that.