Is there a JPA plugin for use with Gradle or any build tool out there?

Is there a plugin (any build tool: Ant, Maven or Gradle) that anyone knows about that will do the following:

  1. Generate JPA entities as part of the build? 2. Ability to specify database connection info from which to build the entities? 3. Ability to specify a class to extend for each entity? 4. Is IDE independent (we use IntelliJ)? 5. Is not hibernate based? (we use EclipseLink as the JPA provider) 6. Automatically handles all relationship types (one to many, many to one, many to many, etc)



another requirement is that with SQL Server & MySQL, the id column is defined as a self incrementing column, but with PostgreSQL & Oracle we used named sequences in which to pull the next id from. The generator must handle both cases.