mathewdenis / json-smart

Automatically exported from code.google.com/p/json-smart
0 stars 0 forks source link

OSGi-ify your jar so it can be loaded as a bundle #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
OSGi Bundles are jars with some extra meta-data in the manifest file.  This 
data is easily added with the apache felix bundle plugin.

To fix, make the following changes to your pom:

1. Change <packaging> to 'bundle' (it's now 'jar'). This will still generate a 
JAR file that works in other situations, but also includes metadata that OSGi 
needs.

2. Add this plugin to your build section:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>

That's it!  Easy. And all of us who use OSGi for our deployment engine will 
love you unreservedly, buy you a beer when we see you and think warmly you on a 
regular basis.

Original issue reported on code.google.com by m...@thebishops.org on 29 Feb 2012 at 8:54

GoogleCodeExporter commented 9 years ago
next released will be OSGified

Original comment by uriel.chemouni on 5 Mar 2012 at 1:42

GoogleCodeExporter commented 9 years ago

Original comment by uriel.chemouni on 5 Mar 2012 at 1:43

GoogleCodeExporter commented 9 years ago
Can you release this fix or is the project not active?

Original comment by kalle.st...@gmail.com on 15 May 2013 at 7:09

GoogleCodeExporter commented 9 years ago
I have tryed the change but the deployment failed.

If you want to submit a more detailed path, I will try again.

json-smart V2 is stil active (on git), but there is no major change.

Original comment by uriel.chemouni on 15 May 2013 at 8:34

GoogleCodeExporter commented 9 years ago
CAn you please describe what you mean by 'deployment failed'? I am happy to 
help sort it out.

Original comment by m...@thebishops.org on 15 May 2013 at 9:37

GoogleCodeExporter commented 9 years ago
Okey, let's try again :)

Original comment by uriel.chemouni on 15 May 2013 at 9:41

GoogleCodeExporter commented 9 years ago
Question 1:
Should I add this build param only in net.minidev:json-smart ?
I don't need to add it in parent.

Question 2:
which maven gold should I call to build the release ?

Original comment by uriel.chemouni on 15 May 2013 at 9:49

GoogleCodeExporter commented 9 years ago
If I can get the clone to work I will submit a pull request.

1. you only need to add this plugin to the main jar project. Be sure to set the 
<packaging> element to 'bundle'. The end result is still a jar, just with some 
extra information in the META-INF/MANIFEST.MF file in the jar.

2. You don't need to call a particular goal; bundling happens at the 'package' 
stage.

Original comment by m...@thebishops.org on 15 May 2013 at 10:01

GoogleCodeExporter commented 9 years ago
pushed on branch V1

tell me if it works

Original comment by uriel.chemouni on 15 May 2013 at 10:14

GoogleCodeExporter commented 9 years ago
Line7 of the pom.xml needs to read:

<packaging>bundle</packaging>

Original comment by m...@thebishops.org on 15 May 2013 at 10:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It's look to work.

Original comment by uriel.chemouni on 15 May 2013 at 10:26

GoogleCodeExporter commented 9 years ago
you can pull git V1

Original comment by uriel.chemouni on 15 May 2013 at 10:26

GoogleCodeExporter commented 9 years ago
Looks good to me. You can probably apply the same change to the 'mini' version 
too.

Original comment by m...@thebishops.org on 16 May 2013 at 2:44