You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2017/09/07 13:24:56 UTC

[2/2] lucene-solr:master: SOLR-11181: fix validate-maven-dependencies

SOLR-11181: fix validate-maven-dependencies


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5324c743
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5324c743
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5324c743

Branch: refs/heads/master
Commit: 5324c7436c8ba578fa38d8e7fc8219abac154558
Parents: a864c62
Author: Steve Rowe <sa...@gmail.com>
Authored: Thu Sep 7 09:22:56 2017 -0400
Committer: Steve Rowe <sa...@gmail.com>
Committed: Thu Sep 7 09:24:02 2017 -0400

----------------------------------------------------------------------
 build.xml                 | 18 +++++++++++++-
 lucene/analysis/build.xml |  4 ++++
 lucene/build.xml          | 13 +++++++++++
 lucene/codecs/build.xml   |  2 ++
 lucene/common-build.xml   | 53 +++++++++++++++++++++++++++++++++++++++++-
 lucene/core/build.xml     |  2 ++
 solr/build.xml            | 16 ++++++++++++-
 solr/core/build.xml       |  2 ++
 solr/solrj/build.xml      |  2 ++
 solr/webapp/build.xml     |  3 +++
 10 files changed, 112 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index f2043e2..5335957 100755
--- a/build.xml
+++ b/build.xml
@@ -374,7 +374,23 @@
     </subant>
   </target>
 
-  <target name="validate-maven-dependencies" depends="generate-maven-artifacts"
+  <target name="-install-maven-artifacts" depends="resolve,resolve-groovy,resolve-markdown,install-maven-tasks">
+    <ant dir="lucene" inheritall="false">
+      <target name="-unpack-lucene-tgz"/>
+      <target name="-filter-pom-templates"/>
+      <propertyset refid="uptodate.and.compiled.properties"/>
+    </ant>
+    <ant dir="solr" target="-unpack-solr-tgz" inheritall="false">
+      <propertyset refid="uptodate.and.compiled.properties"/>
+    </ant>
+    <subant target="-install-to-maven-local-repo" inheritall="false" failonerror="true">
+      <fileset dir="lucene" includes="build.xml" />
+      <fileset dir="solr" includes="build.xml" />
+      <propertyset refid="uptodate.and.compiled.properties"/>
+    </subant>
+  </target>
+
+  <target name="validate-maven-dependencies" depends="-install-maven-artifacts"
           description="Validates maven dependencies, licenses, etc.">
     <subant target="-validate-maven-dependencies" inheritall="false" failonerror="true">
       <fileset dir="lucene" includes="build.xml"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/lucene/analysis/build.xml
----------------------------------------------------------------------
diff --git a/lucene/analysis/build.xml b/lucene/analysis/build.xml
index 5212cd6..844f5f3 100644
--- a/lucene/analysis/build.xml
+++ b/lucene/analysis/build.xml
@@ -125,6 +125,10 @@
     <forall-analyzers target="-dist-maven"/>
   </target>
 
+  <target name="-install-to-maven-local-repo">
+    <forall-analyzers target="-install-to-maven-local-repo"/>
+  </target>
+
   <target name="-validate-maven-dependencies">
     <forall-analyzers target="-validate-maven-dependencies"/>
   </target>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/lucene/build.xml
----------------------------------------------------------------------
diff --git a/lucene/build.xml b/lucene/build.xml
index 9397000..3aa4e42 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -428,6 +428,19 @@
     </sequential>
   </target>
 
