Skip to content

MavenBndRepository does not download remote updates to snapshot jars #6427

@pconley-onc

Description

@pconley-onc

Bndtools version: 7.0.0 (Git-Descriptor: 7.0.0.RC2-3-gb82dc867a; Git-SHA: b82dc86) and 7.1.0 (Git-Descriptor: 7.0.0.DEV-1660-g47e504d78; Git-SHA: 47e504d)
Java version: OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode)
OS: Ubuntu 22.04

We have a non-bnd OSGi bundle being published to a private Maven repository several times daily by CI. I'm trying to use this bundle in a bnd workspace through a MavenBndRepository, but it's not being updated properly: the bundle was initially downloaded correctly, but now that new versions have been published, clicking on Refresh Repositories Tree doesn't download them.

My configuration is as follows. build.bnd has a plugin (among others)

-plugin: \
    aQute.bnd.repository.maven.provider.MavenBndRepository; \
       snapshotUrl=https://${mavenRepoUrl}/snapshots; \
       index=${.}/onc.maven; \
       name="ONC Maven"; \
       readOnly=true, \
    ...

onc.maven:

ca.uvic.onc:oceans-next:0.1.0-SNAPSHOT

When opened in Eclipse, the jar reports a Last Modified timestamp of 2025-01-10T16:56:34Z (this is wrong - it's actually 16:56:34 at UTC-8, but I assume this isn't a problem); this matches lastModified value in ~/.m2/repository/ca/uvic/onc/oceans-next/0.1.0-SNAPSHOT/maven-metadata-D1C6EDBA.xml, which contains (among other things)

<snapshotVersion>
  <extension>jar</extension>
  <value>0.1.0-20250111.010316-10</value>
  <updated>20250111010316</updated>
</snapshotVersion>

However, the latest version according to our Maven repository's maven-metadata.xml is

<snapshotVersion>
  <extension>jar</extension>
  <value>0.1.0-20250113.174326-11</value>
  <updated>20250113174326</updated>
</snapshotVersion>

Clicking Refresh Repositories Tree doesn't download the new metadata file or the new jar, and doesn't log any errors. It appears that re-launching Eclipse sometimes updates the jar, but I haven't been able to reproduce that reliably.

In case it makes a difference, I do have a ~/.m2/settings.xml containing

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">

<profiles>
  <profile>
    <repositories>
      <repository>
        <id>onc-maven-snapshots</id>
        <name>ONC Maven</name>
        <url>${mavenRepoUrl}</url>
        <releases>
          <enabled>false</enabled>
        </releases>
        <snapshots>
          <enabled>true</enabled>
          <updatePolicy>always</updatePolicy>
          <checksumPolicy>ignore</checksumPolicy>
        </snapshots>
      </repository>
    </repositories>
  </profile>
</profiles>

</settings>

I don't know whether this is a bndtools issue or my own problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions