sfinnie
sfinnie

Reputation: 9952

Update site built by Tycho still contains erroneous dependency after re-build

I have built an Eclipse update site with Tycho, but when trying to install a feature from it into target IDE fails.

The update site builds fine; I can see it from a target Eclipse installation and select the feature for installation. However, the dependency check fails at start of install as it can't find a declared dependency (org.eclipselabs.xtext.utils.unittesting). This shouldn't be a dependency: it was erroneously included in MANIFEST.MF for one of my eclipse plugin projects.

I removed the dependency from the manifest and run mvn clean install again. The build reported success, but when I try to use the newly built update site it still complains that the dependency to org.eclipselabs.xtext.utils.unittesting (a) exists and (b) can't be satisfied.

So the question is: What else do I need to do to remove the dependency from the generated update site?

Thanks for any pointers.

PS: I know I could add the site for o.e.x.u.unittesting in the target eclipse installation so it can satisfy the dependency. However I don't want to do that; it's not needed for the feature to work and I don't want other users to have to add an unnecessary dependency.

Upvotes: 2

Views: 1649

Answers (2)

Tai Le
Tai Le

Reputation: 102

Maybe I'm late to the game, but I still want to share my experience.

I'm using p2-maven-plugin to convert normal jar file to osgi bundle. It caches the converted jars in

~/.m2/repository/p2/osgi/bundle

Unless I change the version of my jar, p2 plugin always load the old bundle from that location.

Delete the old bundle in that folder and rebuilt projects again solve my problem.

Upvotes: 0

oberlies
oberlies

Reputation: 11723

Here is a list of cache locations that may have been involved in your scenario, and how to clear them

  • Target folder: If the target folder contain results from a previous build, this data may be used by a Maven build to speed up the build. Tycho doesn't make use of this feature, and AFAIK it shouldn't pick up anything existing from the target folder.

    To be sure, always include the clean goal in your mvn calls.

  • Local Maven repository: In order to support builds of parts of a reactor, Tycho adds artifacts that have been built locally with mvn clean install to the target platform. If you are not aware of this feature, this can have various strange effects.

    To avoid this, don't build with install unless you have to. Use mvn clean verify instead. Also: Deleting the file ~/.m2/repository/.meta/p2-local-metadata.properties resets what Tycho considers to be "locally installed".

    Since Tycho 0.16.0, you can also disable this behaviour for one build through the command line switch -Dtycho.localArtifacts=ignore or for all builds by setting the same property in the settings.xml.

  • p2: The p2 update manager in Eclipse caches p2 repositories it has used since the start of Eclipse.

    To force p2 to reload a repository, go to Preferences > Install/Update > Available Software Sites, select a repository and hit Reload. The repositories will also be reloaded if you re-start Eclipse.

Upvotes: 7

Related Questions