0
votes

I have a few JBoss projects, with versions in POM set to 1.0.0-SNAPSHOT. JBoss is setup with Nexus snapshot repository as remote repository in org.ops4j.pax.url.mvn.cfg, like so:

org.ops4j.pax.url.mvn.repositories= \
http://localhost:8888/nexus/content/repositories/snapshots/@snapshots@id=nexus.repo

In my POMs, I use the Nexus Maven plugin to deploy the built artifacts to Nexus, with "mvn clean deploy", like so:

<plugin>
    <groupId>org.sonatype.plugins</groupId>
    <artifactId>nexus-staging-maven-plugin</artifactId>
    <version>1.6.7</version>
    <extensions>true</extensions>
    <configuration>
    <serverId>nexus</serverId>
    <nexusUrl>http://localhost:8888/nexus/</nexusUrl>
    </configuration>
</plugin>

Latest artifact gets into Nexus just fine. So I deploy to Fuse with this:

$FUSE_BIN/client "osgi:install -s mvn:my.package/my-service/1.0.0-SNAPSHOT"
$FUSE_BIN/client "osgi:update my-service mvn:my.package/my-service/1.0.0-SNAPSHOT"

However, it updates the service using the cached version from the "localRepository", instead of downloading the latest. So am I supposed to:

1) Update the version in the POM every time I use "mvn deploy"

2) Purge the localRepository before I use osgi:update

3) Something I've configured wrong?

Isn't the localRepository supposed to know when the cached artifact is different from Nexus?

1

1 Answers

0
votes

You're installing an already-installed artifact (I don't se any uninstall going on in your code) with the same version. It's perfectly legit to reuse the "local" artifact.

If you wish JBoss Fuse to "reload" an artifact, you should tell it to do it.

JBossFuse:karaf@root> dev:watch 372
Watched URLs/IDs:
371
372

Now when you deploy a newer -SNAPSHOT, JBoss Fuse will reload it.

Reference: https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Console_Reference/files/ConsoleDevWatch.html