-
-
Notifications
You must be signed in to change notification settings - Fork 783
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
Cannot build byte-buddy .jar , only byte-budy-deps.jar #17
Comments
Building additional artifacts takes a lot of time, therefore you need to build Byte Buddy with the extras profile to build the repackaged artifact. On ByteBuddy.net, you can find a developers page with some infos on that. Run: mvn package -Pextras There is also info in the root pom. |
Success ! Thanks ! First Suggestion: ( I'm happy to add this and send a pull request) My suggestion - assume the reader doesn't know what you know at a fundamental level, Without your hint I would never have figured it out, and not for lack of trying ( I spent several hours researching the issue and came up blank ... including reading all the pom files, review a good portion of the source and every kind of web search I could think of). There were no errors, the jar was built, the docs made it clear that using the non -deps was highly encouraged, every thing I could think of did nothing or appeared to work ... except - no classes in the jar file. Its difficult to keep in mind, but regardless of popularity at any point, and especially with things like build tools which take vast efforts to learn and become proficient, and come and go so quickly over time - what seems like 'common knowledge' can often be the exact opposite. Ironically, the entire purpose of build tools is to solve that problem ... but in the process of simplification and abstraction the end result is you need to become an expert in that particular tool in order to understand how to achieve the obvious :) So a new tool comes out that tries to solve the problems of the previous one, So just a suggestion ... Just 1 or 2 lines more in the docs can be the difference between someone being able to get it to work or giving up. Writing all this not to complain but to remind myself as much as anyone ... the more you learn the harder it is to remember what you didn't know before. Its the blind spot of knowledge :) [INFO] ------------------------------------------------------------------------ E:\Work\DEI\github\byte-buddy\byte-buddy\target>ls -l *.jar E:\Work\DEI\github\byte-buddy\byte-buddy\target>jar t < byte-buddy-0.6-SNAPSHOT.jar | tai |
Thanks! I am really glad that you like Byte Buddy. I am happy that all the time spent pays off. I am more than happy to merge the suggested addition. If you stumpled upon it, others will probably stumble, as well. Your bug is fixed and I added an exteded API to make interface creation more easy. Just note that interface methods must always be public. I want to add some additional API improvements in the upcoming week. Once I am done, I will push the changes to Maven Central. Thank you once again for your kind words. |
The github culture seems to have created an interesting twist to open source .. It is very very rare that I can find a pre-built project / library . The assumption seems to be that noone would want that ... ( this just a background comment, not specific to to BB but its relevent).
Fortuantly I did find byte-budy in the Maven repo ...
I do like cloning or forking projects so I can see the source, but prefer if I get a pre build 'official' libary, especially for Java where its inherently platform neutral. Otherwise its often significant effort and risk to duplicate a build properly (another assumption common on github - that everyone has the same tools and build environments, and knows how to pick the correct branches etc).
I'm learning ! and BB does have actual documentation on building (again rare!)
Very useful as for some reason Maven projects tend to confuse both me and Eclipse ...
I never know what the right command to use, what versions etc and Eclipse gets equally confused.
Thankful for your docs I did exactly this (after cloning from HEAD)
mvn package
it appeared to succeed
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Byte Buddy (parent) ................................ SUCCESS [ 1.234 s]
[INFO] Byte Buddy Java agent .............................. SUCCESS [ 1.806 s]
[INFO] Byte Buddy (with dependencies) ..................... SUCCESS [ 8.480 s]
[INFO] Byte Buddy (without dependencies) .................. SUCCESS [ 0.142 s]
[INFO] Byte Buddy benchmarks .............................. SUCCESS [ 1.694 s]
[INFO] Byte Buddy for Android ............................. SUCCESS [ 0.921 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.397 s
[INFO] Finished at: 2015-01-17T09:35:42-05:00
[INFO] Final Memory: 28M/689M
[INFO] ------------------------------------------------------------------------
E:\Work\DEI\github\byte-buddy>
Except -- only the -dep version has any classes in it
E:\Work\DEI\github\byte-buddy\byte-buddy\target>ls -l
total 14
-rwxr-xr-x 1 DLEE None 5236 Jan 17 09:35 byte-buddy-0.6-SNAPSHOT.jar
E:\Work\DEI\github\byte-buddy\byte-buddy\target>jar t < byte-buddy-0.6-SNAPSHOT.jar
META-INF/
META-INF/MANIFEST.MF
META-INF/maven/
META-INF/maven/net.bytebuddy/
META-INF/maven/net.bytebuddy/byte-buddy/
META-INF/maven/net.bytebuddy/byte-buddy/pom.properties
META-INF/maven/net.bytebuddy/byte-buddy/pom.xml
META-INF/maven/net.bytebuddy/byte-buddy/pom.xml
META-INF/maven/net.bytebuddy/byte-buddy/pom.properties
E:\Work\DEI\github\byte-buddy\byte-buddy-dep\target>ls -l
total 1572
-rwxr-xr-x 1 DLEE None 1021281 Jan 17 09:35 byte-buddy-dep-0.6-SNAPSHOT.jar
META-INF/
META-INF/MANIFEST.MF
...
...
net/bytebuddy/utility/PropertyDispatcher$5.class
net/bytebuddy/utility/PropertyDispatcher$6.class
net/bytebuddy/utility/PropertyDispatcher$7.class
net/bytebuddy/utility/PropertyDispatcher$8.class
net/bytebuddy/utility/PropertyDispatcher$9.class
net/bytebuddy/utility/PropertyDispatcher.class
net/bytebuddy/utility/RandomString.class
net/bytebuddy/utility/StreamDrainer.class
META-INF/maven/net.bytebuddy/byte-buddy-dep/pom.xml
META-INF/maven/net.bytebuddy/byte-buddy-dep/pom.properties
I tried a lot of guessing based on looking at help and what other packages ask for
(I dont know maven more then being able to type "mvn")
mvn install
mvn clean
mvn generate-sources
mvn build
a few dozen like that to no avail.
Eclipse M2 plugin didnt even get that far ...
I was just about to go ahead and use the -dep.jar when I did a little RTFM and found your great docs on NOT to do that ... but fortunately you also said its on Maven Central (had to poke around to find what URL that is) but successfully downloaded the non dep .jar and its working.
( pointing the source to my local git branch )
Any suggestions on what Im doing wrong ?
Im happy to try things and send you the results.
-David
The text was updated successfully, but these errors were encountered: