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

Please provide multiple jars #62

Closed
aaschmid opened this issue Feb 19, 2014 · 4 comments
Closed

Please provide multiple jars #62

aaschmid opened this issue Feb 19, 2014 · 4 comments
Labels

Comments

@aaschmid
Copy link

Hey Michi,
I have just tried to enhance your "sample" with gradle (see https://github.com/aaschmid/pojobuilder).

The problem if you don't separate the pojobuilder.jar such that one is just containing the @GeneratePojoBuilder and all the other code annotations, and one contain the required dependencies and classes for annotation processing, is following:

If you compile the code automatically the annotation processing is done and you will get *Builder.javaand *Builder.classin your output directory (to reproduce just execute gradle build on https://github.com/aaschmid/pojobuilder.

Furthermore, I would like to refactor your example that it generates and uses the generate POJO builders just in test "scope" because IMHO is that a more realistic use case and a better sample. If one also wants to use the generate POJO builders in "main" scope he/she can execute the generatePojobuilderjust before compileJava.

@mkarneim
Copy link
Owner

Andi,

Thank you for this.
I will have a look into this after the weekend.

Actually we had an extra JAR file that just contained the annotation types when PB was built with Ant.

Do you know how to tell Maven to create that archive also?

@aaschmid
Copy link
Author

Sorry, I don't know maven well enough ...
Can you provide this extra jar file also as artifact in Maven Central?

@mkarneim
Copy link
Owner

mkarneim commented Mar 1, 2014

I found some description about how to create additional JAR files with a subset of classes at http://stackoverflow.com/questions/8209132/can-maven-assembly-plugin-picking-the-specify-java-package/8209544#8209544.

So creating and uploading that annotation jar to sonatype and maven central should work.

And I think you could 'reference' it from your module by using the 'classifier' attribute.

I'll try to check that out this WE.

@aaschmid
Copy link
Author

aaschmid commented Mar 1, 2014

added a pull request (#63) containing the maven-jar-plugin.
Futhermore, diveded the samples project in two parts in fork https://github.com/aaschmid/pojobuilder:

  • main using just annotations and
  • test using created pojobuilders.
    (just tested with gradle so far)

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

No branches or pull requests

2 participants