GithubHelp home page GithubHelp logo

Add OSGi manifest headers about byte-buddy HOT 20 CLOSED

raphw avatar raphw commented on July 19, 2024
Add OSGi manifest headers

from byte-buddy.

Comments (20)

raphw avatar raphw commented on July 19, 2024

Agree, Byte Buddy v0.3 is released in 2-3 weeks and I'll integrate OSGI with this new version. Is this early enough for your needs?

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

I do not have a lot of OSGI experience and I cannot use the maven-bundle-plugin as it does not play nicely with the maven-shade-plugin. I had to put the OSGI entries into the manifest using the shade plugin. Could you do me a favor and run:

git clone https://github.com/raphw/byte-buddy.git
cd byte-buddy
mvn install -Pextras

and check if this looks okay? Thanks!

from byte-buddy.

mattbishop avatar mattbishop commented on July 19, 2024

So I gave this a go but it won't build due to javadoc errors. What version of the JDK does one need? I am using 1.7u60.

[ERROR] javadoc: warning - Class OutputTimeUnit not found.
[ERROR] /Users/mbishop/Sides/byte-buddy/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/DynamicType.java:180: warning - Tag @link: reference not found: org.objectweb.asm.ClassVisitor
[ERROR] /Users/mbishop/Sides/byte-buddy/byte-buddy-dep/src/main/java/net/bytebuddy/asm/ClassVisitorWrapper.java:14: warning - Tag @link: reference not found: org.objectweb.asm.ClassVisitor
[ERROR] /Users/mbishop/Sides/byte-buddy/byte-buddy-dep/src/main/java/net/bytebuddy/instrumentation/attribute/FieldAttributeAppender.java:15: warning - Tag @link: reference not found: org.objectweb.asm.FieldVisitor
[ERROR] /Users/mbishop/Sides/byte-buddy/byte-buddy-dep/src/main/java/net/bytebuddy/instrumentation/attribute/MethodAttributeAppender.java:16: warning - Tag @link: reference not found: org.objectweb.asm.MethodVisitor

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

I tried to recreate this problem, but I cannot find out what goes wrong when you build. I doubt that it is related to the JDK but rather to your system context. Are you using MacOS? This is the only OS I never built on. I wonder if Apple has something customary to its JDK. I currently build Byte Buddy on Windows and on Linux with JDKs 1.6, 1.7 and 1.8, this is part of the Travis CI integration. I also built it on various machines and it never caused trouble.

I wonder if this could be related to your Maven version? I also wonder why it is complaining about OutputTimeUnit what is a JMH class which is clearly available with the configured version and which is never referenced in the javadoc anywhere. Alltogether, it should not even create a javadoc when you do not add the -Pextras profile.

But for the time being, try this prebuilt jar: https://www.dropbox.com/s/lahrljtd1we46o5/byte-buddy-0.3-SNAPSHOT.jar?dl=0

Thanks!

from byte-buddy.

mattbishop avatar mattbishop commented on July 19, 2024

I am on Mac and that's usually not a problem.

Maven maybe? I am using 3.2.1.

from byte-buddy.

mattbishop avatar mattbishop commented on July 19, 2024

I tried it again with forced updates and now the build is fine. Probably a bad download yesterday.

One interesting thing about 'mvn clean' is that it wants a GPG passphrase? To clean?

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

That's a relief, I want the build to be clean. Never encountered the GPG thing, it should only pop up when you use the extras profile but I will investigate. Did you verify the OSGI compatibility? I am on vacation next week but I'll release a new version right after, I miss some test cases and some documentation and then its good to go.

from byte-buddy.

mattbishop avatar mattbishop commented on July 19, 2024

So I can't check the OSGi output because I have to run the extras profile to generate the manifest.

Nonetheless, I think your entries won't be right. I will take some time in the next few weeks to create a pull request for this issue. I cannot commit to a time so go ahead with your release. No doubt another release will come along, it always does. ;)

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

Sure thing, but have you tried the version I uploaded?

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

Fixed in version 0.3.

from byte-buddy.

 avatar commented on July 19, 2024

Hi,

We are unable to use bytebuddy for OSGi environments. Are you sure that Export-Package definition is correct?

Export-Package: !net.bytebuddy.jar.asm.*,net.bytebuddy.*

Related issue and comment:
https://github.com/ui4j/ui4j/issues/28#issuecomment-106741600

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

Not entirely sure. To be honest, I do not use OSGi, I only googled my way. I am going to have a look at it.

from byte-buddy.

CodingFabian avatar CodingFabian commented on July 19, 2024

I guys, i will fix this, but I want to get the requirements straigt.
Right now only byte-buddy-agent produces valid osgi headers, however I assume this is not even included as bundle, because its a javaagent. This is not even a valid bundle (because it doesnt provide services) so I propose to remove it.
byte-buddy-dep and byte-buddy both do not produce osgi headers.

Could you please clarify which Classes you actually want to use form which jar?

from byte-buddy.

CodingFabian avatar CodingFabian commented on July 19, 2024

Update, i am building the 0.7 snapshot and the osgi headers are valid. i am able to load the bundle in karaf:
karaf@root()> bundle:install mvn:net.bytebuddy/byte-buddy/0.7-SNAPSHOT
Bundle ID: 53
53 | Active | 80 | 0.7-SNAPSHOT | Byte Buddy (without dependencies)
karaf@root()> bundle:info 53

Byte Buddy (without dependencies) (53)

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

The current version or your build?

from byte-buddy.

CodingFabian avatar CodingFabian commented on July 19, 2024

without my changes. It works, but as sent to you via skype, a really correct header is pretty long, due to the amount of packages and tangling you have there

from byte-buddy.

CodingFabian avatar CodingFabian commented on July 19, 2024

Here are the new manifest files my upcoming PR will produce. Would these work for you?
https://gist.github.com/CodingFabian/35f727056830156b2756

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

Version 0.6.7 should have correct OSGi headers. Thanks @CodingFabian for fixing this!

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

On second look, it seems like the shaded POM is not longer overriding the original POM. The dependency remains declared...

from byte-buddy.

raphw avatar raphw commented on July 19, 2024

Okay, I had to tweak the build a bit. The shade plugin does not play nice with the bundle plugin. I had to list the exports explicitly. It works with version 0.6.8.

from byte-buddy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.