Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2011

dev:watch looks in an incorrect local maven repository

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.9, 2.3.0
    • Fix Version/s: None
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      If a non-default maven repository is used (by setting the "localRepository" property in maven's settings.xml), then dev:watch does not work. It seems like dev:watch does not consider the "localRepository" setting when looking for a bundle in maven.

      Note that other parts of Karaf does take the "localRepository" setting into account since installing features and using the "update" command works.

      This has been discussed on the user mailing list:

      http://karaf.922171.n3.nabble.com/dev-watch-problems-td4026725.html#a4026730

        Activity

        Hide
        jbonofre Jean-Baptiste Onofré added a comment - - edited

        dev:watch works if you define the org.ops4j.pax.url.mvn.localRepository property in etc/org.ops4j.pax.url.mvn.cfg, but if this property is not set, it ignores the <localRepository/> tag from the settings.xml, and fallback to user.home/.m2/repository.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - - edited dev:watch works if you define the org.ops4j.pax.url.mvn.localRepository property in etc/org.ops4j.pax.url.mvn.cfg, but if this property is not set, it ignores the <localRepository/> tag from the settings.xml, and fallback to user.home/.m2/repository.
        Hide
        rodehav Bengt Rodehav added a comment -

        Interesting. I guess the org.ops4j.pax.url.mvn.localRepository property can then be used as a workaround. But, of course, it should not be necessary since other parts of Karaf correctly detects the <localRepository> defined in maven's settings.xml. Seems like this is code that should be reused in every part of Karaf that needs to find the local repo.

        Show
        rodehav Bengt Rodehav added a comment - Interesting. I guess the org.ops4j.pax.url.mvn.localRepository property can then be used as a workaround. But, of course, it should not be necessary since other parts of Karaf correctly detects the <localRepository> defined in maven's settings.xml. Seems like this is code that should be reused in every part of Karaf that needs to find the local repo.
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        I'm investigating to see if the issue is not in Pax Url or the way that we create the MavenConfiguration in the BundleWatcher.

        I saw that:

        • if we define the settings.xml in etc/org.ops4j.pax.url.mvn.cfg, it seems that the <localRepository/> tag is considered correctly
        • if we don't define the settings.xml, MavenConfiguration doesn't fall back to the default location (home.user/.m2/settings.xml)

        I postpone this Jira to 2.2.11 to give me more time to investigate. As a workaround, I invite you to define localRepository property in the etc/org.ops4j.pax.url.mvn.cfg.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - I'm investigating to see if the issue is not in Pax Url or the way that we create the MavenConfiguration in the BundleWatcher. I saw that: if we define the settings.xml in etc/org.ops4j.pax.url.mvn.cfg, it seems that the <localRepository/> tag is considered correctly if we don't define the settings.xml, MavenConfiguration doesn't fall back to the default location (home.user/.m2/settings.xml) I postpone this Jira to 2.2.11 to give me more time to investigate. As a workaround, I invite you to define localRepository property in the etc/org.ops4j.pax.url.mvn.cfg.
        Hide
        rodehav Bengt Rodehav added a comment -

        OK. I'll use the workaround until you've investigated this further.

        Show
        rodehav Bengt Rodehav added a comment - OK. I'll use the workaround until you've investigated this further.

          People

          • Assignee:
            jbonofre Jean-Baptiste Onofré
            Reporter:
            rodehav Bengt Rodehav
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development