6

Tried generating the meta model classes for my entities and because I have super class in another library, I cannot generate the super class meta model entities.

@Entity
public class Employee extends AbstractCreated {}

@MappedSuperclass
public class AbstractCreated implements Created {}

Error:(10, 76) java: cannot find symbol symbol: class AbstractCreated_ location: package com.company.persistence.jpa.entities

<plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>2.0.5</version>
                <executions>
                    <execution>
                        <id>process</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <processors>
                                <processor>org.immutables.processor.ProxyProcessor</processor>
                                <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
                            </processors>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.hibernate</groupId>
                        <artifactId>hibernate-jpamodelgen</artifactId>
                        <version>5.4.0.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>org.immutables</groupId>
                        <artifactId>value</artifactId>
                        <version>2.5.6</version>
                    </dependency>
                </dependencies>
            </plugin>

I expect all entities to have meta model generated including abstract super classes. See compilation issues because a class is not generated.

Julie
  • 179
  • 2
  • 13

1 Answers1

1

I know this is an old question, but I found the solution.

This should be your pom.xml in the library:

   <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <annotationProcessorPaths>
          <path>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-jpamodelgen</artifactId>
            <version>5.4.0.Final</version>
          </path>
        </annotationProcessorPaths>
      </configuration>
    </plugin>