Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDE: Product Start sometimes triggers unwanted manifest changes #1403

Open
mikerumpf opened this issue Sep 10, 2024 · 8 comments
Open

PDE: Product Start sometimes triggers unwanted manifest changes #1403

mikerumpf opened this issue Sep 10, 2024 · 8 comments

Comments

@mikerumpf
Copy link

I encountered a weird effect: I have a bundle which uses spotbugs-annotations (or a similar optional dependency) via additional.bundles in the build.properties.

When I launch the eclipse product, in which the bundle is included, the manifest of the bundle is changed and the spotbugs dependency is added automatically as non-optional package import.

This behavior can only be stopped with an eclipse restart.

I have a suspicion that this is somehow related to some cleanup manifests actions I did previously.
(Tested with Eclipse 6/24)

@laeubi
Copy link
Contributor

laeubi commented Sep 10, 2024

This is actually not unexpected/unwanted but exactly what additional.bundles does.

Even though many people miss use that feature, it is made and described in the help as a way to add arbitrary bundles to the class-path that then are automatically added to the manifest on run (either as require bundle or import package) once you use a class from them.

There are alternatives but it depends on the use-case and some are not functional anymore, I planned to work on them but haven't had time recently to finish the work.

@mikerumpf
Copy link
Author

Hmm, if that was the expected behavior, this feature doesn't seem to work consistently... As I wrote: after a eclipse restart the additional bundles are not added automatically to the manifest....

My usecase are optional dependencies like spotbugs or test dependencies which I don't want to see in the final manifest. Is there a better way to accomplish this?

@mikerumpf
Copy link
Author

mikerumpf commented Sep 10, 2024

Also I think it is really not okay, if a product launch has side effects to files I have under version control. If I wanted that I could directly add the dependencies to the manifest myself.

@laeubi
Copy link
Contributor

laeubi commented Sep 10, 2024

There is a feature but is is currently broken:

then there are some efforts here:

build.properties also support jars.extra.classpath see here

as mentioned there is much room for improvements.

@mikerumpf
Copy link
Author

Sorry, I have to ask again, but you stated the manifest being changed with the product start would be expected behaviour. Isn't this contradicting the manifest editor?

grafik

@laeubi
Copy link
Contributor

laeubi commented Sep 10, 2024

You need to read further down ;-)

grafik

See also https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Feditors%2Fmanifest_editor%2Feditor.htm

As you add them to the build.properties, you are not adding them to the MANIFEST.MF (this happens automatically), so the fist sentence is not really wrong.

@mikerumpf
Copy link
Author

Ok, got it. Thank you for explaining. Manually clicking on "add dependency" seems fine. But still, I think it is pretty weird that a product launch occasionally will trigger this feature automatically.

@laeubi
Copy link
Contributor

laeubi commented Sep 14, 2024

I have now created

beside that yes the feature is confusing and is better not used at all but currently is kept for legacy reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants