From ab902bb53498c8f806b40bcf5da17bd606dbbe17 Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Fri, 06 Feb 2015 10:23:12 +0000
Subject: [PATCH] OPENDJ-1741 Ensure build is compatible with maven 3.0.x

---
 opendj-manifest-classpath-maven-plugin/pom.xml |   82 ++++++++------------
 opendj-concat-schema-maven-plugin/pom.xml      |   33 ++++----
 opendj-logref-doc-maven-plugin/pom.xml         |   75 ++++++++----------
 pom.xml                                        |   18 ++++
 4 files changed, 101 insertions(+), 107 deletions(-)

diff --git a/opendj-concat-schema-maven-plugin/pom.xml b/opendj-concat-schema-maven-plugin/pom.xml
index 2132876..f636080 100644
--- a/opendj-concat-schema-maven-plugin/pom.xml
+++ b/opendj-concat-schema-maven-plugin/pom.xml
@@ -16,23 +16,22 @@
   </description>
   <packaging>maven-plugin</packaging>
 
+  <properties>
+    <mavenVersion>3.0.4</mavenVersion>
+  </properties>
+
   <dependencies>
-    <dependency>
-      <groupId>org.twdata.maven</groupId>
-      <artifactId>mojo-executor</artifactId>
-      <version>2.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-      <version>2.0</version>
-    </dependency>
-    <!-- dependencies to annotations -->
-    <dependency>
-      <groupId>org.apache.maven.plugin-tools</groupId>
-      <artifactId>maven-plugin-annotations</artifactId>
-      <version>3.4</version>
-      <scope>provided</scope>
-    </dependency>
+	<dependency>
+		<groupId>org.twdata.maven</groupId>
+		<artifactId>mojo-executor</artifactId>
+		<version>2.2.0</version>
+	</dependency>
+	<dependency>
+		<groupId>org.apache.maven.plugin-tools</groupId>
+		<artifactId>maven-plugin-annotations</artifactId>
+		<version>3.2</version>
+		<scope>provided</scope>
+	</dependency>
   </dependencies>
+ 
 </project>
diff --git a/opendj-logref-doc-maven-plugin/pom.xml b/opendj-logref-doc-maven-plugin/pom.xml
index 196ffc5..e885e41 100644
--- a/opendj-logref-doc-maven-plugin/pom.xml
+++ b/opendj-logref-doc-maven-plugin/pom.xml
@@ -1,47 +1,42 @@
 <?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <artifactId>opendj-project</artifactId>
-    <groupId>org.forgerock.opendj</groupId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<artifactId>opendj-project</artifactId>
+		<groupId>org.forgerock.opendj</groupId>
+		<version>3.0.0-SNAPSHOT</version>
+	</parent>
 
-  <artifactId>opendj-logref-doc-maven-plugin</artifactId>
-  <version>1.0.0-SNAPSHOT</version>
-  <name>OpenDJ Documentation LogRef Maven Plugin</name>
-  <description>
+	<artifactId>opendj-logref-doc-maven-plugin</artifactId>
+	<version>1.0.0-SNAPSHOT</version>
+	<name>OpenDJ Documentation LogRef Maven Plugin</name>
+	<description>
     Generation of log references for admin and intallation guides of OpenDJ project.
   </description>
-  <packaging>maven-plugin</packaging>
+	<packaging>maven-plugin</packaging>
 
-  <dependencies>
-    <dependency>
-        <groupId>org.forgerock.commons</groupId>
-        <artifactId>forgerock-util</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.forgerock.commons</groupId>
-      <artifactId>i18n-slf4j</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.twdata.maven</groupId>
-      <artifactId>mojo-executor</artifactId>
-      <version>2.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-      <version>2.0</version>
-    </dependency>
+	<properties>
+		<mavenVersion>3.0.4</mavenVersion>
+	</properties>
 
-    <!-- dependencies to annotations -->
-    <dependency>
-      <groupId>org.apache.maven.plugin-tools</groupId>
-      <artifactId>maven-plugin-annotations</artifactId>
-      <version>3.4</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
+	<dependencies>
+		<dependency>
+			<groupId>org.forgerock.commons</groupId>
+			<artifactId>forgerock-util</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.twdata.maven</groupId>
+			<artifactId>mojo-executor</artifactId>
+			<version>2.2.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.maven.plugin-tools</groupId>
+			<artifactId>maven-plugin-annotations</artifactId>
+			<version>3.2</version>
+			<scope>provided</scope>
+		</dependency>
+
+	</dependencies>
 </project>
diff --git a/opendj-manifest-classpath-maven-plugin/pom.xml b/opendj-manifest-classpath-maven-plugin/pom.xml
index 992bc65..1e9b7e7 100644
--- a/opendj-manifest-classpath-maven-plugin/pom.xml
+++ b/opendj-manifest-classpath-maven-plugin/pom.xml
@@ -1,56 +1,38 @@
 <?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <artifactId>opendj-project</artifactId>
-    <groupId>org.forgerock.opendj</groupId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<artifactId>opendj-project</artifactId>
+		<groupId>org.forgerock.opendj</groupId>
+		<version>3.0.0-SNAPSHOT</version>
+	</parent>
 
-  <artifactId>opendj-manifest-classpath-maven-plugin</artifactId>
-  <version>1.0.0-SNAPSHOT</version>
-  <name>OpenDJ Manifest Classpath Maven Plugin</name>
-  <description>
+	<artifactId>opendj-manifest-classpath-maven-plugin</artifactId>
+	<version>1.0.0-SNAPSHOT</version>
+	<name>OpenDJ Manifest Classpath Maven Plugin</name>
+	<description>
     Generation of manifest classpath, with classpath customization.
   </description>
-  <packaging>maven-plugin</packaging>
+	<packaging>maven-plugin</packaging>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-archiver</artifactId>
-      <version>2.6</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.plugins</groupId>
-      <artifactId>maven-jar-plugin</artifactId>
-      <version>2.5</version>
-      <type>maven-plugin</type>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.plugins</groupId>
-      <artifactId>maven-assembly-plugin</artifactId>
-      <version>2.5.3</version>
-      <type>maven-plugin</type>
-    </dependency>
-    <dependency>
-      <groupId>org.twdata.maven</groupId>
-      <artifactId>mojo-executor</artifactId>
-      <version>2.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-      <version>2.0</version>
-    </dependency>
-    <!-- dependencies to annotations -->
-    <dependency>
-      <groupId>org.apache.maven.plugin-tools</groupId>
-      <artifactId>maven-plugin-annotations</artifactId>
-      <version>3.4</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-  
+	<properties>
+		<mavenVersion>3.0.4</mavenVersion>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.twdata.maven</groupId>
+			<artifactId>mojo-executor</artifactId>
+			<version>2.2.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.maven.plugin-tools</groupId>
+			<artifactId>maven-plugin-annotations</artifactId>
+			<version>3.2</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+
 </project>
diff --git a/pom.xml b/pom.xml
index 305acba..bc0a1da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -349,6 +349,24 @@
             </lifecycleMappingMetadata>
           </configuration>
         </plugin>
+        <!-- This is needed to use annotations in maven plugins with maven 3.0.x -->
+        <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-plugin-plugin</artifactId>
+            <version>3.2</version>
+            <configuration>
+                <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+            </configuration>
+            <executions>
+                <execution>
+                    <id>mojo-descriptor</id>
+                    <phase>process-classes</phase>
+                    <goals>
+                        <goal>descriptor</goal>
+                    </goals>
+                </execution>
+            </executions>
+        </plugin>
       </plugins>
     </pluginManagement>
   </build>

--
Gitblit v1.10.0