[weld-commits] Weld SVN: r6616 - in archetypes/trunk/javaee6-webapp-src: src/main/java/com/mycompany and 1 other directory.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Sun Jul 11 17:37:13 EDT 2010


Author: dan.j.allen
Date: 2010-07-11 17:37:13 -0400 (Sun, 11 Jul 2010)
New Revision: 6616

Removed:
   archetypes/trunk/javaee6-webapp-src/src/main/java/com/mycompany/Member_.java
Modified:
   archetypes/trunk/javaee6-webapp-src/pom.xml
Log:
a much cleaner solution for generating and compiling the JPA metamodel


Modified: archetypes/trunk/javaee6-webapp-src/pom.xml
===================================================================
--- archetypes/trunk/javaee6-webapp-src/pom.xml	2010-07-11 20:35:55 UTC (rev 6615)
+++ archetypes/trunk/javaee6-webapp-src/pom.xml	2010-07-11 21:37:13 UTC (rev 6616)
@@ -126,17 +126,47 @@
    <build>
       <finalName>${project.artifactId}</finalName>
       <plugins>
-         <!-- Compiler plugin enforces Java 1.6 compatibility -->
+         <!-- Compiler plugin enforces Java 1.6 compatibility and controls execution of annotation processors -->
          <plugin>
             <artifactId>maven-compiler-plugin</artifactId>
             <version>2.3.1</version>
             <configuration>
                <source>1.6</source>
                <target>1.6</target>
-               <!-- Please note you have to compile twice after changing an @Entity class in order for the JPA metamodel to be compiled -->
-               <generatedSourcesDirectory>src/main/java</generatedSourcesDirectory>
+               <compilerArgument>-proc:none</compilerArgument>
             </configuration>
+            <executions>
+               <execution>
+                  <id>run-annotation-processors-only</id>
+                  <phase>generate-sources</phase>
+                  <configuration>
+                     <compilerArgument>-proc:only</compilerArgument>
+                  </configuration>
+                  <goals>
+                     <goal>compile</goal>
+                  </goals>
+               </execution>
+            </executions>
          </plugin>
+         <!-- Build helper plugin adds the sources generated by the JPA 2 annotation processor to the compile path -->
+         <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>build-helper-maven-plugin</artifactId>
+            <version>1.5</version>
+            <executions>
+               <execution>
+                  <phase>process-sources</phase>
+                  <configuration>
+                     <sources>
+                        <source>${project.build.directory}/generated-sources/annotations</source>
+                     </sources>
+                  </configuration>
+                  <goals>
+                     <goal>add-source</goal>
+                  </goals>
+               </execution>
+            </executions>
+         </plugin>
       </plugins>
    </build>
 

Deleted: archetypes/trunk/javaee6-webapp-src/src/main/java/com/mycompany/Member_.java
===================================================================
--- archetypes/trunk/javaee6-webapp-src/src/main/java/com/mycompany/Member_.java	2010-07-11 20:35:55 UTC (rev 6615)
+++ archetypes/trunk/javaee6-webapp-src/src/main/java/com/mycompany/Member_.java	2010-07-11 21:37:13 UTC (rev 6616)
@@ -1,15 +0,0 @@
-package com.mycompany;
-
-import javax.persistence.metamodel.SingularAttribute;
-import javax.persistence.metamodel.StaticMetamodel;
-
- at StaticMetamodel(Member.class)
-public abstract class Member_ {
-
-	public static volatile SingularAttribute<Member, Long> id;
-	public static volatile SingularAttribute<Member, String> phoneNumber;
-	public static volatile SingularAttribute<Member, String> email;
-	public static volatile SingularAttribute<Member, String> name;
-
-}
-



More information about the weld-commits mailing list