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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:47:10+00:00 2026-06-03T13:47:10+00:00

When I am building a bundle, I need to embed a few jars (http-core

  • 0

When I am building a bundle, I need to embed a few jars (http-core and http-client) in my case. Using maven with flex plugin I get huge Import list – some of the stuff that I do not need. As of right now I am just negating the packages that I do not need in <Import-Package>, but I could also use Import-Package: resolution:=optional. I was wondering what is the preferred way and what are the advantages/disadvantages of either approaches?

  • 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-03T13:47:11+00:00Added an answer on June 3, 2026 at 1:47 pm

    Unfortunately people include a lot of “nice to have parts” (usually called utils) that cause these imports. Very often the culprits are separate of the core code that you want to use. If you use bndtools then you can easily inspect how the dependencies run.

    In bndtools and maven you use bnd, and bnd makes it very easy to only copy part of the JAR into your bundle. That way you can minimize the dependencies. Just use Private-Package to copy the packages you really need and then look at the imports. If you import something that you think you need, add it to Private-Package (in bndtools you can do this with drag and drop).

    At the end you can probably get rid of many unnecessary imports. However, there are usually some left. In that case decorate them with resolution:=optional in the Import-Package statement:

    Import-Package: com.oracle.whatever; resolution:=optional, *
    

    Don’t forget the * at the end.

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

Sidebar

Related Questions

I am used to building lists in android using adapters. If I need some
In the process of building a third party bundle for the Symfony2 framework I
building a site using PHP and MySQL that needs to store a lot of
I'm building a project with ant and during the build I'd like to bundle
I have a custom OS X NPAPI plugin built as universal 32 bit bundle.
I am building an OSGi application and need to create an Eclipse-like OSGi application
I have a Maven project that's building fine, and I'm attempting to add a
I'm building my application to run in an OSGi container. I use Maven and
I am building an ap in which I need to remove the present view
I'm building an iPad-Only application. I need to use a custom font with some

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.