You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by dk...@apache.org on 2020/05/15 18:14:27 UTC

[avro] branch master updated: Update poms to use build-helper plugin to add additional directories so m2eclipse will import properly and compile works in eclipse

This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 69cc41c  Update poms to use build-helper plugin to add additional directories so m2eclipse will import properly and compile works in eclipse
69cc41c is described below

commit 69cc41c17eefd8a8e6c28cc5ed67a2246cbb1ca0
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Fri May 15 14:11:53 2020 -0400

    Update poms to use build-helper plugin to add additional directories so m2eclipse will import properly and compile works in eclipse
---
 lang/java/compiler/pom.xml | 21 +++++++++++++++++++--
 lang/java/ipc/pom.xml      | 30 ++++++++++++++++++++++++++++++
 lang/java/mapred/pom.xml   | 31 +++++++++++++++++++++++++++++++
 lang/java/pom.xml          |  5 +++++
 4 files changed, 85 insertions(+), 2 deletions(-)

diff --git a/lang/java/compiler/pom.xml b/lang/java/compiler/pom.xml
index cffcf81..f5ab944 100644
--- a/lang/java/compiler/pom.xml
+++ b/lang/java/compiler/pom.xml
@@ -131,7 +131,6 @@
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>
-        <version>3.0.0</version>
         <executions>
           <execution>
             <!--
@@ -140,7 +139,7 @@
               Here since general-purpose exec plugin is used for generating code, we need to manually
               add the sources.
             -->
-            <id>add-source</id>
+            <id>add-test-source</id>
             <phase>generate-test-sources</phase>
             <goals>
               <goal>add-test-source</goal>
@@ -151,6 +150,24 @@
               </sources>
             </configuration>
           </execution>
+          <execution>
+            <!--
+              Usually code is generated using a special-purpose maven plugin and the plugin
+              automatically adds the generated sources into project.
+              Here since general-purpose exec plugin is used for generating code, we need to manually
+              add the sources.
+            -->
+            <id>add-source</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>${project.basedir}/target/generated-sources/javacc</source>
+              </sources>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
     </plugins>
diff --git a/lang/java/ipc/pom.xml b/lang/java/ipc/pom.xml
index 554476a..a0e3fbb 100644
--- a/lang/java/ipc/pom.xml
+++ b/lang/java/ipc/pom.xml
@@ -104,6 +104,36 @@
           </archive>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>add-test-source</id>
+            <phase>generate-test-sources</phase>
+            <goals>
+              <goal>add-test-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>${project.basedir}/target/generated-test-sources/java</source>
+              </sources>
+            </configuration>
+          </execution>
+          <execution>
+            <id>add-source</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>${project.basedir}/target/generated-sources/java</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 
diff --git a/lang/java/mapred/pom.xml b/lang/java/mapred/pom.xml
index 8e3b47c..c9a10de 100644
--- a/lang/java/mapred/pom.xml
+++ b/lang/java/mapred/pom.xml
@@ -134,6 +134,37 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>add-test-source</id>
+            <phase>generate-test-sources</phase>
+            <goals>
+              <goal>add-test-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>${project.basedir}/target/generated-test-sources/java</source>
+                <source>${project.basedir}/target/generated-test-sources/avro</source>
+              </sources>
+            </configuration>
+          </execution>
+          <execution>
+            <id>add-source</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>${project.basedir}/target/generated-sources/java</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 
diff --git a/lang/java/pom.xml b/lang/java/pom.xml
index 4a60665..3a07441 100644
--- a/lang/java/pom.xml
+++ b/lang/java/pom.xml
@@ -104,6 +104,11 @@
     <pluginManagement>
       <plugins>
         <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>build-helper-maven-plugin</artifactId>
+          <version>3.1.0</version>
+        </plugin>
+        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>${compiler-plugin.version}</version>