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
OneJar broken for multi-project builds #4
Comments
Interesting...looks like "ant" is localized per-project. What do you think is a better solution—typedef'ing on each project where you want to use oneJar, or using the root project's "ant"? |
I'm afraid I don't really understand the question since I'm brand new to gradle and don't understand it's internals very well yet. What are the end-user visible implications of the two options? |
If people mess with their ant implementation, it wouldn't be reflected. I just answered my own question—going to have to typedef per project. I'll release a fix tomorrow. |
Try 0.6.8 and let me know how that goes. |
It didn't bomb out this time :o)
$ jar -tf frontend-oneJar.jar |
That's how oneJar works—it doesn't unpack the jars, but crams them inside with its own Main class and does some classpath funkiness to wire things up properly. This prevents issues from arising with resources and the like. Now, the fact that I'm including your other oneJar jars is bad. It won't wreck your program, but it does waste some space. I need to put a filter in to take out oneJar artifacts from builds... |
Try 0.6.9-SNAPSHOT. Let me know how that goes. |
Thanks Robert! It seemed mostly to work, but it bombs out when I try to run the jar. It seems to be because I'm using Guice and because of the classpath funkiness that oneJar does. It looks like you have to include an extra oneJar library in order to use Guice: Here's the error I get: |
I'm closing this issue. Opened this one: https://github.com/RobertFischer/gradle-plugins/issues/issue/5 |
From discussion on:
http://jira.codehaus.org/browse/GRADLE-566?focusedCommentId=253025#action_253025
$ gradle oneJar
:unpackOneJar SKIPPED
:typedefOneJar
:java/com/benmccann/test/db:compileJava UP-TO-DATE
:java/com/benmccann/test/db:processResources UP-TO-DATE
:java/com/benmccann/test/db:classes UP-TO-DATE
:java/com/benmccann/test/db:jar UP-TO-DATE
:java/com/benmccann/test/backend:compileJava UP-TO-DATE
:java/com/benmccann/test/backend:processResources UP-TO-DATE
:java/com/benmccann/test/backend:classes UP-TO-DATE
:java/com/benmccann/test/backend:jar UP-TO-DATE
:java/com/benmccann/test/backend:oneJar
FAILURE: Build failed with an exception.
Where:
Build file '/home/bmccann/workspace/test/java/com/benmccann/test/backend/build.gradle'
What went wrong:
Execution failed for task ':java/com/benmccann/test/backend:oneJar'.
Cause: Problem: failed to create task or type one-jar
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.
The text was updated successfully, but these errors were encountered: