Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bnd-baseline-maven-plugin should not use local maven repo for baseline #2248

Closed
njbartlett opened this issue Dec 27, 2017 · 6 comments
Closed
Assignees
Milestone

Comments

@njbartlett
Copy link
Member

njbartlett commented Dec 27, 2017

Suppose I have a project which is currently using (Maven) version 1.0.0-SNAPSHOT. I build it with mvn install which copies the artifacts into the local Maven repository under ~/.m2/repository.

Now I want to release version 1.0.0, without any other change. I use the mvn versions:set command to replace 1.0.0-SNAPSHOT with 1.0.0 and rebuild with mvn install. Baselining now fails because the plugin has compared against the snapshot version in the local repository:

[INFO] --- bnd-baseline-maven-plugin:3.5.0:baseline (baseline) @ com.effectiveosgi.rt.config ---
[INFO] Automatically determining the baseline version for com.effectiveosgi:com.effectiveosgi.rt.config:jar:1.0.0 using repositories [ossrh (https://oss.sonatype.org/service/local/staging/deploy/maven2/, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] The baseline version was found to be 1.0.0-SNAPSHOT
[ERROR] The bundle version change (1.0.0 to 1.0.0) is too low, the new version must be at least 1.0.1
MAJOR                BUNDLE     com.effectiveosgi.rt.config-1.0.0
MAJOR              RESOURCES  <resources>
    MAJOR            RESOURCE   META-INF/maven/com.effectiveosgi/com.effectiveosgi.rt.config/pom.properties
    REMOVED        SHA        B6FB25BCFDCAA86B886F69CCED468345F6240FEE
    ADDED          SHA        D9C11DE758885F9D8A986ACF1AF57FD4FAB384A9
    MAJOR            RESOURCE   META-INF/maven/com.effectiveosgi/com.effectiveosgi.rt.config/pom.xml
    ADDED          SHA        55758EC23ACABF1D0C8FE4DD0D42B838BFD4FF9A
    REMOVED        SHA        ED45BAAA3C6BCFFA6F911AB16C8D48409AC389CA

Why is the baseline plugin using snapshots in the local repository as the baseline, rather than the latest release?

@bjhargrave bjhargrave added this to the 4.0 milestone Jan 19, 2018
@oliverlietz
Copy link

I'm facing a similar problem: the plugin is pulling snapshots from (remote) repositories for baselining instead of using latest release and there seems to be no way preventing this behavior but configuring base with a fixed release version in the POM.

@timothyjward
Copy link
Contributor

This looks to be a pair of issues - one is a bad fix for #1726 and the other is that we don't filter snapshot versions returned by repositories that can provide both snapshots and releases.

I've tried to put a fix together in timothyjward/bnd@2aca047 - although this doesn't build cleanly at the moment. I'm about to be away with no laptop for 2 weeks, so if someone wants to pick it up then be my guest.

@bjhargrave
Copy link
Member

In the process of finishing Tim's fix.

kwin added a commit to apache/sling-org-apache-sling-installer-hc that referenced this issue Apr 6, 2018
@kwin
Copy link
Contributor

kwin commented Apr 6, 2018

Is there any workaround available for version 3.5.0 without completely disabling the baselining?

@oliverlietz
Copy link

@kwin yes, see Re: release:prepare & bnd-baseline-maven-plugin

mvn release:prepare -Darguments="-Dbnd.baseline.skip=true"
mvn release:perform -Darguments="-Dbnd.baseline.skip=true"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants