0

I added the following dependency to my pom.xml so that my static meta model classes can be generated for my JPA entities. The meta model classes are generated as expected. However, I observed that the generated source files for the generated classes are also included in the jar as well. How do I make maven exclude the generated source files from being bundled in the jar as well.

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-jpamodelgen</artifactId>
        <version>${hibernate.version}</version>
        <scope>compile</scope>
        <optional>true</optional>
    </dependency>
dawuzi
  • 21
  • 1
  • 4
  • 1
    Why do you want to exclude them, if you were just generating them? Either generate the model and use it (then you require the generated classes) or just don't generate them. – Roland Oct 26 '16 at 11:32
  • I agree with @Roland completely ! – Abhinav Puri Oct 26 '16 at 11:47
  • I want to exclude them from the generated jar. In other words, I want my jar to only contain the .class files of the generated classes and not the .java files. – dawuzi Oct 26 '16 at 15:33
  • The packed sources might not have anything to do with this dependency. I rather suspect an attach-sources (or something similar) somewhere, which is responsible for the .java-files being included in the jar. – Roland Oct 27 '16 at 11:56

0 Answers0