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

Use maven-bundle-plugin to export a bundle. #3

Merged
merged 4 commits into from Sep 13, 2019

Conversation

JonathanLennox
Copy link
Member

For the sake of OGSi, as used in Jitsi Desktop.

pom.xml Outdated Show resolved Hide resolved
@ibauersachs
Copy link
Member

Apart from the plugin-version this seems okay, but I'll try to have a look at the created jar later.

@ibauersachs
Copy link
Member

Few things:

  • I would add the following instruction to the bundle plugin. It removes hassle.

    <_removeheaders>Bnd-*, Tool, Require-Capability</_removeheaders>

  • Why is a shaded jar built? It includes BouncyCastle, which removes its signature and will probably not work anyway. And lots of other crap, like IntelliJ annotations. It just doesn't make sense for a library.

  • The srtpKdf256Test test fails for me on Windows (but my JDK is rather old, 1.8.0_144)

@JonathanLennox
Copy link
Member Author

I believe I'm just using whatever the maven defaults are. If they're wrong, let me know. (By shaded jar do you mean the "jar-with-dependencies" jar file that's generated? I don't think we use it, so yeah, if there's a way to avoid generating it that's not a bad idea.)

srtpKdf256 works for me with 1.8.0_221 on Mac. Can you tell me which provider it says it's using?

@JonathanLennox
Copy link
Member Author

@ibauersachs: I added the _removeheaders; I got a separate PR to remove the maven-assembly-plugin use (#7).

Copy link
Member

@ibauersachs ibauersachs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests run fine now with an updated JDK.

pom.xml Outdated
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>org.jitsi.srtp</Export-Package>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is new or if I didn't see it before, but: it won't work as long as there are protected fields (and maybe other things) referencing stuff from the crypto package.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I need to add the org.jitsi.srtp.crypto to the export-package directive?

org.jitsi.srtp.utils contains only static methods - do I need to add that as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omit the entire directive and the plugin should figure it out.

In general, it doesn't matter if methods are static or not. Everything that needs to be accessible by consumers (i.e. bundles that consume this bundle) must be exported.
In this case, the stuff in .crypto must be exported because classes that derive from )(Base)Srt(c)pCryptoContext need to know the types of the protected fields. If Java had a notion of "package protected" or "internal protected" (like C#) this wouldn't be necessary.

Let the plugin's defaults do the right thing.
@JonathanLennox JonathanLennox merged commit cdf3d3b into jitsi:master Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants