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

Bundling behavior change between 0.5 and 0.6 #10

Open
markehammons opened this issue Nov 7, 2013 · 2 comments
Open

Bundling behavior change between 0.5 and 0.6 #10

markehammons opened this issue Nov 7, 2013 · 2 comments

Comments

@markehammons
Copy link

So, I upgraded to sbt 0.13 and sbt-osgi 0.6 on my project the other day only to discover that my project code now outputs stuff I didn't expect.

In my project, I take a bunch of project dependencies like scalatra and ice.tar, and convert them into bundles. Sometimes these dependencies have files and other non-class content embedded in them that must be copied to the resulting bundle, like with the bundle my project makes of the scala libs + akka. It used to be I could get these files with the privatePackage setting. For example, in my scala+akka bundle, I made the project depend on scala and akka, and set private packages to "*". This would pull in all the class files that were not exported, but also files like reference.conf in the root of the akka-actors jar, which is necessary for akka to work without a configuration file.

In sbt 0.6, privatePackage now only packages classes found on the classpath, not files. This is entirely an issue with aQute.bndlib being upgraded. I have a fork of this project here that downgrades aQute.bndlib and makes some minor changes to the plugin, and the behavior my project was relying on has returned. Looking at the bndlib documentation, it looks like include_resource is needed to do what I was doing, but there's no such key in sbt-osgi, and I'm not sure how exactly to do what I was doing before (package files found in the classpath into the resulting bundle).

Any idea how to fix this for the new version of bndlib and sbt-osgi?

@reggert
Copy link
Contributor

reggert commented Nov 18, 2013

sbt-osgi populates the -includeresource setting (in 0.7.0) or Include-Resource setting (in 0.6.0) using the "resource" directories configured in SBT, which includes src/main/resources and target/scala-#.#/sbt-0.#/resource_managed/main by default. Documentation on how to configure additional resource locations can be found here: http://www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Classpaths.html

@markehammons
Copy link
Author

Sorry, I've been doing other things for a couple of months. So, my problem now is to get resources that come from certain jars into managedResources without unpacking said jars. Any ideas on how to do that?

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