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

karaf-maven-plugin cannot handle all types of mvn urls

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Some feature files list bundle references with maven repository urls.
      For example the apache-camel-2.13.1 feature file contains:

      <feature name='camel-script-groovy' version='2.13.1' resolver='(obr)' start-level='50'>
          <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1</bundle>
      

      There is no problem if you install such a feature from the karaf shell. I think karaf uses the pax url handler internally (see https://ops4j1.jira.com/wiki/display/paxurl/Mvn+Protocol) which handles repository urls, too.

      But if you try to provision a new karaf distribution with maven and the karaf-assembly packaging type, those urls cannot be resolved.

      Just try to include the bootFeature camel-script-groovy and you get the following error:

      [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:3.0.1:install-kars (default-install-kars) on project karaf3-distribution: Couldn't resolve artifact mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1: Could not find artifact mvn:http:jar://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1 in central (http://repo1.maven.org/maven2) -> [Help 1]
      

      If the plugin cannot or even should not try to include the maven repository it could just ignore it in the resolution process (strip of the repository information from the url) and report the repo url as a warning.
      The missing reference to the repository can then be included in the pom.xml file.

      I removed the repository information in the feature file inside my local maven repository for testing purposes, included the missing repository in the pom.xml file and the karaf-plugin was able to install the feature.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jbonofre Jean-Baptiste Onofré
            kai.reichert Kai Reichert
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment