0

I'm working with Spring-Data-JPA and EclipseLink.

In order to do static weaving of my entity classes I have defined my pom with:

       <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.2.1</version>
          <executions>
            <execution>
              <id>weave-classes</id>
              <phase>process-classes</phase>
              <goals>
                <goal>java</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <mainClass>org.eclipse.persistence.tools.weaving.jpa.StaticWeave</mainClass>
            <commandlineArgs>-classpath %classpath -loglevel FINE -persistenceinfo ${basedir}/../data-ws/src/main/weaving ${basedir}/target/classes ${basedir}/target/classes</commandlineArgs>
          </configuration>
        </plugin>

When I execute 'maven install', I can see that static weaving has been done sucessfully.

Then when I modify any entity of my jpa project, the woven entity class is overriden with a new entity class that is not woven. So I have to manually execute again 'maven install' in order to generate the new woven entity class.

Is there any automatic way to generate 'woven entity classes' without executing 'maven install' when I modify my entity sources?

Thanks

Eduardo
  • 1,169
  • 5
  • 21
  • 56

1 Answers1

0

What I finally have done is to define a new 'builder' for my project. Opening the properties of the project is possible to define a 'builder' (builders section) whose type is 'program'. The new builder points to a bat file that executes a maven install of my project.

set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
cd C:\eclipse-jee-neon-3\workspace\data-ws
mvn install

In the 'Build Options' I have only checked 'During auto builds' and 'Specify working set of relevant resources' options. And I have just selected the diretory of my entities.

I hope is useful for somebody

Eduardo
  • 1,169
  • 5
  • 21
  • 56