Hi,

it's already what I replied on the Karaf mailing list.
AFAIR, Steinar wants to avoid bundle:update: he wants an auto-update (and bundle:watch can only update from the local repository).

Regards
JB


On 09/04/2017 05:59 PM, Grzegorz Grzybek wrote:
Hello

What you described is implemented in JBoss Fuse 6.x / Fabric8 v1. But it's not that big problem to try to implement it.

1b) "scan the configured repositories" - you have org.ops4j.pax.url.mvn.repositories property in org.ops4j.pa.url.mvn PID 1c) entire point is just "aether resolution operation for SNAPSHOT version" - see the details here: http://ggrzybek.blogspot.com/2016/10/using-maven-with-osgi-part-3.html

In Karaf you can:

osgi:install mvn:groupId/artifactId/version

if "version" is X.Y.Z-SNAPSHOT, then simple "osgi:update <bundle-id or symbolic name>" will go through entire Aether/Maven resolution according to configured update policy (for example, if local version of metadata is not older than 1 day, "org.ops4j.pax.url.mvn.globalUpdatePolicy = daily" will prevent redownloading of metadata.

See http://ggrzybek.blogspot.com/2016/07/using-maven-with-osgi-part-2.html for more information about pax-url-aether configuration See http://ggrzybek.blogspot.com/2016/10/using-maven-with-osgi-part-3.html for more information about SNAPSHOT resolution

I hope this information will help you decide on your design.

regards
Grzegorz Grzybek

2017-09-04 17:43 GMT+02:00 Steinar Bang <[email protected] <mailto:[email protected]>>:

    I'm thinking about writing an OSGi plugin for karaf that can be
    configured to watch a remote repository for snapshot updates.

    The idea is to do something like this
     1. For each configured bundle, if the bundle has a snapshot version,
    intially do
        a. Get the maven coordinates
        b. Scan the configured repositories and chose the first repository
           that has the artifact
        c. Download the Repo-URL/groupId/artifactId/version/maven-metadata.xml
           and parse it to find the most recent snapshot, taking note of the
           maven repository, newest snapshot version, newest snapshot
           timestamp, as well as the update time of the maven-metadata.xml
           file
     2. Schedule a job that for each configured bundle, that:
        a. Does a conditional GET for the
    Repo-URL/groupId/artifactId/version/maven-metadata.xml
           file
        b. If the conditional GET receives content, parse the content and
           extract the snapshot version and timestamp and compare them with
           the save versions to see if they actually have changed
        c. If a new snapshot has arrived, tell the bundle to update

    Right now I'm reading the Pax-URL documentation[1] trying to figure out
    if it's possible to do step 1b.

    Does anyone familiar with Pax-Url think this might be feasible? Or is
    the actual repo used so hidden away that it is hard to do?

    Thanks!


    - Steinar

    References:
    [1] <https://ops4j1.jira.com/wiki/spaces/paxurl/pages/3833866/Mvn+Protocol
    <https://ops4j1.jira.com/wiki/spaces/paxurl/pages/3833866/Mvn+Protocol>>

    --
    --
    ------------------
    OPS4J - http://www.ops4j.org - [email protected]
    <mailto:[email protected]>

    ---
    You received this message because you are subscribed to the Google Groups
    "OPS4J" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to [email protected]
    <mailto:ops4j%[email protected]>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.


--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]

---
You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to