bndtools / bnd

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

bnd-baseline-maven-plugin 3.4.0-SNAPSHOT cannot set the desired baseline #1755

Closed cdealti closed 4 years ago

cdealti commented 7 years ago

Due to #1726 I need to use the latest 3.4.0 snapshot. My configuration of the plugin is [1] and [2].

By following the suggestions of bnd-baseline-maven-plugin I had to set the version of [2] to [1.1.0-SNAPSHOT].

The last released version of this project is 1.0.9 and I want this to be used as the baseline. Instead, the plugin assumes that 1.0.10-SNAPSHOT is the latest version and it looks like I cannot control the baseline.

[INFO] Automatically determining the baseline version for org.eclipse.kura:org.eclipse.kura.api:jar:1.1.0-SNAPSHOT using repositories [repo.eclipse.org (https://repo.eclipse.org/content/repositories/kura-snapshots/, default, releases+snapshots), p2-repo-equinox_3.8.1 (file:////home/cristiano/dev/git/cdealti/kura/kura/org.eclipse.kura.api/../target-definition/equinox_3.8.1/repository/, p2, disabled), p2-repo-common (file:////home/cristiano/dev/git/cdealti/kura/kura/org.eclipse.kura.api/../target-definition/common/repository/, p2, disabled), kura_addons (https://raw.github.com/eurotech/kura_addons/mvn-repo/, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
Downloading: https://raw.github.com/eurotech/kura_addons/mvn-repo/org/eclipse/kura/org.eclipse.kura.api/maven-metadata.xml
Downloading: https://repo.maven.apache.org/maven2/org/eclipse/kura/org.eclipse.kura.api/maven-metadata.xml
Downloading: https://repo.eclipse.org/content/repositories/kura-snapshots/org/eclipse/kura/org.eclipse.kura.api/maven-metadata.xml
Downloaded: https://repo.eclipse.org/content/repositories/kura-snapshots/org/eclipse/kura/org.eclipse.kura.api/maven-metadata.xml (397 B at 0.5 KB/sec)
[INFO] The baseline version was found to be 1.0.10-SNAPSHOT
Downloading: https://raw.github.com/eurotech/kura_addons/mvn-repo/org/eclipse/kura/org.eclipse.kura.api/1.0.10-SNAPSHOT/maven-metadata.xml
Downloading: https://repo.eclipse.org/content/repositories/kura-snapshots/org/eclipse/kura/org.eclipse.kura.api/1.0.10-SNAPSHOT/maven-metadata.xml
Downloaded: https://repo.eclipse.org/content/repositories/kura-snapshots/org/eclipse/kura/org.eclipse.kura.api/1.0.10-SNAPSHOT/maven-metadata.xml (2 KB at 4.1 KB/sec)
[ERROR] Baseline mismatch for package org.eclipse.kura.asset, CHANGED change. Current is 1.0.0, repo is 1.0.0, suggest 1.0.1 or -
[ERROR] Baseline mismatch for package org.eclipse.kura.cloud.factory, CHANGED change. Current is 1.1.0, repo is 1.1.0, suggest 1.1.1 or -
[ERROR] Baseline mismatch for package org.eclipse.kura.driver, CHANGED change. Current is 1.0.0, repo is 1.0.0, suggest 1.0.1 or -
[ERROR] Baseline mismatch for package org.eclipse.kura.wire, CHANGED change. Current is 1.0.0, repo is 1.0.0, suggest 1.0.1 or -

I've also tried to specify the version of the baseline via the <base> configuration but it looks like it searches that version only in the Kura snapshots repository:

[INFO] --- bnd-baseline-maven-plugin:3.4.0-SNAPSHOT:baseline (baseline) @ org.eclipse.kura.api ---
Downloading: https://bndtools.ci.cloudbees.com/job/bnd.master/lastSuccessfulBuild/artifact/dist/bundles/biz/aQute/bnd/biz.aQute.bndlib/3.4.0-SNAPSHOT/maven-metadata.xml
Downloaded: https://bndtools.ci.cloudbees.com/job/bnd.master/lastSuccessfulBuild/artifact/dist/bundles/biz/aQute/bnd/biz.aQute.bndlib/3.4.0-SNAPSHOT/maven-metadata.xml (2 KB at 2.4 KB/sec)
Downloading: https://repo.eclipse.org/content/repositories/kura-snapshots/org/eclipse/kura/org.eclipse.kura.api/1.0.9/org.eclipse.kura.api-1.0.9.jar
Downloading: https://raw.github.com/eurotech/kura_addons/mvn-repo/org/eclipse/kura/org.eclipse.kura.api/1.0.9/org.eclipse.kura.api-1.0.9.jar
Downloading: https://repo.maven.apache.org/maven2/org/eclipse/kura/org.eclipse.kura.api/1.0.9/org.eclipse.kura.api-1.0.9.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.003 s
[INFO] Finished at: 2016-10-28T15:39:18+02:00
[INFO] Final Memory: 40M/254M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal biz.aQute.bnd:bnd-baseline-maven-plugin:3.4.0-SNAPSHOT:baseline (baseline) on project org.eclipse.kura.api: Unable to locate a previous version of the artifact: Could not find artifact org.eclipse.kura:org.eclipse.kura.api:jar:1.0.9 in repo.eclipse.org (https://repo.eclipse.org/content/repositories/kura-snapshots/) -> [Help 1]

Do I miss anything obvious?

[1] https://github.com/cdealti/kura/blob/api-analysis/kura/manifest_pom.xml [2] https://github.com/cdealti/kura/blob/api-analysis/kura/org.eclipse.kura.api/pom.xml

cdealti commented 7 years ago

Any idea on what can be wrong here?

timothyjward commented 7 years ago

Any idea on what can be wrong here?

So you're in the interesting position that the baseline version isn't available in any of your configured repositories:

https://github.com/cdealti/kura/blob/f51d9e359ad58928242a135409c40bc6ab7772fd/kura/manifest_pom.xml#L187

The plugin tries to deal with this by including the release distribution management repository:

https://github.com/bndtools/bnd/blob/addc268f2e452a11997493440914bdee67a04b9d/maven/bnd-baseline-maven-plugin/src/main/java/aQute/bnd/maven/baseline/plugin/BaselineMojo.java#L133

Unfortunately I don't think that this doesn't seem to be working for you either. I'd suggest checking that the release really is available somewhere visible in your pom, and if it is then looking around the indicated area of the code...

cdealti commented 7 years ago

Your comment has been enlightening.

So you're in the interesting position that the baseline version isn't available in any of your configured repositories:

Adding the Kura release repository to <repositories> did the trick.

The plugin tries to deal with this by including the release distribution management repository:

Is it still worth to investigate?

Thanks!

bjhargrave commented 7 years ago

I think the issue was one of not having properly configured the pom to make the baseline available. Now that you have made it available, you can properly baseline. So I think we close this issue.

timothyjward commented 7 years ago

Is it still worth to investigate?

It should probably be investigated. The plugin does try to pick the configured release repository from distributionManagement, which I think should have worked in this case...

stale[bot] commented 4 years ago

This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Bnd/Bndtools or if you have a good use case for this feature, please feel free to reopen the issue with steps to reproduce, a quick explanation of your use case or a high-quality pull request.