You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by st...@apache.org on 2016/01/16 11:36:03 UTC

svn commit: r1724950 - in /openjpa/trunk/openjpa-tools/openjpa-maven-plugin: ./ src/it/enhanceIncludesExcludes/ src/it/enhanceIncludesExcludes/src/ src/it/enhanceIncludesExcludes/src/main/ src/it/enhanceIncludesExcludes/src/main/java/ src/it/enhanceInc...

Author: struberg
Date: Sat Jan 16 10:36:02 2016
New Revision: 1724950

URL: http://svn.apache.org/viewvc?rev=1724950&view=rev
Log:
OPENJPA-2623 switch to Java5 Mojo annotations

This will also improve IDE integration.
Thanks to Anders Hammar (apacheid:andham) for the patch!

Added:
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/invoker.properties   (with props)
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/pom.xml   (with props)
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/exclude/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/exclude/TestEntityA.java   (with props)
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/include/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/include/TestEntityB.java   (with props)
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/foo/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/foo/TestEntityC.java   (with props)
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/resources/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/resources/META-INF/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/resources/META-INF/persistence.xml   (with props)
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/test/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/test/java/
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/test/java/VerifyTest.java   (with props)
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/verify.groovy
Modified:
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/pom.xml
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaEnhancerMojo.java
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMappingToolMojo.java
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMojo.java
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaEnhancerMojo.java
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSchemaMojo.java
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSqlMojo.java
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaTestEnhancerMojo.java