+  <target name="-install-to-maven-local-repo" depends="install-maven-tasks">
+    <sequential>
+      <m2-install pom.xml="${filtered.pom.templates.dir}/pom.xml"/>        <!-- Lucene/Solr grandparent POM -->
+      <m2-install pom.xml="${filtered.pom.templates.dir}/lucene/pom.xml"/> <!-- Lucene parent POM -->
+      <subant target="-install-to-maven-local-repo" failonerror="true" inheritall="false">
+        <propertyset refid="uptodate.and.compiled.properties"/>
+        <fileset dir="${common.dir}/core" includes="build.xml"/>
+        <fileset dir="${common.dir}/test-framework" includes="build.xml"/>
+      </subant>
+      <modules-crawl target="-install-to-maven-local-repo"/>
+    </sequential>
+  </target>
+
   <target name="generate-maven-artifacts" depends="-unpack-lucene-tgz">
     <ant dir=".." target="resolve" inheritall="false"/>
     <antcall target="-filter-pom-templates" inheritall="false"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/lucene/codecs/build.xml
----------------------------------------------------------------------
diff --git a/lucene/codecs/build.xml b/lucene/codecs/build.xml
index b1bf5ac..c50af6c 100644
--- a/lucene/codecs/build.xml
+++ b/lucene/codecs/build.xml
@@ -23,4 +23,6 @@
   <import file="../module-build.xml"/>
 
   <target name="-dist-maven" depends="-dist-maven-src-java"/>
+
+  <target name="-install-to-maven-local-repo" depends="-install-src-java-to-maven-local-repo"/>
 </project>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/lucene/common-build.xml
----------------------------------------------------------------------
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 763fe8f..cc0b356 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -595,7 +595,20 @@
       </artifact:install>
     </sequential>
   </macrodef>
-  
+
+  <macrodef name="m2-install" description="Installs a Maven artifact into the local repository">
+    <element name="parent-poms" optional="yes"/>
+    <attribute name="pom.xml"/>
+    <attribute name="jar.file" default="${dist.jar.dir.prefix}-${version}/${dist.jar.dir.suffix}/${final.name}.jar"/>
+    <sequential>
+      <parent-poms/>
+      <artifact:pom id="maven.project" file="@{pom.xml}"/>
+      <artifact:install file="@{jar.file}">
+        <pom refid="maven.project"/>
+      </artifact:install>
+    </sequential>
+  </macrodef>
+
   <!-- validate maven dependencies -->
   <macrodef name="m2-validate-dependencies">
       <attribute name="pom.xml"/>
@@ -1713,6 +1726,44 @@ ${tests-output}/junit4-*.suites     - per-JVM executed suites
     </sequential>
   </target>
 
+  <target name="-install-to-maven-local-repo" depends="install-maven-tasks">
+    <sequential>
+      <property name="top.level.dir" location="${common.dir}/.."/>
+      <pathconvert property="pom.xml">
+        <mapper>
+          <chainedmapper>
+            <globmapper from="${top.level.dir}*" to="${filtered.pom.templates.dir}*"/>
+            <globmapper from="*build.xml" to="*pom.xml"/>
+          </chainedmapper>
+        </mapper>
+        <path location="${ant.file}"/>
+      </pathconvert>
+      <artifact:pom id="maven.project" file="${pom.xml}"/>
+      <artifact:install file="${dist.jar.dir.prefix}-${version}/${dist.jar.dir.suffix}/${final.name}.jar">
+        <pom refid="maven.project"/>
+      </artifact:install>
+    </sequential>
+  </target>
+
+  <target name="-install-src-java-to-maven-local-repo" depends="install-maven-tasks">
+    <sequential>
+      <property name="top.level.dir" location="${common.dir}/.."/>
+      <pathconvert property="pom.xml">
+        <mapper>
+          <chainedmapper>
+            <globmapper from="${top.level.dir}*" to="${filtered.pom.templates.dir}*"/>
+            <globmapper from="*build.xml" to="*/src/java/pom.xml"/>
+          </chainedmapper>
+        </mapper>
+        <path location="${ant.file}"/>
+      </pathconvert>
+      <artifact:pom id="maven.project" file="${pom.xml}"/>
+      <artifact:install file="${dist.jar.dir.prefix}-${version}/${dist.jar.dir.suffix}/${final.name}.jar">
+        <pom refid="maven.project"/>
+      </artifact:install>
+    </sequential>
+  </target>
+
   <target name="-dist-maven-src-java" depends="install-maven-tasks, jar-src, javadocs">
     <sequential>
       <property name="top.level.dir" location="${common.dir}/.."/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/lucene/core/build.xml
