Closed GoogleCodeExporter closed 9 years ago
Feel free to provide a patch with the required changes.
Original comment by py4fun@gmail.com
on 23 Nov 2010 at 1:55
This may be helpful:
http://stackoverflow.com/questions/4940379/using-snakeyaml-under-osgi
Original comment by py4fun@gmail.com
on 10 Feb 2011 at 11:12
I was able to deploy SnakeYAML under OSGi as a wrapped bundle with the attached
auto-generated (by Eclipse) MANIFEST.MF modified for your uses. Everything
worked the way I was expecting, save that I had to use the
CustomClassLoaderConstructor to workaround the way that OSGi loads classes.
This should probably be noted in documentation somewhere.
As a possible fix to that, you could use each individual class's classloader
for object creation. This seems to be a good solution, but would require extra
testing to ensure that nothing breaks, of course.
The attached MANIFEST just exports every package in JAR. This may not be what
you want to do. The general idea is to export only the minimum set of packages
required for operation. For example, you may want to remove
com.google.gdata.util.common.base since that appears to only be used internally.
Also Bundle-RequiredExecutionEnvironment should be changed to whatever the
minimum JVM you can run on is.
Let me know if you need/want more information about the attached MANIFEST, etc.
Original comment by thegreen...@gmail.com
on 11 Feb 2011 at 7:57
Attachments:
I introduced maven bundle plugin and the generated MANIFEST does not look good.
Can someone help to fix it ?
This is the change:
http://code.google.com/p/snakeyaml/source/diff?spec=svn0992be7861f4bb38abbc0bdce
3c151562d322ca3&r=0992be7861f4bb38abbc0bdce3c151562d322ca3&format=side&path=/pom
.xml
The list of packages is wrong:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven Bundle Plugin
Built-By: somov
Build-Jdk: 1.5.0_19
Bundle-License: LICENSE.txt
Import-Package: org.yaml.snakeyaml,org.yaml.snakeyaml.emitter,org.yaml
.snakeyaml.error,org.yaml.snakeyaml.events,org.yaml.snakeyaml.nodes,o
rg.yaml.snakeyaml.resolver
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bnd-LastModified: 1298455453051
Export-Package: org.yaml.snakeyaml.serializer;uses:="org.yaml.snakeyam
l.nodes,org.yaml.snakeyaml.events,org.yaml.snakeyaml.error,org.yaml.s
nakeyaml.emitter,org.yaml.snakeyaml.resolver,org.yaml.snakeyaml"
Bundle-Version: 1.9.0.SNAPSHOT
Bundle-Name: SnakeYAML
Bundle-Description: YAML 1.1 parser and emitter for Java
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.yaml.snakeyaml
Tool: Bnd-1.15.0
Original comment by py4fun@gmail.com
on 23 Feb 2011 at 9:49
This is the configuration for the bundle plugin:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.4</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>org.yaml.snakeyaml.*</Export-Package>
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
</instructions>
</configuration>
</plugin>
Original comment by py4fun@gmail.com
on 23 Feb 2011 at 2:19
It will be delivered in release 1.9
Original comment by py4fun@gmail.com
on 25 Feb 2011 at 4:16
Issue 123 has been merged into this issue.
Original comment by py4fun@gmail.com
on 28 Jun 2011 at 1:27
Original issue reported on code.google.com by
longkerd...@gmail.com
on 23 Nov 2010 at 1:48