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.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1309141 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2012-04-03 20:52:02 +00:00
parent ca8aa6a7ee
commit c9393b9683
13 changed files with 67 additions and 25 deletions

View File

@ -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" />

View File

@ -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 =======================

View File

@ -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"/>

View File

@ -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>

View File

@ -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" />

View File

@ -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>

View File

@ -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>

View File

@ -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">

View File

@ -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>

View File

@ -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"/>

View File

@ -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">

View File

@ -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>

View File

@ -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>