Modified: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/pom.xml?rev=1724950&r1=1724949&r2=1724950&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/pom.xml (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/pom.xml Sat Jan 16 10:36:02 2016
@@ -45,7 +45,6 @@
         <maven>2.0.6</maven>
     </prerequisites>
 
-
     <developers>
         <developer>
             <id>rahul</id>
@@ -66,6 +65,7 @@
             <timezone>+1</timezone>
         </developer>
     </developers>
+
     <dependencies>
         <!-- dependencies needed for building maven plugins -->
         <dependency>
@@ -79,6 +79,12 @@
             <version>2.0.6</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.maven.plugin-tools</groupId>
+            <artifactId>maven-plugin-annotations</artifactId>
+            <version>3.4</version>
+            <scope>provided</scope> <!-- annotations are only needed to build the plugin -->
+        </dependency>
+        <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-utils</artifactId>
             <version>1.5.7</version>
@@ -153,6 +159,28 @@
                 </configuration>
             </plugin>
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+                <version>3.4</version>
+                <configuration>
+                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>mojo-descriptor</id>
+                        <goals>
+                            <goal>descriptor</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>help-goal</id>
+                        <goals>
+                            <goal>helpmojo</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <artifactId>maven-invoker-plugin</artifactId>
                 <configuration>
                     <debug>true</debug>
@@ -166,6 +194,7 @@
                     <goals>
                         <goal>install</goal>
                     </goals>
+                    <postBuildHookScript>verify</postBuildHookScript>
                 </configuration>
                 <executions>
                     <execution>

Added: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/invoker.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/invoker.properties?rev=1724950&view=auto
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/invoker.properties (added)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/invoker.properties Sat Jan 16 10:36:02 2016
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals=clean test

Propchange: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/pom.xml?rev=1724950&view=auto
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/pom.xml (added)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/pom.xml Sat Jan 16 10:36:02 2016
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!--
+    Maven release plugin requires the project tag to be on a single line.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.openjpa</groupId>
+        <artifactId>openjpa-tools</artifactId>
+        <version>@pom.version@</version>
+    </parent>
+
+    <groupId>org.apache.openjpa.tools.openjpa-maven-plugin.testing</groupId>
+    <artifactId>enhanceIncludesExcludes</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-validation_1.0_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-kernel</artifactId>
+            <version>@pom.version@</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-jdbc</artifactId>
+            <version>@pom.version@</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-persistence</artifactId>
+            <version>@pom.version@</version>
+        </dependency>
+
+        <dependency>
+            <groupId>hsqldb</groupId>
+            <artifactId>hsqldb</artifactId>
+            <version>${hsqldb.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <configuration>
+                        <source>1.5</source>
+                        <target>1.5</target>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.openjpa</groupId>
+                <artifactId>openjpa-maven-plugin</artifactId>
+                <version>@pom.version@</version>
+                <executions>
+                    <execution>
+                        <id>jpa-enhance</id>
+                        <goals>
+                            <goal>enhance</goal>
+                        </goals>
+                        <configuration>
+                            <includes>enhance/**/*.class</includes>
+                            <excludes>**/exclude/*.class</excludes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/exclude/TestEntityA.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/exclude/TestEntityA.java?rev=1724950&view=auto
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/exclude/TestEntityA.java (added)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/exclude/TestEntityA.java Sat Jan 16 10:36:02 2016
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package enhance.exclude;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class TestEntityA {
+
+    @Id
+    private int xint1;
+
+    private String string1;
+
+    public TestEntityA(int int1, String string1) {
+        this.xint1 = int1;
+        this.string1 = string1;
+    }
+
+    public int getInt1() {
+        return xint1;
+    }
+
+    public void setInt1(int int1) {
+        this.xint1 = int1;
+    }
+
+    public String getString1() {
+        return string1;
+    }
+
+    public void setString1(String string1) {
+        this.string1 = string1;
+    }
+
+    public String toString()  {
+        return xint1 + ":" + string1;
+    }
+
+}

Propchange: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/exclude/TestEntityA.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/include/TestEntityB.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/include/TestEntityB.java?rev=1724950&view=auto
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/include/TestEntityB.java (added)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/include/TestEntityB.java Sat Jan 16 10:36:02 2016
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package enhance.include;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class TestEntityB {
+
+    @Id
+    private int xint1;
+
+    private String string1;
+
+    public TestEntityB(int int1, String string1) {
+        this.xint1 = int1;
+        this.string1 = string1;
+    }
+
+    public int getInt1() {
+        return xint1;
+    }
+
+    public void setInt1(int int1) {
+        this.xint1 = int1;
+    }
+
+    public String getString1() {
+        return string1;
+    }
+
+    public void setString1(String string1) {
+        this.string1 = string1;
+    }
+
+    public String toString()  {
+        return xint1 + ":" + string1;
+    }
+
+}

Propchange: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/enhance/include/TestEntityB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/foo/TestEntityC.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/foo/TestEntityC.java?rev=1724950&view=auto
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/foo/TestEntityC.java (added)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/foo/TestEntityC.java Sat Jan 16 10:36:02 2016
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package foo;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class TestEntityC {
+
+    @Id
+    private int xint1;
+
+    private String string1;
+
+    public TestEntityC(int int1, String string1) {
+        this.xint1 = int1;
+        this.string1 = string1;
+    }
+
+    public int getInt1() {
+        return xint1;
+    }
+
+    public void setInt1(int int1) {
+        this.xint1 = int1;
+    }
+
+    public String getString1() {
+        return string1;
+    }
+
+    public void setString1(String string1) {
+        this.string1 = string1;
+    }
+
+    public String toString()  {
+        return xint1 + ":" + string1;
+    }
+
+}

Propchange: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/java/foo/TestEntityC.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/resources/META-INF/persistence.xml?rev=1724950&view=auto
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/resources/META-INF/persistence.xml (added)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/resources/META-INF/persistence.xml Sat Jan 16 10:36:02 2016
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+    version="1.0">
+
+    <!-- simply all annotated persistent entities will be part of this unit -->
+    <persistence-unit name="TestUnit">
+        <properties>
+            <property name="openjpa.jdbc.DBDictionary" value="hsql" />
+            <property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+            <property name="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:test" />
+            <property name="openjpa.ConnectionUserName" value="sa" />
+            <property name="openjpa.ConnectionPassword" value="" />
+        </properties>
+    </persistence-unit>
+
+</persistence>

Propchange: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/main/resources/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/test/java/VerifyTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/test/java/VerifyTest.java?rev=1724950&view=auto
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/test/java/VerifyTest.java (added)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/test/java/VerifyTest.java Sat Jan 16 10:36:02 2016
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import static org.junit.Assert.fail;
+
+import org.apache.openjpa.enhance.PersistenceCapable;
+import org.junit.Test;
+
+import enhance.exclude.TestEntityA;
+import enhance.include.TestEntityB;
+import foo.TestEntityC;
+
+public class VerifyTest {
+    
+    @Test
+    public void testTestEntityBIsEnhanced() {
+        if (!PersistenceCapable.class.isAssignableFrom(TestEntityB.class)) {
+            fail("TestEntityB has not been enhanced");
+        }
+    }
+
+    @Test
+    public void testTestEntityAIsNotEnhanced() {
+        if (PersistenceCapable.class.isAssignableFrom(TestEntityA.class)) {
+            fail("TestEntityA has been enhanced");
+        }
+    }
+
+    @Test
+    public void testTestEntityCIsNotEnhanced() {
+        if (PersistenceCapable.class.isAssignableFrom(TestEntityC.class)) {
+            fail("TestEntityC has been enhanced");
+        }
+    }
+}

Propchange: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/src/test/java/VerifyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/verify.groovy
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/verify.groovy?rev=1724950&view=auto
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/verify.groovy (added)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/it/enhanceIncludesExcludes/verify.groovy Sat Jan 16 10:36:02 2016
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Verification is performed in unit test VerifyTest

Modified: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaEnhancerMojo.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaEnhancerMojo.java?rev=1724950&r1=1724949&r2=1724950&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaEnhancerMojo.java (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaEnhancerMojo.java Sat Jan 16 10:36:02 2016
@@ -21,6 +21,7 @@ package org.apache.openjpa.tools.maven;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.codehaus.plexus.util.FileUtils;
 
 import org.apache.openjpa.enhance.PCEnhancer;
@@ -40,9 +41,8 @@ public abstract class AbstractOpenJpaEnh
      * The JPA spec requires that all persistent classes define a no-arg constructor.
      * This flag tells the enhancer whether to add a protected no-arg constructor
      * to any persistent classes that don't already have one.
-     *
-     * @parameter default-value="true"
      */
+    @Parameter(defaultValue="true")
     protected boolean addDefaultConstructor;
     /**
      * used for passing the addDefaultConstructor parameter to the enhnacer tool
@@ -52,9 +52,8 @@ public abstract class AbstractOpenJpaEnh
     /**
      * Whether to throw an exception when it appears that a property access entity
      * is not obeying the restrictions placed on property access.
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(defaultValue="false")
     protected boolean enforcePropertyRestrictions;
     /**
      * used for passing the enforcePropertyRestrictions parameter to the enhnacer tool
@@ -66,9 +65,8 @@ public abstract class AbstractOpenJpaEnh
      * If you enable this feature, then no depending artifacts from the classpath will be used!
      * Please note that you have to disable the tmpClassLoader for some cases in OpenJPA-1.2.1
      * due to an extended parsing strategy.
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(defaultValue="false")
     protected boolean tmpClassLoader;
     /**
      * used for passing the tmpClassLoader parameter to the enhnacer tool

Modified: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMappingToolMojo.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMappingToolMojo.java?rev=1724950&r1=1724949&r2=1724950&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMappingToolMojo.java (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMappingToolMojo.java Sat Jan 16 10:36:02 2016
@@ -29,6 +29,7 @@ import javax.persistence.Entity;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.openjpa.enhance.PersistenceCapable;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl;
@@ -54,9 +55,8 @@ public abstract class AbstractOpenJpaMap
     /**
      * Argument to specify the action to take on each class. The available actions are:
      * buildSchema, validate
-     *
-     * @parameter
      */
+    @Parameter
     protected String action;
     /**
      * used for passing the action parameter to the mapping tool

Modified: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMojo.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMojo.java?rev=1724950&r1=1724949&r2=1724950&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMojo.java (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaMojo.java Sat Jan 16 10:36:02 2016
@@ -31,6 +31,7 @@ import java.util.Properties;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.openjpa.lib.util.Options;
 import org.codehaus.plexus.util.FileUtils;
@@ -45,46 +46,36 @@ public abstract class AbstractOpenJpaMoj
     /**
      * The working directory for putting persistence.xml and
      * other stuff into if we need to.
-     *
-     *
-     * @parameter expression="${openjpa.workdir}"
-     *            default-value="${project.build.directory}/openjpa-work"
-     * @required
      */
+    @Parameter(property="openjpa.workdir", defaultValue="${project.build.directory}/openjpa-work", required=true)
     protected File workDir;
 
     /**
      * Location where <code>persistence-enabled</code> classes are located.
-     * 
-     * @parameter expression="${openjpa.classes}"
-     *            default-value="${project.build.outputDirectory}"
-     * @required
      */
+    @Parameter(property="openjpa.classes", defaultValue="${project.build.outputDirectory}", required=true)
     protected File classes;
     
     /**
      * Comma separated list of includes to scan searchDir to pass to the jobs.
      * This may be used to restrict the OpenJPA tasks to e.g. a single package which
      * contains all the entities.
-     *   
-     * @parameter default-value="**\/*.class"
      */
+    @Parameter(defaultValue="**/*.class")
     private String includes;
 
     /**
      * Comma separated list of excludes to scan searchDir to pass to the jobs.
      * This option may be used to stop OpenJPA tasks from scanning non-JPA classes
      * (which usually leads to warnings such as "Type xxx has no metadata")
-     * 
-     * @parameter default-value="";
      */
+    @Parameter(defaultValue="")
     private String excludes;
 
     /**
      * Additional properties passed to the OpenJPA tools.
-     * 
-     * @parameter
      */
+    @Parameter
     private Properties toolProperties;
 
     /**
@@ -92,18 +83,16 @@ public abstract class AbstractOpenJpaMoj
      * If not specified, the default one in META-INF/persistence.xml will be used.
      * Since openjpa-2.3.0 this can also be a resource location. In prior releases
      * it was only possible to specify a file location.
-     *
-     * @parameter
      */
+    @Parameter
     private String persistenceXmlFile;
 
     /**
      * An optional PersistenceUnit name.
      * If not specified then OpenJPA will run against 'all anchors'.
      * Means it will use all persistenceunits of all persistence.xml files it finds.
-     *
-     * @parameter default-value="${openjpa.persistenceUnitName}"
      */
+    @Parameter(defaultValue="${openjpa.persistenceUnitName}")
     private String persistenceUnitName;
 
 
@@ -118,9 +107,8 @@ public abstract class AbstractOpenJpaMoj
      * </pre>
      * 
      * This is most times used in conjunction with {@link #connectionProperties}.
-     * 
-     * @parameter
      */
+    @Parameter
     private String connectionDriverName;
 
     /** the string used for passing information about the connectionDriverName */
@@ -143,9 +131,8 @@ public abstract class AbstractOpenJpaMoj
      * </pre>
      *
      * This is most times used in conjunction with {@link #connectionDriverName}.
-     *
-     * @parameter
      */
+    @Parameter
     private String connectionProperties;
     
     /** the string used for passing information about the connectionProperties */
@@ -156,30 +143,21 @@ public abstract class AbstractOpenJpaMoj
      * List of all class path elements that will be searched for the
      * <code>persistence-enabled</code> classes and resources expected by
      * PCEnhancer.
-     * 
-     * @parameter default-value="${project.compileClasspathElements}"
-     * @required
-     * @readonly
      */
+    @Parameter(defaultValue="${project.compileClasspathElements}", required=true, readonly=true)
     protected List<String> compileClasspathElements;
     
     /**
      * Setting this parameter to <code>true</code> will force
      * the execution of this mojo, even if it would get skipped usually.
-     *  
-     * @parameter expression="${forceOpenJpaExecution}"
-     *            default-value=false
-     * @required
      */
+    @Parameter(property="forceOpenJpaExecution", defaultValue="false", required=true)
     private boolean forceMojoExecution; 
     
     /**
      * The Maven Project Object
-     *
-     * @parameter default-value="${project}"
-     * @required
-     * @readonly
      */
+    @Parameter(defaultValue="${project}", required=true, readonly=true)
     protected MavenProject project;
 
     /** the properties option is used for passing information about the persistence.xml file location */
@@ -194,8 +172,8 @@ public abstract class AbstractOpenJpaMoj
     /**
      * When <code>true</code>, skip the execution.
      * @since 1.0
-     * @parameter default-value="false"
      */
+    @Parameter(defaultValue="false")
     private boolean skip;
 
     /**

Modified: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaEnhancerMojo.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaEnhancerMojo.java?rev=1724950&r1=1724949&r2=1724950&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaEnhancerMojo.java (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaEnhancerMojo.java Sat Jan 16 10:36:02 2016
@@ -18,19 +18,17 @@
  */
 package org.apache.openjpa.tools.maven;
 
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 
 /**
- * Processes Application model classes and enhances them by running Open JPA
+ * Processes Application model classes and enhances them by running OpenJPA
  * Enhancer tool.
- * This basically only acts as a container for the xdoclet stuff since all
- * the required functionality is already in the {@code AbstratOpenJpaEnhancerMojo}.
  * 
  * @version $Id: OpenJpaEnhancerMojo.java 10954 2009-10-23 22:05:45Z struberg $
  * @since 1.0
- * @goal enhance
- * @phase process-classes
- * @requiresDependencyResolution compile
- * 
  */
+@Mojo(name="enhance", defaultPhase=LifecyclePhase.PROCESS_CLASSES, requiresDependencyResolution=ResolutionScope.COMPILE)
 public class OpenJpaEnhancerMojo extends AbstractOpenJpaEnhancerMojo {
 }

Modified: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSchemaMojo.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSchemaMojo.java?rev=1724950&r1=1724949&r2=1724950&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSchemaMojo.java (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSchemaMojo.java Sat Jan 16 10:36:02 2016
@@ -22,6 +22,10 @@ package org.apache.openjpa.tools.maven;
 import java.io.File;
 
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.openjpa.lib.util.Options;
 
 /**
@@ -29,11 +33,8 @@ import org.apache.openjpa.lib.util.Optio
  * 
  * @version $Id$
  * @since 1.0
- * @goal schema
- * @phase process-classes
- * @requiresDependencyResolution compile
- * 
  */
+@Mojo(name="schema", defaultPhase=LifecyclePhase.PROCESS_CLASSES, requiresDependencyResolution=ResolutionScope.COMPILE)
 public class OpenJpaSchemaMojo extends AbstractOpenJpaMappingToolMojo {
 
     /**
@@ -49,9 +50,8 @@ public class OpenJpaSchemaMojo extends A
      * <li>export (see MappingTool#ACTION_EXPORT)</li>
      * <li>validate (see MappingTool#ACTION_VALIDATE)</li>
      * </ul>
-     *
-     * @parameter default-value="add"
      */
+    @Parameter(defaultValue="add")
     protected String schemaAction;
     /**
      * used for passing the schemaAction parameter to the mapping tool
@@ -62,9 +62,8 @@ public class OpenJpaSchemaMojo extends A
      * Use this option to write the planned schema to an XML document
      * rather than modify the database. The document can then be manipulated and
      * committed to the database with the schema tool
-     *
-     * @parameter default-value="${project.build.directory}/schema.xml"
      */
+    @Parameter(defaultValue="${project.build.directory}/schema.xml")
     protected File schemaFile;
     /**
      * used for passing the schemaFile parameter to the mapping tool

Modified: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSqlMojo.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSqlMojo.java?rev=1724950&r1=1724949&r2=1724950&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSqlMojo.java (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaSqlMojo.java Sat Jan 16 10:36:02 2016
@@ -22,6 +22,10 @@ package org.apache.openjpa.tools.maven;
 import java.io.File;
 
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.openjpa.lib.util.Options;
 
 /**
@@ -29,10 +33,8 @@ import org.apache.openjpa.lib.util.Optio
  * 
  * @version $Id$
  * @since 1.0
- * @goal sql
- * @phase process-classes
- * @requiresDependencyResolution compile
  */
+@Mojo(name="sql", defaultPhase=LifecyclePhase.PROCESS_CLASSES, requiresDependencyResolution=ResolutionScope.COMPILE)
 public class OpenJpaSqlMojo extends AbstractOpenJpaMappingToolMojo {
 
     /**
@@ -51,9 +53,8 @@ public class OpenJpaSqlMojo extends Abst
      * Technically this is the same like the {@code schemaAction}, but we have to
      * split it for the plugin to allow different actions for generating the mapping
      * and generating the SQL files.
-     *
-     * @parameter default-value="build"
      */
+    @Parameter(defaultValue="build")
     protected String sqlAction;
     /**
      * internally the options is named 'schemaAction'!
@@ -65,23 +66,20 @@ public class OpenJpaSqlMojo extends Abst
      * script. Combine this with a schemaAction
      * of "build" to generate a script that recreates the schema for the
      * current mappings, even if the schema already exists.
-     *
-     * @parameter default-value="${project.build.directory}/database.sql"
      */
+    @Parameter(defaultValue="${project.build.directory}/database.sql")
     protected File sqlFile;
     /**
      * used for passing the sqlFile parameter to the mapping tool
      */
     protected static final String OPTION_SQL_FILE = "sqlFile";
 
-
     /**
      * Use this option to write the planned schema modifications to
      * the database. If this is set, the sqlFile setting (if any) will
      * be ignored.
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(defaultValue="false")
     protected boolean modifyDatabase;
 
 

Modified: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaTestEnhancerMojo.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaTestEnhancerMojo.java?rev=1724950&r1=1724949&r2=1724950&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaTestEnhancerMojo.java (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/OpenJpaTestEnhancerMojo.java Sat Jan 16 10:36:02 2016
@@ -21,47 +21,42 @@ package org.apache.openjpa.tools.maven;
 import java.io.File;
 import java.util.List;
 
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+
 /**
- * Processes Application model classes and enhances them by running Open JPA
+ * Processes Application model test classes and enhances them by running OpenJPA
  * Enhancer tool.
  * 
  * @version $Id: OpenJpaTestEnhancerMojo.java 9137 2009-02-28 21:55:03Z struberg $
  * @since 1.1
- * @goal test-enhance
- * @phase process-test-classes
- * @requiresDependencyResolution test
- * 
  */
+@Mojo(name="test-enhance", defaultPhase=LifecyclePhase.PROCESS_TEST_CLASSES,
+      requiresDependencyResolution=ResolutionScope.TEST)
 public class OpenJpaTestEnhancerMojo extends AbstractOpenJpaEnhancerMojo {
 
     /**
      * List of all class path elements that will be searched for the
      * <code>persistence-enabled</code> classes and resources expected by
      * PCEnhancer.
-     *
-     * @parameter default-value="${project.testClasspathElements}"
-     * @required
-     * @readonly
      */
+    @Parameter(defaultValue="${project.testClasspathElements}", required=true, readonly=true)
     protected List<String> testClasspathElements;
 
     /**
      * This is where compiled test classes go.
-     *
-     * @parameter default-value="${project.build.testOutputDirectory}"
-     * @required
-     * @readonly
      */
+    @Parameter(defaultValue="${project.build.testOutputDirectory}", required=true, readonly=true)
     private File testClasses;
 
     /**
      * Use this flag to skip test enhancement. It will automatically be
      * set if maven got invoked with the -Dmaven.test.skip=true option
      * because no compiled test clases are available in this case.
-     *
-     * @parameter default-value="${maven.test.skip}"
-     * @readonly
      */
+    @Parameter(defaultValue="${maven.test.skip}", readonly=true)
     private boolean skipTestEnhancement;
 
     /**