Bug 550833 - Bundle-ClassPath: external with System Property does not evaluate correctly
Summary: Bundle-ClassPath: external with System Property does not evaluate correctly
Status: REOPENED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-06 05:15 EDT by Philipp M. Fischer CLA
Modified: 2021-04-28 16:51 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp M. Fischer CLA 2019-09-06 05:15:47 EDT
We are running into an issue where the Plugin classpath does not get correctly evaluated.

In our build environment we set a variable pointing to a JAR that should be added to the classpath of the plugin. E.g.:

Bundle-ClassPath: external:$VS_JAR_VTK$,
 .

Unfortunately this does not compile under tycho. Tycho seems to not resolve the environment variable. The tycho compiler complains that it cannot resolve the imports to vtk in included java files.

Using an absolute path instead works fine:

Bundle-ClassPath: external:/usr/share/java/vtk6.jar,
 .


A work around to use the environment variables in the product is to also include a mok JAR into the plugin. This jar won't get bundled. Both the internal and the external are then stated in the MANIFEST.MF. E.g.:

Bundle-ClassPath: native_lib/zmq/zmq.jar,
 external:$VS_JAR_ZMQ$,
 .

My opinion is, that the environment variable should be evaluated during compile.


Further details to the plugin can be found here:
https://github.com/virtualsatellite/VirtualSatellite4-Core/tree/development/de.dlr.sc.virsat.external.lib.vtk.linux.x86_64

This topic is probably realted to the discussion of #370958
Comment 1 Jan Sievers CLA 2019-09-09 04:22:57 EDT

*** This bug has been marked as a duplicate of bug 370958 ***
Comment 2 Philipp M. Fischer CLA 2019-09-09 05:28:54 EDT
Hi Jan,

I don't agree to marking it as duplicate. 

This ticket is about environment variables encoded into the "external:..." statement.

The other ticket was about consuming the statement at all. In current Tycho 1.4.0 consuming is not a problem in general.

What do you think?

Cheers

Phil
Comment 3 Mickael Istria CLA 2021-04-08 18:09:55 EDT
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse/tycho/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.