Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9017839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:22:24+00:00 2026-06-16T04:22:24+00:00

Following Situation: I am developing an OSGi Application using maven and maven-bundle-plugin. I want

  • 0

Following Situation: I am developing an OSGi Application using maven and maven-bundle-plugin. I want to run Unit Tests and discovered Pax-Exam and i find it quit suitable.

Here is my parent pom.xml

<project xmlns="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">
<modelVersion>4.0.0</modelVersion>
<groupId>de.hswt.oms</groupId>
<artifactId>workspace-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
    <repository>
        <id>com.springsource.repository.bundles.release</id>
        <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
        <url>http://repository.springsource.com/maven/bundles/release</url>
    </repository>

    <repository>
        <id>com.springsource.repository.bundles.external</id>
        <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
        <url>http://repository.springsource.com/maven/bundles/external</url>
    </repository>
</repositories>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <archive>
                    <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    <manifestEntries>
                        <Built-By>Tobias Placht</Built-By>
                        <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.3.7</version>
            <configuration>
                <instructions>
                    <Export-Package>{local-packages};version="${project.version}"</Export-Package>
                    <Import-Package>*</Import-Package>
                    <Private-Package>{local-packages}</Private-Package>
                    <Service-Component>*</Service-Component>
                </instructions>
            </configuration>
            <executions>
                <execution>
                    <id>bundle-manifest</id>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>manifest</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.12.4</version>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-junit47</artifactId>
                    <version>2.12.4</version>
                </dependency>
            </dependencies>
        </plugin>
        <plugin>
            <groupId>org.ops4j</groupId>
            <artifactId>maven-pax-plugin</artifactId>
            <version>1.5</version>
            <configuration>
                <provision>
                    <param>--profiles=ds</param>
                    <param>--platform=equinox</param>
                    <param>mvn:de.hswt.oms/workspace-datastructure-core/0.0.1-SNAPSHOT@2</param>
                    <param>mvn:de.hswt.oms/workspace-command-core/0.0.1-SNAPSHOT@2</param>
                    <param>mvn:de.hswt.oms/workspace-facade/0.0.1-SNAPSHOT@6</param>
                </provision>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>1.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.6.6</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.0.7</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.0.7</version>
    </dependency>
    <dependency>
        <groupId>org.junit</groupId>
        <artifactId>com.springsource.org.junit</artifactId>
        <version>4.11.0</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<modules>
    <module>workspace-datastructure-core</module>
    <module>workspace-command-core</module>
    <module>workspace-log-config</module>
    <module>workspace-wsr-create</module>
    <module>workspace-datastructure-local</module>
    <module>workspace-localfile-create</module>
    <module>workspace-localfolder-create</module>
    <module>workspace-facade</module>
    <module>workspace-osgiframework-tests</module>
</modules>

I have created the module workspace-osgiframework-tests which contains a Simple Test case:

import static org.ops4j.pax.exam.CoreOptions.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;

import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import javax.inject.Inject;

@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class SampleTest {

@Inject
BundleContext bu = null;

@Configuration
public Option[] config() {

    return options(junitBundles());
}

@Test
public void getHelloService() {
    for (Bundle b : bu.getBundles()) {
        System.out.println("Bundle " + b.getBundleId() + " : "
                + b.getSymbolicName());
    }
}

}

and the corresponding pom.xml

<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>workspace-osgiframework-tests</artifactId>

<properties>
    <exam.version>2.5.0</exam.version>
    <url.version>1.4.0</url.version>
</properties>

<parent>
    <groupId>de.hswt.oms</groupId>
    <artifactId>workspace-parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <relativePath>..</relativePath>
</parent>
<build>
    <plugins>
        <!-- skip plugin execution explicitly -->
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <skip>true</skip>
            </configuration>
            <executions>
                <execution>
                    <id>bundle-manifest</id>
                    <phase>none</phase>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>

    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-container-forked</artifactId>
        <version>${exam.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-junit4</artifactId>
        <version>${exam.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-link-mvn</artifactId>
        <version>${exam.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.ops4j.pax.url</groupId>
        <artifactId>pax-url-aether</artifactId>
        <version>${url.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.framework</artifactId>
        <version>4.0.2</version>
        <scope>test</scope>
    </dependency>
</dependencies>

I i run mvn test, everything works fine, but if i run mvn install i get the following error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.546s
[INFO] Finished at: Fri Dec 14 15:37:50 CET 2012
[INFO] Final Memory: 27M/233M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar         (default-jar) on project workspace-osgiframework-tests: Error assembling JAR: Manifest file: /home/knacht/development/repositorys/git/oms/workspace-parent/workspace-osgiframework-tests/target/classes/META-INF/MANIFEST.MF does not exist. -> [Help 1]

Any idea how to get rid of it?

Also this is my first maven project so if you have any advices please tell me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:22:25+00:00Added an answer on June 16, 2026 at 4:22 am

    When you’re new to Maven and Pax Exam, I’d recommend to stick to defaults as much as possible.

    Using maven-jar-plugin and maven-bundle-plugin in parallel is likely to cause the conflict you’re seeing. Change the Maven packaging of your bundle projects to “bundle” and let maven-bundle-plugin generate the manifest. There is usually no need at all to use maven-jar-plugin directly.

    maven-pax-plugin is no longer supported in Pax Exam 2.x. You should use bundle() options in your @Configuration method instead.

    For up-to-date examples, take a look at Pax Exam’s own integration tests at https://github.com/ops4j/org.ops4j.pax.exam2/tree/master/itest/src/it/regression-multi.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following situation: I'm developing an address-application to store the details of our
i have the following situation. I am developing a MVC 3 asp.net application. I
Here's the situation: I'm developing a simple application with the following structure: FormMain (startup
I am in the following situation. I am using requireJs to loads module and
So I have the following situation; I want to send a couple of variables
I have the following situation. We want an reputation table to evaluate Users And
I have following situation: I have a Maven war project in NetBeans 6.7 I
I am developing an ASP.NET MVC 3 web application using Razor and C#. I
I am developing iPad application using phonegap (cordova 1.9.0). I need to get current
I have the following situation: using a classical Java server (using ServerSocket) I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.