SOLR-11181: fix validate-maven-dependencies

This commit is contained in:
Steve Rowe 2017-09-07 09:22:56 -04:00
parent a864c6289a
commit 5324c7436c
10 changed files with 112 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -61,6 +61,9 @@
<!-- nothing to do -->
<target name="-dist-maven"/>
<!-- nothing to do -->
<target name="-install-to-maven-local-repo"/>
<!-- nothing to do -->
<target name="-validate-maven-dependencies"/>
</project>