Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-3944: Make the 'generate-maven-artifacts' target use filtered POMs placed under lucene/build/poms/, rather than in each module's base directory. The 'clean' target now removes them.

Steven Rowec9393b968322
diff --git a/build.xml b/build.xml
index 392f7ffec2f..32cfd4fec86 100644
--- a/build.xml
+++ b/build.xml
@@ -77,13 +77,16 @@
</copy>
</target>
- <target name="generate-maven-artifacts" description="Generate Maven Artifacts for Lucene and Solr">
+ <target name="generate-maven-artifacts"
+ description="Generate Maven Artifacts for Lucene and Solr">
<property name="maven.dist.dir" location="dist/maven" />
<mkdir dir="${maven.dist.dir}" />
<sequential>
+ <ant dir="lucene" target="filter-pom-templates"/>
<subant target="generate-maven-artifacts" 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="modules" includes="build.xml" />
<fileset dir="solr" includes="build.xml" />
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index ea87e02b521..ba98721f27d 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -1065,6 +1065,11 @@ Build
* LUCENE-3762: Upgrade JUnit to 4.10, refactor state-machine of detecting
setUp/tearDown call chaining in LuceneTestCase. (Dawid Weiss, Robert Muir)
+* LUCENE-3944: Make the 'generate-maven-artifacts' target use filtered POMs
+ placed under lucene/build/poms/, rather than in each module's base
+ directory. The 'clean' target now removes them.
+ (Steve Rowe, Robert Muir)
+
======================= Lucene 3.5.0 =======================
diff --git a/lucene/build.xml b/lucene/build.xml
index 4e47e1aac59..5618da20447 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -450,13 +450,9 @@
</target>
- <target name="generate-maven-artifacts" depends="install-maven-tasks, package, javadocs">
+ <target name="generate-maven-artifacts"
+ depends="install-maven-tasks, filter-pom-templates, package, javadocs">
<sequential>
- <ant target="get-maven-poms" dir=".."/>
-
- <m2-deploy pom.xml="../pom.xml"/> <!-- Lucene/Solr grandparent POM -->
- <m2-deploy pom.xml="pom.xml"/> <!-- Lucene parent POM -->
-
<subant target="dist-maven" failonerror="true" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
<fileset dir="${common.dir}/core" includes="build.xml"/>
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 7f0672b6c34..28a4d25e708 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -196,6 +196,8 @@
<property name="gpg.exe" value="gpg" />
<property name="gpg.key" value="CODE SIGNING KEY" />
+ <property name="filtered.pom.templates.dir" location="${common.dir}/build/poms"/>
+
<property name="clover.db.dir" location="${common.dir}/build/test/clover/db"/>
<property name="clover.report.dir" location="${common.dir}/build/test/clover/reports"/>
@@ -399,7 +401,7 @@
<macrodef name="m2-deploy" description="Builds a Maven artifact">
<element name="artifact-attachments" optional="yes"/>
- <attribute name="pom.xml" default="pom.xml"/>
+ <attribute name="pom.xml"/>
<attribute name="jar.file" default="${build.dir}/${final.name}.jar"/>
<sequential>
<artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-7"/>
@@ -844,10 +846,23 @@
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath"/>
</target>
-
- <target name="dist-maven" if="pom.xml.present" depends="jar-core, jar-src, javadocs, install-maven-tasks">
+
+ <target name="dist-maven"
+ depends="filter-pom-templates, install-maven-tasks, m2-deploy-lucene-parent-pom, dist-maven-common"/>
+ <target name="dist-maven-common"
+ depends="jar-core, jar-src, javadocs, install-maven-tasks, filter-pom-templates">
<sequential>
- <m2-deploy>
+ <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>
+ <m2-deploy pom.xml="${pom.xml}">
<artifact-attachments>
<attach file="${build.dir}/${final.name}-src.jar"
classifier="sources"/>
@@ -858,6 +873,30 @@
</sequential>
</target>
+ <target name="filter-pom-templates" unless="filtered.pom.templates.uptodate">
+ <mkdir dir="${filtered.pom.templates.dir}"/>
+ <copy todir="${common.dir}/build/poms" overwrite="true">
+ <fileset dir="${common.dir}/../dev-tools/maven"/>
+ <filterset begintoken="@" endtoken="@">
+ <filter token="version" value="${version}"/>
+ </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="rat-sources-typedef">
<typedef resource="org/apache/rat/anttasks/antlib.xml" uri="antlib:rat.anttasks">
<classpath>
diff --git a/modules/grouping/build.xml b/modules/grouping/build.xml
index d6174dddd8c..68c6776bdb5 100644
--- a/modules/grouping/build.xml
+++ b/modules/grouping/build.xml
@@ -40,7 +40,6 @@
<path refid="base.classpath"/>
</path>
- <target name="dist-maven" depends="jar-core,javadocs,common.dist-maven" />
<target name="compile" depends="jar-queries,common.compile-core" description="Compiles facet classes" />
<target name="jar-core" depends="common.jar-core" />
diff --git a/modules/join/build.xml b/modules/join/build.xml
index 1f1060e553c..78f5b8c7f9c 100644
--- a/modules/join/build.xml
+++ b/modules/join/build.xml
@@ -21,6 +21,4 @@
</path>
<target name="init" depends="contrib-build.init,jar-grouping"/>
-
- <target name="dist-maven" depends="jar-core,javadocs,common.dist-maven" />
</project>
diff --git a/modules/queries/build.xml b/modules/queries/build.xml
index deceffd4571..5dbf50eec14 100644
--- a/modules/queries/build.xml
+++ b/modules/queries/build.xml
@@ -25,6 +25,4 @@
<property name="maven.dist.dir" location="../dist/maven"/>
<import file="../../lucene/contrib/contrib-build.xml"/>
-
- <target name="dist-maven" depends="jar-core,javadocs,common.dist-maven"/>
</project>
\ No newline at end of file
diff --git a/modules/queryparser/build.xml b/modules/queryparser/build.xml
index 60206c2c718..181edcb3eee 100644
--- a/modules/queryparser/build.xml
+++ b/modules/queryparser/build.xml
@@ -34,8 +34,6 @@
<target name="compile-core" depends="jar-queries,jar-sandbox,common.compile-core"/>
- <target name="dist-maven" depends="jar-core,javadocs,common.dist-maven"/>
-
<target name="javacc" depends="init,javacc-check,javacc-QueryParser,javacc-surround,javacc-flexible"/>
<target name="javacc-QueryParser" depends="init,javacc-check" if="javacc.present">
diff --git a/modules/suggest/build.xml b/modules/suggest/build.xml
index 39dc9151bec..8474ddcc091 100755
--- a/modules/suggest/build.xml
+++ b/modules/suggest/build.xml
@@ -28,6 +28,4 @@
<property name="maven.dist.dir" location="../dist/maven" />
<import file="../../lucene/contrib/contrib-build.xml"/>
-
- <target name="dist-maven" depends="jar-core,javadocs,common.dist-maven" />
</project>
diff --git a/solr/build.xml b/solr/build.xml
index b7377b2d079..e87650d45d3 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -537,8 +537,6 @@
<target name="generate-maven-artifacts" depends="install-maven-tasks">
<sequential>
- <ant target="get-maven-poms" dir=".." inheritall="false"/>
- <m2-deploy pom.xml="pom.xml"/> <!-- Solr parent POM -->
<subant target="dist-maven" inheritall="false" >
<fileset dir="core" includes="build.xml"/>
<fileset dir="solrj" includes="build.xml"/>
diff --git a/solr/common-build.xml b/solr/common-build.xml
index b57f2d3ac04..004ef4104ed 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -237,6 +237,15 @@
<solr-jarify basedir="${src.dir}" destfile="${build.dir}/${final.name}-src.jar"/>
</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, dist-maven-common"/>
+
<!-- Solr core targets -->
<target name="compile-solr-core" description="Compile Solr core." unless="solr.core.compiled">
<ant dir="${common-solr.dir}/core" target="compile-core" inheritAll="false">
diff --git a/solr/contrib/langid/build.xml b/solr/contrib/langid/build.xml
index 16683c5c1e9..1b3cf573c59 100644
--- a/solr/contrib/langid/build.xml
+++ b/solr/contrib/langid/build.xml
@@ -32,7 +32,7 @@
</path>
<dirname file="${ant.file.solr-langid}" property="solr-langid.dir"/>
- <target name="dist-maven" depends="jar-core,javadocs,jar-src,common.dist-maven">
+ <target name="dist-maven" depends="common-solr.dist-maven">
<m2-deploy-with-pom-template pom.xml="${solr-langid.dir}/lib/langdetect-pom.xml.template"
jar.file="${solr-langid.dir}/lib/langdetect-c51112119be53a81e59706ce57bacaa90c052284.jar" />
</target>
diff --git a/solr/webapp/build.xml b/solr/webapp/build.xml
index d34db9e4fd9..a0ce53c329b 100644
--- a/solr/webapp/build.xml
+++ b/solr/webapp/build.xml
@@ -69,7 +69,8 @@
</war>
</target>
- <target name="dist-maven" depends="dist" if="pom.xml.present">
- <m2-deploy jar.file="${dist}/apache-solr-${version}.war"/>
+ <target name="dist-maven" depends="dist, filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom">
+ <m2-deploy jar.file="${dist}/apache-solr-${version}.war"
+ pom.xml="${filtered.pom.templates.dir}/solr/webapp/pom.xml"/>
</target>
</project>