-
Notifications
You must be signed in to change notification settings - Fork 29
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
Optional dependencies #19
Comments
Gradle does not support optional dependencies in its dependency management, so that information is lost. Workaround is easy if you know the bundle where you want to make the dependency optional and the respective package names. You can configure the bundle to use optional package imports, similar to the first example here. |
Thanks for the quick reply. I tried that, but it's not working, so I must do something wrong. Here is my script:
And here is the generated manifest:
|
Strange, the configuration looks alright. Does it make a difference if you use |
Hmmm, no, it doesn't. I also tried this as a cross check:
It doesn't have any effect either. |
Just copied your
So everything seems to work fine. Maybe an issue with the Gradle version? I just used Gradle 2.4, after that I tried it with Gradle 3.1, with the same result. |
Strange though that the hash is different than yours - this would hint at a different configuration. Did you maybe look into an old Jar? |
I deleted ~/.groovy, ~/.gradle, killed all daemons etc., and now it works as expected, both with Gradle 2.9 that I used in the first place, and 3.1. So I guess something was wrong with my environment. Strangely enough, I had the same symptoms on my Mac and on a Windows PC. I fixed it on my Mac, I will check on Windows on monday. During the many trials and errors, I also had an error message during the Eclipse download like the one in this bug report: Feel free to close the issue. Thanks again for your help. |
Hi,
I create a bundle from commons-logging:
dependencies { platform 'commons-logging:commons-logging:1.1.1' }
It has an optional dependency to Avalon:
<dependency> <groupId>avalon-framework</groupId> <artifactId>avalon-framework</artifactId> <version>4.1.3</version> <optional>true</optional> </dependency>
It looks like bnd-platform makes a hard dependency at out it:
Import-Package: javax.servlet,org.apache.avalon.framework.logger,org.apa che.log,org.apache.log4j
Is that expected? In other words, do pnd-platform support optional dependencies automatically?
If not, is there a workaround? I tried various things, like using override and importIgnorePackages, but nothing worked unfortunately.
The text was updated successfully, but these errors were encountered: