I am trying to use the hibernate-jpamodelgen in conjunction with the maven-processor-plugin to generate my JPA meta-model as part of my Maven build using the configuration from this answer.
However, when I do the build I get the following error when I try to do a mvn clean install
:
[ERROR] C:\Users\ArtB\Documents\code\xxx\target\classes\me\Page_.java:[11,16] error: duplicate class: me.Page_
From some investigation it looks like the issue is that the generated meta-model seems to occur twice or something.
If I run clear; mvn clean generate-sources; ls -l target\generated-sources\apt\me
I have just the file _Page.java
and no other files.
After the compile
phase the target\classes\
folder just contains \me\_Page.java
... which seems strange since I thought .class
files should appear in the "\target\classes" folder.
I ran the build with debug (ie -X
) and saw nothing suspicious.
I doubt it matters, but here are my models.
package me;
@Entity
@Table(name="Pages")
public class Page {
@Id @GeneratedValue
private long id;
private String title;
private Instant lastRetrieved;
private PageCategory category;
private URL source;
@Lob
private String contents;
//hashcode, equals, getters & setters omitted
}
and
package me;
public enum PageCategory {
PRODUCT,
INFO
;
}