Thanks Jean, for a quick response. That solved my initial problem of
building the custom distribution.

But the built distribution when used in Pax Exam test show missing
dependencies. My parent module includes both log4j and slf4j as the
dependencies. Does the karaf-assmbley include those or should I have to do
anything more?

2015-04-21 14:28:39,649 | ERROR | FelixStartLevel  | Felix
           |  -  -  | Error starting
mvn:org.apache.logging.log4j/log4j-core/2.2
org.osgi.framework.BundleException: Unresolved constraint in bundle
org.apache.logging.log4j.core [6]: Unable to resolve 6.0: missing
requirement [6.0] osgi.wiring.package;
(osgi.wiring.package=org.apache.logging.log4j)
        at
org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002)[org.apache.felix.framework-4.4.1.jar:]
        at
org.apache.felix.framework.Felix.startBundle(Felix.java:2045)[org.apache.felix.framework-4.4.1.jar:]
        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)[org.apache.felix.framework-4.4.1.jar:]
        at
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)[org.apache.felix.framework-4.4.1.jar:]
        at java.lang.Thread.run(Thread.java:745)[:1.7.0_75]
2015-04-21 14:28:39,653 | ERROR | FelixStartLevel  | Felix
           |  -  -  | Error starting
mvn:org.apache.logging.log4j/log4j-slf4j-impl/2.2
org.osgi.framework.BundleException: Unresolved constraint in bundle
org.apache.logging.log4j.slf4j-impl [7]: Unable to resolve 7.0: missing
requirement [7.0] osgi.wiring.package;
(&(osgi.wiring.package=org.apache.logging.log4j)(version>=2.2.0)(!(version>=3.0.0)))

--
Nataraj Basappa

On Tue, Apr 21, 2015 at 1:05 PM, Jean-Baptiste Onofré <[email protected]>
wrote:

> By the way, I will update the documentation to reflect that.
>
> Regards
> JB
>
> On 04/21/2015 01:55 PM, Nataraj Basappa wrote:
>
>> Hi,
>>    I'm trying to build a Karaf custom distribution for a evaluation
>> project that I'm working on. I'm trying out with following pom file and
>> and seeing this error. Hope someone can point me in right direction or
>> correct me if I'm missing something.
>>
>> I'm following this links:
>>   -
>>
>> http://karaf.apache.org/manual/latest/developers-guide/custom-distribution.html
>>   -
>>
>> https://github.com/apache/karaf/blob/master/manual/src/main/webapp/developers-guide/custom-distribution.conf
>>
>> POM file:
>>
>> <projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi=";
>> http://www.w3.org/2001/XMLSchema-instance";
>>
>>           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>>      <parent>
>>          <artifactId>osgi-webapp</artifactId>
>>          <groupId>com.example.osgi</groupId>
>>          <version>1.0</version>
>>      </parent>
>>      <modelVersion>4.0.0</modelVersion>
>>
>>      <artifactId>karaf-distribution-test</artifactId>
>>      <version>4.0.0.M2</version>
>>      <packaging>karaf-assembly</packaging>
>>
>>      <name>karaf-distribution-test</name>
>>      <url>http://maven.apache.org</url>
>>
>>      <properties>
>>
>>  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>          <!-- keep this inline with distribution version -->
>>          <karaf.version>4.0.0.M2</karaf.version>
>>      </properties>
>>
>>      <dependencies>
>>          <dependency>
>>              <!-- scope is compile so all features (there is only one)
>> are installed into startup.properties and the feature repo itself is not
>> added in etc/org.apache.karaf.features.cfg file -->
>>              <groupId>org.apache.karaf.features</groupId>
>>              <artifactId>framework</artifactId>
>>              <version>${karaf.version}</version>
>>              <type>kar</type>
>>          </dependency>
>>          <dependency>
>>              <!-- scope is runtime so the feature repo is listed in
>> etc/org.apache.karaf.features.cfg file, and features will installed into
>> the system directory -->
>>              <groupId>org.apache.karaf.features</groupId>
>>              <artifactId>standard</artifactId>
>>              <classifier>features</classifier>
>>              <version>${karaf.version}</version>
>>              <type>xml</type>
>>              <scope>runtime</scope>
>>          </dependency>
>>      </dependencies>
>>
>>      <build>
>>          <defaultGoal>install</defaultGoal>
>>
>>          <resources>
>>              <resource>
>>
>>  <directory>${project.basedir}/src/main/resources</directory>
>>                  <filtering>true</filtering>
>>                  <includes>
>>                      <include>**/*</include>
>>                  </includes>
>>                  <excludes/>
>>              </resource>
>>          </resources>
>>
>>          <plugins>
>>              <plugin>
>>                  <groupId>org.apache.maven.plugins</groupId>
>>                  <artifactId>maven-resources-plugin</artifactId>
>>                  <version>2.7</version>
>>                  <executions>
>>                      <execution>
>>                          <id>filter</id>
>>                          <phase>generate-resources</phase>
>>                          <goals>
>>                              <goal>resources</goal>
>>                          </goals>
>>                      </execution>
>>                  </executions>
>>              </plugin>
>>              <plugin>
>>                  <groupId>org.apache.karaf.tooling</groupId>
>>                  <artifactId>karaf-maven-plugin</artifactId>
>>                  <extensions>true</extensions>
>>                  <configuration>
>>                      <bootFeatures>
>>                          <feature>standard</feature>
>>                          <feature>management</feature>
>>                      </bootFeatures>
>>                  </configuration>
>>              </plugin>
>>          </plugins>
>>      </build>
>>
>> </project>
>>
>>
>> Error seen on Maven execution:
>>
>> [INFO] == Installing artifact
>> mvn:org.apache.karaf.features/standard/4.0.0.M2/xml/features
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] BUILD FAILURE
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 4.809 s
>> [INFO] Finished at: 2015-04-21T12:45:22+01:00
>> [INFO] Final Memory: 20M/316M
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] Failed to execute goal
>> org.apache.karaf.tooling:karaf-maven-plugin:4.0.0.M2:install-kars
>> (default-install-kars) on project karaf-distribution-test: Unable to
>> build assembly: Could not find matching feature for standard -> [Help 1]
>> [ERROR]
>> [ERROR] To see the full stack trace of the errors, re-run Maven with the
>> -e switch.
>> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>> [ERROR]
>> [ERROR] For more information about the errors and possible solutions,
>> please read the following articles:
>> [ERROR] [Help 1]
>> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
>>
>> --
>> Nataraj Basappa
>>
>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Reply via email to