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 6588249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:01:28+00:00 2026-05-25T17:01:28+00:00

I have an OSGi bundle that was built using Maven by another team. The

  • 0

I have an OSGi bundle that was built using Maven by another team. The POM file declares its packaging as “bundle” and uses the Apache Felix plugin.

I need to deploy this artifact to a local Maven repository (Nexus) so that it can be used by our internal projects.

I have used the deploy:deploy-file target to deploy the bundle to the repository, just as you would with a standard JAR file and this works without error. I extracted the embedded POM from the bundle and passed that on the command line, so the command line was:

mvn deploy:deploy-file -Dfile=3rdpartybundle.jar -DpomFile=pom.xml -DrepositoryId=internal -Durl=http://internalserver/nexus

The issue is that when I deploy it like this, the packaging is set to bundle and as a result the name of the artifact in the repository ends up with a .bundle extension, instead of a .jar extension.

Now, we cannot figure out how to declare it as a dependency. If we declare it like this:

        <dependency>
            <groupId>...</groupId>
            <artifactId>...</artifactId>
            <version>...</version>
            <type>bundle</type>
        </dependency>

We get an error stating that the dependency cannot be resolved. The interesting thing is that the GAV coordinates in the error message actually has “jar” as the value for the type of the dependency even though we set it as “bundle”.

If we change the dependency to:

        <dependency>
            <groupId>...</groupId>
            <artifactId>...</artifactId>
            <version>...</version>
            <type>jar</type>
        </dependency>

We get the exact same unresolved dependency error.

So how are you supposed to deploy an artifact packaged as a bundle to a Maven repository, so that it can be used as a compile time dependency for another project?

Thanks

  • 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-05-25T17:01:29+00:00Added an answer on May 25, 2026 at 5:01 pm

    Thanks for the answers, I think I have a workaround (I wouldn’t call it a solution though).

    @earcar is on the right track, although that solution doesn’t leverage all of the information available in the pom.xml that is available in the 3rd party bundle already (particularly the dependencies).

    So what seems to work, even though the documentation for the deploy:deploy-file is a little vague, is that you can pass a pom.xml file AND also set the packaging parameter at the same time. So my command line now looks like this:

    mvn deploy:deploy-file -Dfile=3rdpartybundle.jar -DpomFile=pom.xml -DrepositoryId=internal -Durl=http://internalserver/nexus -Dpackaging=jar
    

    Doing it this way, the pom.xml in the repository still says that the packaging is of type “bundle”, and includes all of the dependencies etc., but the artifact itself has a .jar file extension.

    Then when we declare our dependency as type JAR, Maven is able to resolve it successfully:

        <dependency>
            <groupId>...</groupId>
            <artifactId>...</artifactId>
            <version>...</version>
            <type>jar</type>
        </dependency>
    

    This basically solves our problem. I am not sure how portable or reliable this is though. FWIW, we are running Maven 3.0.3

    Thanks for the help.

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

Sidebar

Related Questions

I have a WAR file that was built using grails framework and OSGi plugin.
I'm using netbeans, project: 'maven OSGI bundle', i have bundle activator running fine in
I have one bundle using the following configuration in pom.xml: <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.1.0</version>
I have a 3rd party JAR that I have converted to an OSGI bundle
Using Apache Felix, I have an OSGi component I've authored that wraps some middleware
I am using the aQute Bnd toolset to create an OSGi bundle and have
I have an OSGi bundle that can also run in plain Java process. I
I have a server application that consists of multiple OSGi bundles, some mine, some
I have a project that I am trying to convert to OSGi. However, this
Have just started using Visual Studio Professional's built-in unit testing features, which as I

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.