Search code examples
junitosgipax-runnerpax-exam

What's the maven SNAPSHOT dependency update policy in pax-exam?


I am using pax-exam to run my osgi unit testing right now. In the project which I am working on, there are many sub-modules and dependency relation between bundles. Right now, the version of bundles in my project is x.x.x-SNAPSHOT. I set up the pax-exam config option as these:

options.add(CoreOptions.mavenBundle().groupId("xxx.xxx").artifactId("xxx.xxxx.xxxx.xx").versionAsInProject());

when I run the testing, pax will re-download my SNAPSHOT dependencies, and read the release dependencies from my local repo. And output following info:

[main] INFO org.ops4j.pax.scanner.internal.ProvisionServiceImpl - Scan bundles from [scan-bundle:mvn:commons-lang/commons-lang/2.6]
[main] INFO org.ops4j.pax.scanner.internal.ProvisionServiceImpl - Scan bundles from [scan-bundle:mvn:xxx.xxx/xxx.xxx.xxx/x.x.x-SNAPSHOT@update]

As you see, pax will auto update SNAPSHOT dependencies, even though I did not set up the dependencies update policy. My question is: Is that pax defult behavior? How to change this behavior? I don't want to auto update SNAPSHOT dependencies.


Solution

  • The @update suffix you're seeing in the log message refers to an OSGi bundle update, not to a Maven snapshot update.

    See http://team.ops4j.org/wiki/display/paxscanner/Bundle+Scanner.

    By the way, it seems you're using the Pax Runner Container. The Native Container is easier to work with in general.