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

Karaf Maven Plugin fails with pax-http Error

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: karaf-tooling
    • Labels:
      None
    • Environment:

      Ubuntu, RHEL with OpenJDK

      Description

      Karaf Maven Plugin fails with the following error when trying to create a custom distribution using the karaf-maven-plugin:

      [ERROR] Failed to execute goal
      org.apache.karaf.tooling:karaf-maven-plugin:3.0.0-SNAPSHOT:features-add-to-repository
      (features-add-to-repository) on project apache-karaf: Error populating
      repository: Unable to find the feature 'pax-http' -> [Help 1]

      Sample pom.xml configuration:

      <artifactId>apache-karaf</artifactId>
      <packaging>pom</packaging>
      <name>Custom Karaf Distribution</name>
      <dependencies>
      <dependency>
      <groupId>org.apache.karaf</groupId>
      <artifactId>apache-karaf</artifactId>
      <version>$

      {karaf.version}</version>
      <type>tar.gz</type>
      </dependency>
      </dependencies>

      <build>
      <plugins>
      <plugin>
      <groupId>org.apache.karaf.tooling</groupId>
      <artifactId>karaf-maven-plugin</artifactId>
      <executions>
      <execution>
      <id>features-add-to-repository</id>
      <phase>generate-resources</phase>
      <goals>
      <goal>features-add-to-repository</goal>
      </goals>
      <configuration>
      <descriptors>
      <descriptor>
      mvn:org.apache.karaf.features/spring/${karaf.version}

      /xml/features
      </descriptor>
      </descriptors>
      <features>
      <feature>config</feature>
      <feature>standard</feature>
      <feature>region</feature>
      <feature>package</feature>
      <feature>kar</feature>
      <feature>ssh</feature>
      <feature>management</feature>
      <feature>webconsole</feature>
      <feature>spring</feature>
      <feature>spring-jms</feature>
      <feature>spring-tx</feature>
      </features>
      <repository>target/features-repo</repository>
      </configuration>
      </execution>
      </executions>
      </plugin>
      </plugins>
      </build>

        Activity

        Hide
        achim_nierbeck Achim Nierbeck added a comment -

        I know and it's documented in KARAF-2227

        Show
        achim_nierbeck Achim Nierbeck added a comment - I know and it's documented in KARAF-2227
        Hide
        olli Oliver Lietz added a comment -

        there is something wrong in Karaf with Pax Web, module Integration Tests fails with

        Tests in error: 
          installJettyFeature:org.apache.karaf.itests.features.StandardFeaturesTest.installJettyFeature:KarafTestContainer{mvn:org.apache.karaf\/apache-karaf\/3.0.0-SNAPSHOT\/tar.gz}(org.apache.karaf.itests.features.StandardFeaturesTest): No feature named 'pax-jetty' with version '8.1.4.v20120524' available
        
        Tests run: 81, Failures: 0, Errors: 1, Skipped: 2
        
        Show
        olli Oliver Lietz added a comment - there is something wrong in Karaf with Pax Web, module Integration Tests fails with Tests in error: installJettyFeature:org.apache.karaf.itests.features.StandardFeaturesTest.installJettyFeature:KarafTestContainer{mvn:org.apache.karaf\/apache-karaf\/3.0.0-SNAPSHOT\/tar.gz}(org.apache.karaf.itests.features.StandardFeaturesTest): No feature named 'pax-jetty' with version '8.1.4.v20120524' available Tests run: 81, Failures: 0, Errors: 1, Skipped: 2
        Hide
        achim_nierbeck Achim Nierbeck added a comment -

        This is due to the fact that the pax-web features are in their own features file (repository). It's known to karaf per default, since it's registered in the org.apache.karaf.features.cfg as part of the default repository (featuresRepositories).
        This information isn't known to the maven plugin and therefore it fails. You need to add the Pax-Web feature xml to your pom as dependency and also add it to the descriptors. Same as if you would add camel features to your project.

        Show
        achim_nierbeck Achim Nierbeck added a comment - This is due to the fact that the pax-web features are in their own features file (repository). It's known to karaf per default, since it's registered in the org.apache.karaf.features.cfg as part of the default repository (featuresRepositories). This information isn't known to the maven plugin and therefore it fails. You need to add the Pax-Web feature xml to your pom as dependency and also add it to the descriptors. Same as if you would add camel features to your project.

          People

          • Assignee:
            achim_nierbeck Achim Nierbeck
            Reporter:
            aritra Aritra Chatterjee
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development