Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5613

dev:watch does not work if local maven repo points to non-default directory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.2.1
    • Fix Version/s: jboss-fuse-6.2-patches
    • Component/s: Karaf
    • Labels:
    • Environment:

      6.2.1 and 6.2.1 R2, no Fabric

    • Steps to Reproduce:
      Hide

      1) Open ~/.m2/settings.xml and set

      <localRepository>/root/localRepo</localRepository>
      

      to a non standard local Maven repository directory.

      2) edit etc/org.ops4j.pax.url.mvn.cfg and set

      org.ops4j.pax.url.mvn.settings=/root/.m2/settings.xml
      

      3) Start JBoss Fuse 6.2.1

      4) Build and deploy any bundle that has a snapshot version

      5) run dev:watch on the deployed bundle

      6) rebuild that snapshot bundle, dev:watch will not detect the update and will not redeploy the bundle.

      If you omit step 1) and 2) and use the default ~/.m2/repository directory, step 6) will work.

      Show
      1) Open ~/.m2/settings.xml and set <localRepository> /root/localRepo </localRepository> to a non standard local Maven repository directory. 2) edit etc/org.ops4j.pax.url.mvn.cfg and set org.ops4j.pax.url.mvn.settings=/root/.m2/settings.xml 3) Start JBoss Fuse 6.2.1 4) Build and deploy any bundle that has a snapshot version 5) run dev:watch on the deployed bundle 6) rebuild that snapshot bundle, dev:watch will not detect the update and will not redeploy the bundle. If you omit step 1) and 2) and use the default ~/.m2/repository directory, step 6) will work.
    • Workaround Description:
      Hide

      explicitly set org.ops4j.pax.url.mvn.cfg

      org.ops4j.pax.url.mvn.localRepository=/root/localRepo
      
      Show
      explicitly set org.ops4j.pax.url.mvn.cfg org.ops4j.pax.url.mvn.localRepository=/root/localRepo

      Description

      If OS level user configures for non-default local Maven repository directory, then Karaf's dev:watch command fails to update and redeploy new builds of a snapshot bundle.

      When specifically setting etc/org.ops4j.pax.url.mvn.cfg

      org.ops4j.pax.url.mvn.localRepository=/root/localRepo
      

      dev:watch works fine.
      However when setting

      org.ops4j.pax.url.mvn.settings=/root/.m2/settings.xml
      

      with settings.xml pointing to a different local Maven repository folder

      <localRepository>/root/localRepo</localRepository>
      

      then dev:watch does not work.
      According to etc/org.ops4j.pax.url.mvn.cfg it should be enough to point org.ops4j.pax.url.mvn.settings to the custom settings.xml but that does not seem to be sufficient.

      # Path to the local maven repository which is used to avoid downloading
      # artifacts when they already exist locally.
      # The value of this property will be extracted from the settings.xml file
      # above, or defaulted to:
      #     System.getProperty( "user.home" ) + "/.m2/repository"
      #
      #org.ops4j.pax.url.mvn.localRepository=
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jpoth John Poth
                Reporter:
                mielket Torsten Mielke
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: