1 Reply Latest reply on Mar 16, 2011 4:34 PM by Daryl Hoyt

    mvn artifacts are not stored in localRepository?

    C E Newbie


      i'm using 4.3.0-fuse-03-00 on centos box.

      everytime i install a feature/bundles i see requests in the log of our artifactory server.

      smx is running as root in this test environment, but there is no maven installed


      so i first created the directory /root/.m2/repository, because a comment in the org.ops4j.pax.url.mvn.cfg said i will use

      System.getProperty( "user.home" ) + "/.m2/repository"


      than i set the property to

      org.ops4j.pax.url.mvn.localRepository = file:/root/.m2/repository


      this all didn't worked, the repository directory is empty and i see requests to artifactory all the time


      log:set TRACE org.ops4j also gave me no hint


      my current config looks like this


      dev@root> config:proplist

         org.ops4j.pax.url.mvn.localRepository = file:/root/.m2/repository

         service.pid = org.ops4j.pax.url.mvn

         org.ops4j.pax.url.mvn.defaultRepositories = file:/srv/apache-servicemix-4.3.0-fuse-03-00/system@snapshots

         felix.fileinstall.filename = org.ops4j.pax.url.mvn.cfg

         org.ops4j.pax.url.mvn.repositories = http://maven:8081/artifactory/repo



      okay ... could it be that smx (pax) will lookup artifacts in the local repo, if they don't exist download them, but than it will not store the artifacts?


      thanks for you help

        • 1. Re: mvn artifacts are not stored in localRepository?
          Daryl Hoyt Newbie

          As far as I know, ServiceMix doesn't have an easy way to have it build it's own local repository.


          From my experience, setting the repository as you did will not download the files to the path.  The files are added directly to the bundles under the data directory. 


          What I did to get past this was to create a pom file that contains nothing other than dependencies and ran mvn package -Dmaven.repo.local=~/root/.m2/repository which populated the repository.  From there, I modified the org.ops4j.pax.url.mvn.cfg file and set the org.ops4j.pax.url.mvn.localRepository property to /root/.m2/repository (without the file: prefix).


          ServiceMix still won't download new features to your repository, but this will allow ServiceMix to pull artifact from the local repository so it doesn't need to hit artifactory server.


          I hope this helps.