You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Niels B Nielsen <ni...@jpmorgan.com> on 2009/09/03 17:33:05 UTC

bundle plugin - Transitive dependencies and Import-Package

Hi,

I have a project where I need to bundle a dependency in. Actually, my dependency is an umbrella project for like 20 transitive dependencies. Now, this is being produced in an imperfect world, so there is too many things inside the jar, however, I need approximately 10 jars at my runtime. Unfortunately, I cannot get the bundle I need without having to manually edit the MANIFEST, as the Import-Package is wrong.

I have tried multiple solutions, so, please also help me identify which is the viable path.

The most "pure" solution I could see is just having this specification:
<dependency>
  <artifact>umbrella</artifact>
  <excludes>jars-doing-stuff-I-don't-need</excludes>
</dependency>
...
<instructions>
  <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
 <Embed-Transitive>true</Embed-Transitive>
 <_exportcontents>*my_regex*</_exportcontents>
</instructions>

Result:
Gives me 1 jar with the right jars inside and the correct Export-Package (Have read the FAQ on duplication)
However, it seems to have scanned all class files and contains Import-Package for all the other jars.

Another important sidenote is, that some of the classes have hidden dependencies (bad pom somewhere), and these are included in the Import-Package as well.

I have tried to specify a <Import-Package></Import-Package>, but it just breaks my build with unresolved dependendies..

Any suggestions?

Regards,
/Niels



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  

RE: bundle plugin - Transitive dependencies and Import-Package

Posted by Niels B Nielsen <ni...@jpmorgan.com>.
To answer my own question.

It appears that adding 

<Import-Package>*;resolution:=optional</Import-Package>

Gave me most of it anyway, however, I still have too many packages (from unused classes) that gets specified in the header.

Regards,
/Niels



-----Original Message-----
From: Niels B Nielsen 
Sent: 03 September 2009 16:33
To: users@felix.apache.org
Subject: bundle plugin - Transitive dependencies and Import-Package

Hi,

I have a project where I need to bundle a dependency in. Actually, my dependency is an umbrella project for like 20 transitive dependencies. Now, this is being produced in an imperfect world, so there is too many things inside the jar, however, I need approximately 10 jars at my runtime. Unfortunately, I cannot get the bundle I need without having to manually edit the MANIFEST, as the Import-Package is wrong.

I have tried multiple solutions, so, please also help me identify which is the viable path.

The most "pure" solution I could see is just having this specification:
<dependency>
  <artifact>umbrella</artifact>
  <excludes>jars-doing-stuff-I-don't-need</excludes>
</dependency>
...
<instructions>
  <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
 <Embed-Transitive>true</Embed-Transitive>
 <_exportcontents>*my_regex*</_exportcontents>
</instructions>

Result:
Gives me 1 jar with the right jars inside and the correct Export-Package (Have read the FAQ on duplication)
However, it seems to have scanned all class files and contains Import-Package for all the other jars.

Another important sidenote is, that some of the classes have hidden dependencies (bad pom somewhere), and these are included in the Import-Package as well.

I have tried to specify a <Import-Package></Import-Package>, but it just breaks my build with unresolved dependendies..

Any suggestions?

Regards,
/Niels



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org