# JPA entity classes are not discovered automatically with Gradle

**URL:** <https://discuss.gradle.org/t/jpa-entity-classes-are-not-discovered-automatically-with-gradle/11339>\
**Category:** Help/Discuss\
**Created:** [August 25, 2015, 9:42pm UTC](https://discuss.gradle.org/t/jpa-entity-classes-are-not-discovered-automatically-with-gradle/11339 "2015-08-25T21:42:47Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![marcos\_aps](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@marcos\_aps](https://discuss.gradle.org/u/marcos_aps)\
**Post date:** [August 26, 2015, 1:23am UTC](https://discuss.gradle.org/t/jpa-entity-classes-are-not-discovered-automatically-with-gradle/11339/5 "2015-08-26T01:23:17Z")

</div>

I’ve been programming in Java SE using JPA for more than six years and I can assure you that, before using Gradle, I have never had the need to explicitly specify the entity classes that reside in the same jar where persistence.xml reside for my application to work. And I don’t even have to list them if I’m running in Java EE. Sometimes I only have to list the classes if they are located in another jar, which is not the case here.

It would be very sad from the JPA specification if I had to declare all my classes in the deployment descriptor that lives in the same jar.

Again, before using Gradle (at least for testing), I didn’t need to declared the mapped classes in persistence.xml for the application to work. They were discovered automatically.

---

_[View the full topic](https://discuss.gradle.org/t/jpa-entity-classes-are-not-discovered-automatically-with-gradle/11339)._
