Damien Mannion
Damien Mannion

Reputation: 13

karaf-assembly 4.0.5 - zip ard tar.gz files are not generated at the end of a successful maven build

I am an inexperienced Java and Maven developer, although I have got karaf-assembly builds to work a couple of years ago using the Karaf 3.0.1 release.

When attempting to generating a karaf-assemby 4.0.5 for a customised product build, the zip and tar.gz files are not created at the end of the maven build. The ../target/assembly directory is created each time the maven build is run and the completion status is always "BUILD SUCCESS".

I suspect this this is because the POM file has an error highlighted by the Eclipse IDE at the section for the karaf-maven-plugin directly on the line, which is as follows:

Plugin execution not covered by lifecycle configuration: org.apache.karaf.tooling:karaf-maven-plugin:4.0.5:assembly (execution: default-assembly, phase: process- resources)

I can resolve this error in the IDE on the line by removing the "extensions" line, but then I get a "Project build error: Unknown packaging: karaf-assembly" error on the "packaging" line.

    <plugins>
        <plugin>
            <groupId>org.apache.karaf.tooling</groupId>
            <artifactId>karaf-maven-plugin</artifactId>
            **<!--  <extensions>true</extensions>  -->**
            <configuration>

                <startupFeatures></startupFeatures>
                <bootFeatures>
                  <feature>standard</feature>
                  <feature>management</feature>
                  <feature>jms</feature>

                </bootFeatures>
                <installedFeatures>
                </installedFeatures>
            </configuration>
        </plugin>

The POM file I am using is as follows:

http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>my.custom</groupId>
<artifactId>my.distribution</artifactId>
<version>1.0</version>
<packaging>karaf-assembly</packaging>

<!-- PIP Operations Aspect Assembly properties -->
<properties>
    <maven-compiler-plugin-version>2.3.2</maven-compiler-plugin-version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <assembly.directory>${project.build.directory}/assembly/karaf-4.0.5</assembly.directory>
    <karaf.name>karaf</karaf.name>
    <karaf.version>4.0.5</karaf.version>
    <pip.name>Operations Aspect</pip.name>
</properties>

<dependencies>

     <dependency> 
         <groupId>org.apache.karaf.features</groupId> 
         <artifactId>framework</artifactId> 
         <version>4.0.5</version> 
         <type>kar</type> 
     </dependency> 
     <dependency> 
         <groupId>org.apache.karaf.features</groupId> 
         <artifactId>framework</artifactId> 
         <version>4.0.5</version> 
         <classifier>features</classifier> 
         <type>xml</type> 
         <scope>runtime</scope> 
     </dependency> 
     <dependency>
        <groupId>org.apache.karaf.features</groupId>
        <artifactId>standard</artifactId>
        <classifier>features</classifier>
        <version>4.0.5</version>
        <type>xml</type>
        <scope>runtime</scope> 
    </dependency>
     <dependency>
         <groupId>org.apache.karaf.features</groupId>
         <artifactId>enterprise</artifactId>
        <classifier>features</classifier>
         <version>4.0.5</version>
         <type>xml</type>
         <scope>runtime</scope> 
     </dependency>
</dependencies>

<build>    
    <pluginManagement>
        <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.7</version>
            <executions>
                <execution>
                    <id>process-resources</id>
                    <goals>
                        <goal>resources</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>  
        </plugins> 
    </pluginManagement>  


    <plugins>
        <plugin>
            <groupId>org.apache.karaf.tooling</groupId>
            <artifactId>karaf-maven-plugin</artifactId>
            <version>4.0.5</version>
            <extensions>true</extensions>
            <configuration>

                <startupFeatures></startupFeatures>
                <bootFeatures>
                  <feature>standard</feature>
                  <feature>management</feature>
                  <feature>jms</feature>

                </bootFeatures>
                <installedFeatures>
                </installedFeatures>
            </configuration>
        </plugin>
    </plugins>

</build>

Any suggestions would be gratefully received.

Upvotes: 1

Views: 361

Answers (1)

Christian Schneider
Christian Schneider

Reputation: 19626

You might be missing the execution settings:

<executions>
  <execution>
    <phase>compile</phase>
      <goals>
        <goal>assembly</goal>
      </goals>
    </execution>
    <execution>
      <id>package</id>
      <goals>
        <goal>archive</goal>
      </goals>
    </execution>
</executions>

Upvotes: 1

Related Questions