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

Include OSGi bundle entries in jar manifests #5822

Closed
scabug opened this issue May 22, 2012 · 16 comments
Closed

Include OSGi bundle entries in jar manifests #5822

scabug opened this issue May 22, 2012 · 16 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented May 22, 2012

OSGi manifest entries should be added to the jars (such as scala-library) so they may be used as OSGi bundles.

The ScalaIDE project distributes an OSGi bundle, but it isn't ideal for all use cases. For example, it only appears to be available from p2 repositories, which makes it difficult to use in projects unrelated to Eclipse. It also contains all the scala jars, which adds significant footprint.

Assigning to Josh at his request.

@scabug
Copy link
Author

scabug commented May 22, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5822?orig=1
Reporter: Martin Ellis (martiell)
Affected Versions: 2.10.0-M3
Other Milestones: 2.10.0

@scabug
Copy link
Author

scabug commented May 22, 2012

@hseeberger said:
Is the Scala build already on sbt? Then we could just use sbtosgi to add the OSGi headers.

@scabug
Copy link
Author

scabug commented May 29, 2012

@jsuereth said:
No, the SBT build keeps getting broken. It's currently borked from some partest issues.

@scabug
Copy link
Author

scabug commented Jul 25, 2012

Michael Pilquist (mpilquist) said:
+1 for this making 2.10 final. I've used a number of bundle packagings for 2.7, 2.8, and 2.9. For 2.8 and 2.9, I used https://github.com/weiglewilczek/scala-lang-osgi. As of 2.9.2, I switched to the scala ide bundles, but as noted, those aren't in a public maven repository. Non-standard artifacts have led to problems with transitive dependencies and IDEs. First class support in 2.10 would be great.

@scabug
Copy link
Author

scabug commented Sep 4, 2012

Martin Ellis (mart) said:
Just a thought: If this is going to be difficult for 2.10, how about just adding OSGi headers to the scala-library jar to start with? (and possibly scala-reflect?)

That would be a huge help to folk who want to use Scala and OSGi (most of which won't need the compiler as a bundle). Of course, Scala IDE could continue to wrap jars until all of its dependencies are available as bundles.

I spent some time checking the bnd script and generated manifest for scala-library. But it's rather harder to check it for the compiler.

@scabug
Copy link
Author

scabug commented Sep 4, 2012

@jsuereth said:
At this point, just having scala-reflect not break OSGI is my goal. We just don't have the testing in place for me to be confident of any OSGi changes for 2.10.x, sorry. IF we had a good test suite of OSGi-ness, then I'd be all over it. Sorry....

@scabug
Copy link
Author

scabug commented Sep 4, 2012

Michael Pilquist (mpilquist) said:
Josh, do you think the 2.10 OSGi story will be at least as good as 2.9.2? That is, folks should be able to use the Scala IDE wrappers or wrap each individual JAR via bnd?

@scabug
Copy link
Author

scabug commented Sep 4, 2012

@jsuereth said:
Yes. I will consider any bugs that prevent OSGi usage as blockers. We just don't have the resources/test automation to verify our manifests would be usable by the world at this point. Soon I hope to remedy this with a few OSGi container tests we can run with the community build nightlies. However just getting that build to exit absorbed all my 2.10.x time.

In the meantime, refactoring reflect.jar so OSGi works is a blocked for 2.10.x

@scabug
Copy link
Author

scabug commented Sep 11, 2012

Raman Gupta (rocketraman) said:
Scala-compiler as an OSGi bundle is important to us to compile Scalate templates inside an OSGi environment. FYI for those looking for good maven accessible OSGi artifacts for 2.9.x, the ServiceMix bundles project wraps them and works well for both scala-compiler and scala-library -- they recently added 2.9.2 as well (untested by me so far, though I'd already built my own 2.9.2 bundles using their 2.9.1 recipe):

https://github.com/apache/servicemix4-bundles/tree/trunk/scala-compiler-2.9.2
https://github.com/apache/servicemix4-bundles/tree/trunk/scala-library-2.9.2

These servicemix artifacts are all available in maven public repos:

http://search.maven.org/#browse%7C-1557765333
http://search.maven.org/#browse%7C1545327545

@scabug
Copy link
Author

scabug commented Sep 18, 2012

@jsuereth said:
scala/scala#1344

@scabug scabug closed this as completed Sep 20, 2012
@scabug
Copy link
Author

scabug commented Nov 29, 2012

Martin Ellis (mart) said:
This ticket is closed as fixed, and appears in the 2.10.0-RC3 release notes, but:

$ curl -sO http://uk.maven.org/maven2/org/scala-lang/scala-library/2.10.0-RC3/scala-library-2.10.0-RC3.jar
$ jar xf scala-library-2.10.0-RC3.jar META-INF/MANIFEST.MF
$ cat META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_24-b24 (Sun Microsystems Inc.)

I haven't checked the other jars.

@scabug
Copy link
Author

scabug commented Nov 29, 2012

Raman Gupta (rocketraman) said (edited on Nov 29, 2012 7:14:34 PM UTC):
Martin, Josh can add more details if he wants, but FYI: I believe the OSGi headers are not part of the distributed build yet since the Scala team didn't feel comfortable including them, as they are relatively untested. You have to download the source and build the osgi jars yourself using "ant osgi.bundles".

@scabug
Copy link
Author

scabug commented Nov 29, 2012

Michael Pilquist (mpilquist) said:
2.10.0-RC2 JARs on Maven Central have OSGi metadata. The RC3 JARs on Maven Central do not. I've been successfully using scala-library and scala-reflect in Equinox 3.7.

@scabug
Copy link
Author

scabug commented Nov 30, 2012

@jsuereth said:
This is a regression in the distribution process!

@scabug
Copy link
Author

scabug commented Dec 6, 2012

Martin Ellis (mart) said:
Hi, Josh: should this be re-opened then?

I just looked at the commit log for the 2.10.x branch, and don't see a fix...

@scabug
Copy link
Author

scabug commented Dec 6, 2012

@jsuereth said:
No. It's fixed in the 2.10.0-whip bramch

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

No branches or pull requests

2 participants