Bug 488944 - tycho-compiler-plugin: allow adding extraClasspathElements in front of existing classpath
Summary: tycho-compiler-plugin: allow adding extraClasspathElements in front of existi...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-03 09:11 EST by Frank Schwarz CLA
Modified: 2021-04-28 16:52 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 Frank Schwarz CLA 2016-03-03 09:11:38 EST
Please allow adding "extraClasspathElements" at the beginning of the BundleProject's classpath within the tycho-compiler-plugin.

Currently the "extraClasspathElements" are added at the end of the classpath:

https://github.com/eclipse/tycho/blob/master/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java#L653

Kindly seeking to support this use-case:

I have two bundles "basemodel" and "productmodel". Both bundles shall be treated with EclipseLink's static-weaving processor to alter the contained JPA model classes. When weaving the "basemodel" classes, EclipseLink will insert some abstract methods into abstract entity classes.

Next, when compiling "productmodel" against "basemodel", the compilation will fail as derived classes do not yet implement the additional methods introduced by the EclipseLink weaver. (This would only happen next when weaving this bundle, too).

The idea is to compile against the unaltered classes of "basemodel":

<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>tycho-compiler-plugin</artifactId>
  <configuration>
    <extraClasspathElements>
      <dependency>
        <groupId>com.acme</groupId>
        <artifactId>basemodel</artifactId>
        <version>${project.version}</version>
        <type>jar</type>
        <classifier>pristine</classifier>
      </dependency>
    </extraClasspathElements>
  </configuration>
</plugin>

Unfortunately, this does not work as the extraClasspathElements are added at the end of the existing classpath. I would rather need a mechanism to "shadow" the bundle-project's real classpath.
Comment 1 Mickael Istria CLA 2021-04-08 18:07:45 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.