Skip to content

Apache Lucene open-source search software

LUCENE-5322: Clean up / simplify Maven-related Ant targets

Steven Rowe9990a2eab983
diff --git a/build.xml b/build.xml
index 1313399d939..0e668bc09d2 100644
--- a/build.xml
+++ b/build.xml
@@ -136,8 +136,10 @@
<property name="version" value="5.0-SNAPSHOT"/>
<property name="maven-build-dir" value="maven-build"/>
<property name="maven-version" value="2.2.1"/>
-
- <target name="get-maven-poms" depends="resolve"
+
+ <property name="maven.dependencies.filters.file" location="lucene/build/maven.dependencies.filters.properties"/>
+
+ <target name="get-maven-poms" depends="resolve"
description="Copy Maven POMs from dev-tools/maven/ to maven-build/">
<ant dir="lucene" target="-get-maven-poms" inheritall="false"/>
</target>
@@ -147,14 +149,17 @@
<delete failonerror="true" dir="${maven-build-dir}/"/>
</target>
- <target name="generate-maven-artifacts"
+ <target name="generate-maven-artifacts" depends="resolve"
description="Generate Maven Artifacts for Lucene and Solr">
<property name="maven.dist.dir" location="dist/maven" />
<mkdir dir="${maven.dist.dir}" />
- <ant dir="lucene" target="filter-pom-templates"/>
- <subant target="generate-maven-artifacts" inheritall="false" failonerror="true">
+ <ant dir="lucene" inheritall="false">
+ <target name="-unpack-lucene-tgz"/>
+ <target name="-filter-pom-templates"/>
+ </ant>
+ <ant dir="solr" target="-unpack-solr-tgz" inheritall="false"/>
+ <subant target="-dist-maven" inheritall="false" failonerror="true">
<property name="maven.dist.dir" location="${maven.dist.dir}" />
- <property name="filtered.pom.templates.uptodate" value="true"/>
<fileset dir="lucene" includes="build.xml" />
<fileset dir="solr" includes="build.xml" />
</subant>
@@ -163,7 +168,6 @@
<target name="validate-maven-dependencies" depends="generate-maven-artifacts"
description="Validates maven dependencies, licenses, etc.">
<subant target="-validate-maven-dependencies" inheritall="false" failonerror="true">
- <property name="filtered.pom.templates.uptodate" value="true"/>
<fileset dir="lucene" includes="build.xml"/>
<fileset dir="solr" includes="build.xml"/>
</subant>
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 697c0afea2b..3eb611d7a46 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -254,6 +254,9 @@ Build
transitive dependency resolution for all depended-on artifacts by putting
an exclusion for each transitive dependency in the <dependencyManagement>
section of the grandparent POM. (Steve Rowe)
+
+* LUCENE-5322: Clean up / simplify Maven-related Ant targets.
+ (Steve Rowe)
Tests
diff --git a/lucene/analysis/build.xml b/lucene/analysis/build.xml
index 59e7cc45b9c..c0c16e3d53d 100644
--- a/lucene/analysis/build.xml
+++ b/lucene/analysis/build.xml
@@ -114,8 +114,8 @@
<target name="build-artifacts-and-tests" depends="default,compile-test" />
- <target name="dist-maven">
- <forall-analyzers target="dist-maven"/>
+ <target name="-dist-maven">
+ <forall-analyzers target="-dist-maven"/>
</target>
<target name="-validate-maven-dependencies">
diff --git a/lucene/build.xml b/lucene/build.xml
index 05ee2bb69b1..ee10754ccec 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -512,19 +512,26 @@
</target>
- <!-- install-maven-tasks is *not* a useless dependency. do not remove -->
- <target name="generate-maven-artifacts" depends="install-maven-tasks">
+ <target name="-dist-maven" depends="install-maven-tasks">
<sequential>
- <subant target="dist-maven" failonerror="true" inheritall="false">
- <propertyset refid="uptodate.and.compiled.properties"/>
+ <m2-deploy pom.xml="${filtered.pom.templates.dir}/pom.xml"/> <!-- Lucene/Solr grandparent POM -->
+ <m2-deploy pom.xml="${filtered.pom.templates.dir}/lucene/pom.xml"/> <!-- Lucene parent POM -->
+ <subant target="-dist-maven" failonerror="true" inheritall="false">
<fileset dir="${common.dir}/core" includes="build.xml"/>
<fileset dir="${common.dir}/test-framework" includes="build.xml"/>
</subant>
-
- <modules-crawl target="dist-maven"/>
+ <modules-crawl target="-dist-maven"/>
</sequential>
</target>
-
+
+ <target name="generate-maven-artifacts" depends="-unpack-lucene-tgz">
+ <sequential>
+ <ant dir=".." target="resolve" inheritall="false"/>
+ <antcall target="-filter-pom-templates" inheritall="false"/>
+ <antcall target="-dist-maven" inheritall="false"/>
+ </sequential>
+ </target>
+
<target name="-validate-maven-dependencies" depends="compile-tools, install-maven-tasks, load-custom-tasks">
<sequential>
<subant target="-validate-maven-dependencies" failonerror="true" inheritall="false">
diff --git a/lucene/codecs/build.xml b/lucene/codecs/build.xml
index aadf909e353..b1bf5acfc47 100644
--- a/lucene/codecs/build.xml
+++ b/lucene/codecs/build.xml
@@ -22,5 +22,5 @@
<import file="../module-build.xml"/>
- <target name="dist-maven" depends="dist-maven-src-java"/>
+ <target name="-dist-maven" depends="-dist-maven-src-java"/>
</project>
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index c097f1e0fef..12725747165 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -1381,10 +1381,7 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
classpathref="maven-ant-tasks.classpath"/>
</target>
- <target name="dist-maven"
- depends="filter-pom-templates, install-maven-tasks, m2-deploy-lucene-parent-pom, -unpack-lucene-tgz, dist-maven-common"/>
- <target name="dist-maven-common"
- depends="jar-src, javadocs, install-maven-tasks, filter-pom-templates">
+ <target name="-dist-maven" depends="install-maven-tasks, jar-src, javadocs">
<sequential>
<property name="top.level.dir" location="${common.dir}/.."/>
<pathconvert property="pom.xml">
@@ -1407,10 +1404,7 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
</sequential>
</target>
- <target name="dist-maven-src-java"
- depends="filter-pom-templates, install-maven-tasks, m2-deploy-lucene-parent-pom, -unpack-lucene-tgz, dist-maven-common-src-java"/>
- <target name="dist-maven-common-src-java"
- depends="-unpack-lucene-tgz, jar-src, javadocs, install-maven-tasks, filter-pom-templates">
+ <target name="-dist-maven-src-java" depends="install-maven-tasks, jar-src, javadocs">
<sequential>
<property name="top.level.dir" location="${common.dir}/.."/>
<pathconvert property="pom.xml">
@@ -1433,7 +1427,7 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
</sequential>
</target>
- <target name="-validate-maven-dependencies.init" depends="filter-pom-templates">
+ <target name="-validate-maven-dependencies.init" depends="-filter-pom-templates">
<!-- find the correct pom.xml path and assigns it to property pom.xml -->
<property name="top.level.dir" location="${common.dir}/.."/>
<pathconvert property="maven.pom.xml">
@@ -1492,10 +1486,8 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
</target>
<property name="maven.dependencies.filters.file" location="${common.build.dir}/maven.dependencies.filters.properties"/>
- <available file="${maven.dependencies.filters.file}" property="maven.dependencies.filters.file.exists"/>
- <target name="-get-maven-dependencies" depends="compile-tools,resolve,load-custom-tasks"
- unless="maven.dependencies.filters.file.exists">
+ <target name="-get-maven-dependencies" depends="compile-tools,load-custom-tasks">
<ant dir="${common.dir}/.." target="-append-all-modules-dependencies-properties" inheritall="false"/>
<get-maven-dependencies-macro
dir="${common.dir}/.."
@@ -1518,7 +1510,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
</copy>
</target>
- <target name="filter-pom-templates" depends="-get-maven-dependencies" unless="filtered.pom.templates.uptodate">
+ <target name="-filter-pom-templates" depends="-get-maven-dependencies">
<mkdir dir="${filtered.pom.templates.dir}"/>
<copy todir="${common.dir}/build/poms" overwrite="true" encoding="UTF-8" filtering="on">
<fileset dir="${common.dir}/../dev-tools/maven"/>
@@ -1530,19 +1522,6 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
</filterset>
<globmapper from="*.template" to="*"/>
</copy>
- <property name="filtered.pom.templates.uptodate" value="true"/>
- </target>
-
- <target name="m2-deploy-lucene-parent-pom" depends="filter-pom-templates,m2-deploy-grandparent-pom"
- unless="deployed.lucene.parent.pom.uptodate">
- <m2-deploy pom.xml="${filtered.pom.templates.dir}/lucene/pom.xml"/> <!-- Lucene parent POM -->
- <property name="deployed.lucene.parent.pom.uptodate" value="true"/>
- </target>
-
- <target name="m2-deploy-grandparent-pom" depends="filter-pom-templates"
- unless="deployed.grandparent.pom.uptodate">
- <m2-deploy pom.xml="${filtered.pom.templates.dir}/pom.xml"/> <!-- Lucene/Solr grandparent POM -->
- <property name="deployed.grandparent.pom.uptodate" value="true"/>
</target>
<target name="stage-maven-artifacts">
diff --git a/lucene/core/build.xml b/lucene/core/build.xml
index 105a183b870..8b137f1568e 100644
--- a/lucene/core/build.xml
+++ b/lucene/core/build.xml
@@ -59,7 +59,7 @@
</sequential>
</target>
- <target name="dist-maven" depends="dist-maven-src-java"/>
+ <target name="-dist-maven" depends="-dist-maven-src-java"/>
<macrodef name="createLevAutomaton">
<attribute name="n"/>
diff --git a/solr/build.xml b/solr/build.xml
index 7483a65d6bd..b2a56e41932 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -603,26 +603,26 @@
<contrib-crawl target="-ecj-javadoc-lint"/>
</target>
- <!-- install-maven-tasks and define-lucene-javadoc-url are *not* a useless dependencies. Do not remove! -->
- <target name="generate-maven-artifacts" depends="install-maven-tasks,define-lucene-javadoc-url">
+ <target name="-dist-maven" depends="install-maven-tasks">
<sequential>
- <subant target="dist-maven" inheritall="false" >
- <propertyset refid="uptodate.and.compiled.properties"/>
+ <m2-deploy pom.xml="${filtered.pom.templates.dir}/solr/pom.xml"/> <!-- Solr parent POM -->
+ <subant target="-dist-maven" inheritall="false" >
<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="dist-maven"/>
+ <contrib-crawl target="-dist-maven"/>
</sequential>
</target>
-
- <!-- only used by validate below, it needs the lucene artifacts installed: can we do this better?! -->
- <target name="-generate-lucene-maven-artifacts">
- <subant target="generate-maven-artifacts" inheritall="false">
- <propertyset refid="uptodate.and.compiled.properties"/>
- <fileset dir="${common.dir}" includes="build.xml"/>
- </subant>
+
+ <!-- define-lucene-javadoc-url is *not* a useless dependencies. Do not remove! -->
+ <target name="generate-maven-artifacts" depends="define-lucene-javadoc-url,-unpack-solr-tgz">
+ <sequential>
+ <ant dir=".." target="resolve" inheritall="false"/>
+ <antcall target="-filter-pom-templates" inheritall="false"/>
+ <antcall target="-dist-maven" inheritall="false"/>
+ </sequential>
</target>
<target name="-validate-maven-dependencies" depends="compile-tools, install-maven-tasks, load-custom-tasks">
diff --git a/solr/common-build.xml b/solr/common-build.xml
index 26f84c7dee1..4ed25d722c6 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -334,18 +334,6 @@
</sequential>
</target>
- <target name="m2-deploy-solr-parent-pom" depends="filter-pom-templates"
- unless="deployed.solr.parent.pom.uptodate">
- <m2-deploy pom.xml="${filtered.pom.templates.dir}/solr/pom.xml"/> <!-- Solr parent POM -->
- <property name="deployed.solr.parent.pom.uptodate" value="true"/>
- </target>
-
- <target name="dist-maven"
- depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, -unpack-solr-tgz, dist-maven-common"/>
-
- <target name="dist-maven-src-java"
- depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, -unpack-solr-tgz, dist-maven-common-src-java"/>
-
<target name="-validate-maven-dependencies" depends="-validate-maven-dependencies.init">
<m2-validate-dependencies pom.xml="${maven.pom.xml}" licenseDirectory="${license.dir}">
<additional-filters>
diff --git a/solr/core/build.xml b/solr/core/build.xml
index 053e45ccd64..58a33116e76 100644
--- a/solr/core/build.xml
+++ b/solr/core/build.xml
@@ -48,7 +48,7 @@
</sequential>
</target>
- <target name="dist-maven" depends="dist-maven-src-java"/>
+ <target name="-dist-maven" depends="-dist-maven-src-java"/>
<target name="resolve" depends="ivy-availability-check,ivy-fail,ivy-configure">
<sequential>
diff --git a/solr/solrj/build.xml b/solr/solrj/build.xml
index 587bbd4a66d..72f796114c8 100644
--- a/solr/solrj/build.xml
+++ b/solr/solrj/build.xml
@@ -70,5 +70,5 @@
</copy>
</target>
- <target name="dist-maven" depends="dist-maven-src-java"/>
+ <target name="-dist-maven" depends="-dist-maven-src-java"/>
</project>
diff --git a/solr/webapp/build.xml b/solr/webapp/build.xml
index 6a519b7143b..f8e45dd0cf6 100644
--- a/solr/webapp/build.xml
+++ b/solr/webapp/build.xml
@@ -64,7 +64,7 @@
</target>
<!-- nothing to do -->
- <target name="dist-maven"/>
+ <target name="-dist-maven"/>
<!-- nothing to do -->
<target name="-validate-maven-dependencies"/>