Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362735 - Optional transitive dependencies aren't ignored.
Summary: Optional transitive dependencies aren't ignored.
Status: RESOLVED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-02 18:38 EDT by Dick Fardos CLA
Modified: 2021-04-28 16:54 EDT (History)
2 users (show)

See Also:


Attachments
This tarball contains my sample project. (3.14 KB, application/x-compressed-tar)
2011-11-02 18:41 EDT, Dick Fardos CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dick Fardos CLA 2011-11-02 18:38:58 EDT
Build Identifier: Indigo

I have an eclipse plugin that I'm building that has a dependency on another osgi jar.  That osgi jar has transitive optional dependencies that aren't osgi jars and probably aren't even in maven.   There is no way for me to tell tycho to ignore those optional transitive dependencies.

Reproducible: Always

Steps to Reproduce:
1. cd build01 
2. mvn install 
   This builds the jar and the wrapper jar
3. cd build02
4. mvn install
this fails.
Comment 1 Dick Fardos CLA 2011-11-02 18:41:18 EDT
Created attachment 206375 [details]
This tarball contains my sample project.

This tarball contains 2 separate maven builds

build01 contains 2 maven projects
   content -- builds a regular jar that has external dependencies.
   wrapper -- builds an osgi wrapper jar of the content jar.  This osgi jar
              has optional dependencies listed in the Import-Package manifest                    entry.

build02 contains 1 simple eclipse plugin that has a dependency on the wrapper osgi jar.

Tycho fails to build build02
Comment 2 Igor Fedorenko CLA 2011-11-06 22:47:11 EST
The problem is specific to optional dependencies referenced when using pomDependencies=consider mode. Although this is a bug, there is no immediate plans to address it... unless, of course, somebody contributes a quality patch.
Comment 3 Tobias Oberlies CLA 2013-10-21 09:29:17 EDT
Sorry for the late reply. This is not a bug in Tycho, but a problem in the project setup. (Thanks for the good example project!)

When generating the manifest, you are adding an _attribute_ "resolution" with value "optional". What you wanted to specify is the "resolution" _directive_. The syntax for this in an OSGi manifest header is resolution:=optional (note the colon).

Example: Import-Package: mandatory.package,optional.package;resolution:=optional