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

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

Closed
GoogleCodeExporter opened this issue Sep 10, 2015 · 15 comments
Closed

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

GoogleCodeExporter opened this issue Sep 10, 2015 · 15 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

next released will be OSGified

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

  • Changed state: Fixed
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Okey, let's try again :)

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

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

pushed on branch V1

tell me if it works

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

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

It's look to work.

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

@GoogleCodeExporter
Copy link
Author

you can pull git V1

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

@GoogleCodeExporter
Copy link
Author

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

@GoogleCodeExporter
Copy link
Author

Original comment by uriel.chemouni on 20 Aug 2015 at 7:16

  • Changed state: Fixed

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

1 participant