----------------------------------------------------------------------
diff --git a/lucene/core/build.xml b/lucene/core/build.xml
index 4e62e1c..d968798 100644
--- a/lucene/core/build.xml
+++ b/lucene/core/build.xml
@@ -64,6 +64,8 @@
 
   <target name="-dist-maven" depends="-dist-maven-src-java"/>
 
+  <target name="-install-to-maven-local-repo" depends="-install-src-java-to-maven-local-repo"/>
+
   <macrodef name="createLevAutomaton">
       <attribute name="n"/>
       <sequential>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/solr/build.xml
----------------------------------------------------------------------
diff --git a/solr/build.xml b/solr/build.xml
index 5048f1d..16d4201 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -709,7 +709,21 @@
       <contrib-crawl target="-dist-maven"/>
     </sequential>
   </target>
-  
+
+  <target name="-install-to-maven-local-repo" depends="install-maven-tasks">
+    <sequential>
+      <m2-install pom.xml="${filtered.pom.templates.dir}/solr/pom.xml"/>    <!-- Solr parent POM -->
+      <subant target="-install-to-maven-local-repo" inheritall="false">
+        <propertyset refid="uptodate.and.compiled.properties"/>
+        <fileset dir="core" includes="build.xml"/>
+        <fileset dir="solrj" includes="build.xml"/>
+        <fileset dir="test-framework" includes="build.xml"/>
+        <fileset dir="webapp" includes="build.xml"/>
+      </subant>
+      <contrib-crawl target="-install-to-maven-local-repo"/>
+    </sequential>
+  </target>
+
   <target name="generate-maven-artifacts" depends="-unpack-solr-tgz">
     <ant dir=".." target="resolve" inheritall="false"/>
     <antcall target="-filter-pom-templates" inheritall="false"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/solr/core/build.xml
----------------------------------------------------------------------
diff --git a/solr/core/build.xml b/solr/core/build.xml
index af4c262..f7a2a59 100644
--- a/solr/core/build.xml
+++ b/solr/core/build.xml
@@ -60,6 +60,8 @@
 
   <target name="-dist-maven" depends="-dist-maven-src-java"/>
 
+  <target name="-install-to-maven-local-repo" depends="-install-src-java-to-maven-local-repo"/>
+
   <target name="resolve" depends="ivy-availability-check,ivy-fail,ivy-configure">
     <sequential>
       <ivy:retrieve conf="compile,compile.hadoop" type="jar,bundle" sync="${ivy.sync}" log="download-only" symlink="${ivy.symlink}"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/solr/solrj/build.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/build.xml b/solr/solrj/build.xml
index 097171b..3393438 100644
--- a/solr/solrj/build.xml
+++ b/solr/solrj/build.xml
@@ -83,4 +83,6 @@
   </target>
 
   <target name="-dist-maven" depends="-dist-maven-src-java"/>
+
+  <target name="-install-to-maven-local-repo" depends="-install-src-java-to-maven-local-repo"/>
 </project>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5324c743/solr/webapp/build.xml
----------------------------------------------------------------------
diff --git a/solr/webapp/build.xml b/solr/webapp/build.xml
index 2ebe084..99f8d17 100644
--- a/solr/webapp/build.xml
+++ b/solr/webapp/build.xml
@@ -62,5 +62,8 @@
   <target name="-dist-maven"/>
 
   <!-- nothing to do -->
+  <target name="-install-to-maven-local-repo"/>
+
+  <!-- nothing to do -->
   <target name="-validate-maven-dependencies"/>
 </project>