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

[feature request] Support packaging as an OSGi bundle #15

Closed
Andrew-Cottrell opened this issue Apr 2, 2019 · 10 comments
Closed

[feature request] Support packaging as an OSGi bundle #15

Andrew-Cottrell opened this issue Apr 2, 2019 · 10 comments
Labels
enhancement New feature or request
Milestone

Comments

@Andrew-Cottrell
Copy link

I suspect the following would need to be changed/added in the POM

<project>
	<packaging>bundle</packaging>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>4.1.0</version>
				<extensions>true</extensions>
			</plugin>
		</plugins>
	</build>
</project>
@patrickfav patrickfav added the enhancement New feature or request label Apr 4, 2019
@patrickfav
Copy link
Owner

patrickfav commented Apr 4, 2019

Hi,

As I do not use OSGi I'm not fully comfortable maintaining it. How does this work? Does it create a new OSGi compatible jar? Is it the same jar? Is there no easy way to wrap jars to make them OSGi compatible (outside of this project)?

@Andrew-Cottrell
Copy link
Author

Andrew-Cottrell commented Apr 11, 2019

Hi patrickfav

Yes, it creates an OSGi compatible jar and it's the same jar. The jar should be exactly the same as before, other than additions to META-INF/MANIFEST.MF. It is easy to wrap jars; however, this makes them much harder to use: can't simply add the dependency to a project's pom.xml.

FYI, another BCrypt implementation does this
svenkubiak/jBCrypt@89da34b
https://github.com/svenkubiak/jBCrypt/blob/0.4.1/pom.xml
https://mvnrepository.com/artifact/de.svenkubiak/jBCrypt/0.4.1

@patrickfav
Copy link
Owner

Alright, let me look into this, if the change is transparent for anybody that does not use OSGi then thats fine for me.

@patrickfav patrickfav added this to the v0.8.0 milestone Apr 11, 2019
@Andrew-Cottrell
Copy link
Author

Yes, the change should be transparent for non-OSGi uses. Thanks for looking in to this.

patrickfav added a commit that referenced this issue Apr 12, 2019
@patrickfav
Copy link
Owner

Hi,

I've pushed the changes to this feature branch: https://github.com/patrickfav/bcrypt/tree/feat-15-osgi

Could you please checkout, in the root directory run

./mvnw clean install

to install the snapshot version into your local repo and change your dependency to

    <dependency>
        <groupId>at.favre.lib</groupId>
        <artifactId>bcrypt</artifactId>
        <version>0.8.0-SNAPSHOT</version>
    </dependency>

and give me feedback if that works? I have no osgi project to test it on (and to be frank never used it before) :)

Cheers!

@Andrew-Cottrell
Copy link
Author

Hi

Looks like at.favre.lib:bcrypt is perfect. I was able to build and install the bcrypt-feat-15-osgi modules using Maven, and then to deploy and depend upon the bcrypt module as an OSGi bundle.

Import-Package: at.favre.lib.crypto.bcrypt;version="[0.8.0,0.9.0)"

But it's only partly working as there is a dependency on at.favre.lib:bytes, which is not currently OSGi compatible. Without at.favre.lib:bytes also being an OSGi bundle it doesn't work at runtime.

Cheers!

@Andrew-Cottrell
Copy link
Author

(sorry, didn't mean to close)

@patrickfav
Copy link
Owner

Hi, I've released a new bytes version with also OSGi support. For now the support is added, but I can't guarantee it for the lifetime of this project as the requirement that every transitive dependency must ALSO be OSGi compatible makes it quite restricting.

I'm soon releasing 0.8.0 - please leave me a line to tell me if the lib now works with your project.

@patrickfav
Copy link
Owner

Released.

@Andrew-Cottrell
Copy link
Author

BCrypt 0.8.0 (and Bytes 1.1.0) works great with my projects. Thanks for adding OSGi support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants