LUCENE-5273: Binary artifacts in Lucene and Solr convenience binary distributions accompanying a release, including on Maven Central, should be identical across all distributions.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1531354 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2013-10-11 16:58:36 +00:00
parent 0d4e91abe9
commit 6f06bb1708
8 changed files with 170 additions and 95 deletions

View File

@ -249,8 +249,12 @@ def checkJARMetaData(desc, jarFile, svnRevision, version):
def normSlashes(path): def normSlashes(path):
return path.replace(os.sep, '/') return path.replace(os.sep, '/')
def checkAllJARs(topDir, project, svnRevision, version): def checkAllJARs(topDir, project, svnRevision, version, tmpDir, baseURL):
print(' verify JAR/WAR metadata...') print(' verify JAR metadata/identity/no javax.* or java.* classes...')
if project == 'solr':
luceneDistFilenames = dict()
for file in getBinaryDistFiles('lucene', tmpDir, version, baseURL):
luceneDistFilenames[os.path.basename(file)] = file
for root, dirs, files in os.walk(topDir): for root, dirs, files in os.walk(topDir):
normRoot = normSlashes(root) normRoot = normSlashes(root)
@ -272,29 +276,54 @@ def checkAllJARs(topDir, project, svnRevision, version):
noJavaPackageClasses('JAR file "%s"' % fullPath, fullPath) noJavaPackageClasses('JAR file "%s"' % fullPath, fullPath)
if file.lower().find('lucene') != -1 or file.lower().find('solr') != -1: if file.lower().find('lucene') != -1 or file.lower().find('solr') != -1:
checkJARMetaData('JAR file "%s"' % fullPath, fullPath, svnRevision, version) checkJARMetaData('JAR file "%s"' % fullPath, fullPath, svnRevision, version)
if project == 'solr' and file.lower().find('lucene') != -1:
jarFilename = os.path.basename(file)
if jarFilename not in luceneDistFilenames:
raise RuntimeError('Artifact %s is not present in Lucene binary distribution' % fullPath)
identical = filecmp.cmp(fullPath, luceneDistFilenames[jarFilename], shallow=False)
if not identical:
raise RuntimeError('Artifact %s is not identical to %s in Lucene binary distribution'
% (fullPath, luceneDistFilenames[jarFilename]))
def checkSolrWAR(warFileName, svnRevision, version): def checkSolrWAR(warFileName, svnRevision, version, tmpDir, baseURL):
""" """
Crawls for JARs inside the WAR and ensures there are no classes Crawls for JARs inside the WAR and ensures there are no classes
under java.* or javax.* namespace. under java.* or javax.* namespace.
""" """
print(' make sure WAR file has no javax.* or java.* classes...') print(' verify WAR metadata/contained JAR identity/no javax.* or java.* classes...')
checkJARMetaData(warFileName, warFileName, svnRevision, version) checkJARMetaData(warFileName, warFileName, svnRevision, version)
distFilenames = dict()
for file in getBinaryDistFiles('lucene', tmpDir, version, baseURL):
distFilenames[os.path.basename(file)] = file
with zipfile.ZipFile(warFileName, 'r') as z: with zipfile.ZipFile(warFileName, 'r') as z:
for name in z.namelist(): for name in z.namelist():
if name.endswith('.jar'): if name.endswith('.jar'):
jarInsideWarContents = z.read(name)
noJavaPackageClasses('JAR file %s inside WAR file %s' % (name, warFileName), noJavaPackageClasses('JAR file %s inside WAR file %s' % (name, warFileName),
io.BytesIO(z.read(name))) io.BytesIO(jarInsideWarContents))
if name.lower().find('lucene') != -1 or name.lower().find('solr') != -1: if name.lower().find('lucene') != -1 or name.lower().find('solr') != -1:
checkJARMetaData('JAR file %s inside WAR file %s' % (name, warFileName), checkJARMetaData('JAR file %s inside WAR file %s' % (name, warFileName),
io.BytesIO(z.read(name)), io.BytesIO(jarInsideWarContents),
svnRevision, svnRevision,
version) version)
if name.lower().find('lucene') != -1:
jarInsideWarFilename = os.path.basename(name)
if jarInsideWarFilename not in distFilenames:
raise RuntimeError('Artifact %s in %s is not present in Lucene binary distribution'
% (name, warFileName))
distJarName = distFilenames[jarInsideWarFilename]
with open(distJarName, "rb", buffering=0) as distJarFile:
distJarContents = distJarFile.readall()
if jarInsideWarContents != distJarContents:
raise RuntimeError('Artifact %s in %s is not identical to %s in Lucene binary distribution'
% (name, warFileName, distJarName))
def checkSigs(project, urlString, version, tmpDir, isSigned): def checkSigs(project, urlString, version, tmpDir, isSigned):
@ -575,7 +604,7 @@ def getDirEntries(urlString):
if text == 'Parent Directory' or text == '..': if text == 'Parent Directory' or text == '..':
return links[(i+1):] return links[(i+1):]
def unpackAndVerify(project, tmpDir, artifact, svnRevision, version, testArgs): def unpackAndVerify(project, tmpDir, artifact, svnRevision, version, testArgs, baseURL):
destDir = '%s/unpack' % tmpDir destDir = '%s/unpack' % tmpDir
if os.path.exists(destDir): if os.path.exists(destDir):
shutil.rmtree(destDir) shutil.rmtree(destDir)
@ -595,14 +624,14 @@ def unpackAndVerify(project, tmpDir, artifact, svnRevision, version, testArgs):
raise RuntimeError('unpack produced entries %s; expected only %s' % (l, expected)) raise RuntimeError('unpack produced entries %s; expected only %s' % (l, expected))
unpackPath = '%s/%s' % (destDir, expected) unpackPath = '%s/%s' % (destDir, expected)
verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs) verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs, tmpDir, baseURL)
LUCENE_NOTICE = None LUCENE_NOTICE = None
LUCENE_LICENSE = None LUCENE_LICENSE = None
SOLR_NOTICE = None SOLR_NOTICE = None
SOLR_LICENSE = None SOLR_LICENSE = None
def verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs): def verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs, tmpDir, baseURL):
global LUCENE_NOTICE global LUCENE_NOTICE
global LUCENE_LICENSE global LUCENE_LICENSE
global SOLR_NOTICE global SOLR_NOTICE
@ -720,13 +749,13 @@ def verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs
else: else:
checkAllJARs(os.getcwd(), project, svnRevision, version) checkAllJARs(os.getcwd(), project, svnRevision, version, tmpDir, baseURL)
if project == 'lucene': if project == 'lucene':
testDemo(isSrc, version, '1.7') testDemo(isSrc, version, '1.7')
else: else:
checkSolrWAR('%s/example/webapps/solr.war' % unpackPath, svnRevision, version) checkSolrWAR('%s/example/webapps/solr.war' % unpackPath, svnRevision, version, tmpDir, baseURL)
print(' copying unpacked distribution for Java 7 ...') print(' copying unpacked distribution for Java 7 ...')
java7UnpackPath = '%s-java7' %unpackPath java7UnpackPath = '%s-java7' %unpackPath
@ -913,11 +942,10 @@ def checkMaven(baseURL, tmpDir, svnRevision, version, isSigned):
if text == releaseBranchText: if text == releaseBranchText:
releaseBranchSvnURL = subURL releaseBranchSvnURL = subURL
print(' get POM templates', end=' ')
POMtemplates = defaultdict() POMtemplates = defaultdict()
getPOMtemplates(POMtemplates, tmpDir, releaseBranchSvnURL) getPOMtemplates(POMtemplates, tmpDir, releaseBranchSvnURL)
print() print()
print(' download artifacts', end=' ') print(' download artifacts')
artifacts = {'lucene': [], 'solr': []} artifacts = {'lucene': [], 'solr': []}
for project in ('lucene', 'solr'): for project in ('lucene', 'solr'):
artifactsURL = '%s/%s/maven/org/apache/%s' % (baseURL, project, project) artifactsURL = '%s/%s/maven/org/apache/%s' % (baseURL, project, project)
@ -926,50 +954,47 @@ def checkMaven(baseURL, tmpDir, svnRevision, version, isSigned):
os.makedirs(targetDir) os.makedirs(targetDir)
crawl(artifacts[project], artifactsURL, targetDir) crawl(artifacts[project], artifactsURL, targetDir)
print() print()
print(' verify that each binary artifact has a deployed POM...')
verifyPOMperBinaryArtifact(artifacts, version) verifyPOMperBinaryArtifact(artifacts, version)
print(' verify that there is an artifact for each POM template...')
verifyArtifactPerPOMtemplate(POMtemplates, artifacts, tmpDir, version) verifyArtifactPerPOMtemplate(POMtemplates, artifacts, tmpDir, version)
print(" verify Maven artifacts' md5/sha1 digests...")
verifyMavenDigests(artifacts) verifyMavenDigests(artifacts)
print(' check for javadoc and sources artifacts...')
checkJavadocAndSourceArtifacts(artifacts, version) checkJavadocAndSourceArtifacts(artifacts, version)
print(" verify deployed POMs' coordinates...")
verifyDeployedPOMsCoordinates(artifacts, version) verifyDeployedPOMsCoordinates(artifacts, version)
if isSigned: if isSigned:
print(' verify maven artifact sigs', end=' ')
verifyMavenSigs(baseURL, tmpDir, artifacts) verifyMavenSigs(baseURL, tmpDir, artifacts)
distributionFiles = getDistributionsForMavenChecks(tmpDir, version, baseURL) distFiles = getBinaryDistFilesForMavenChecks(tmpDir, version, baseURL)
checkIdenticalMavenArtifacts(distFiles, artifacts, version)
print(' verify that Maven artifacts are same as in the binary distribution...') checkAllJARs('%s/maven/org/apache/lucene' % tmpDir, 'lucene', svnRevision, version, tmpDir, baseURL)
checkIdenticalMavenArtifacts(distributionFiles, artifacts, version) checkAllJARs('%s/maven/org/apache/solr' % tmpDir, 'solr', svnRevision, version, tmpDir, baseURL)
checkAllJARs('%s/maven/org/apache/lucene' % tmpDir, 'lucene', svnRevision, version) def getBinaryDistFilesForMavenChecks(tmpDir, version, baseURL):
checkAllJARs('%s/maven/org/apache/solr' % tmpDir, 'solr', svnRevision, version) distFiles = defaultdict()
def getDistributionsForMavenChecks(tmpDir, version, baseURL):
distributionFiles = defaultdict()
for project in ('lucene', 'solr'): for project in ('lucene', 'solr'):
distFiles[project] = getBinaryDistFiles(project, tmpDir, version, baseURL)
return distFiles
def getBinaryDistFiles(project, tmpDir, version, baseURL):
distribution = '%s-%s.tgz' % (project, version) distribution = '%s-%s.tgz' % (project, version)
if not os.path.exists('%s/%s' % (tmpDir, distribution)): if not os.path.exists('%s/%s' % (tmpDir, distribution)):
distURL = '%s/%s/%s' % (baseURL, project, distribution) distURL = '%s/%s/%s' % (baseURL, project, distribution)
print(' download %s...' % distribution, end=' ') print(' download %s...' % distribution, end=' ')
download(distribution, distURL, tmpDir) download(distribution, distURL, tmpDir)
destDir = '%s/unpack-%s-maven' % (tmpDir, project) destDir = '%s/unpack-%s-getBinaryDistFiles' % (tmpDir, project)
if os.path.exists(destDir): if os.path.exists(destDir):
shutil.rmtree(destDir) shutil.rmtree(destDir)
os.makedirs(destDir) os.makedirs(destDir)
os.chdir(destDir) os.chdir(destDir)
print(' unpack %s...' % distribution) print(' unpack %s...' % distribution)
unpackLogFile = '%s/unpack-%s-maven-checks.log' % (tmpDir, distribution) unpackLogFile = '%s/unpack-%s-getBinaryDistFiles.log' % (tmpDir, distribution)
run('tar xzf %s/%s' % (tmpDir, distribution), unpackLogFile) run('tar xzf %s/%s' % (tmpDir, distribution), unpackLogFile)
distributionFiles[project] = [] distributionFiles = []
for root, dirs, files in os.walk(destDir): for root, dirs, files in os.walk(destDir):
distributionFiles[project].extend([os.path.join(root, file) for file in files]) distributionFiles.extend([os.path.join(root, file) for file in files])
return distributionFiles return distributionFiles
def checkJavadocAndSourceArtifacts(artifacts, version): def checkJavadocAndSourceArtifacts(artifacts, version):
print(' check for javadoc and sources artifacts...')
for project in ('lucene', 'solr'): for project in ('lucene', 'solr'):
for artifact in artifacts[project]: for artifact in artifacts[project]:
if artifact.endswith(version + '.jar'): if artifact.endswith(version + '.jar'):
@ -989,35 +1014,28 @@ def getZipFileEntries(fileName):
entries.sort() entries.sort()
return entries return entries
def checkIdenticalMavenArtifacts(distributionFiles, artifacts, version): def checkIdenticalMavenArtifacts(distFiles, artifacts, version):
print(' verify that Maven artifacts are same as in the binary distribution...')
reJarWar = re.compile(r'%s\.[wj]ar$' % version) # exclude *-javadoc.jar and *-sources.jar reJarWar = re.compile(r'%s\.[wj]ar$' % version) # exclude *-javadoc.jar and *-sources.jar
for project in ('lucene', 'solr'): for project in ('lucene', 'solr'):
distFilenames = dict() distFilenames = dict()
for file in distributionFiles[project]: for file in distFiles[project]:
baseName = os.path.basename(file) baseName = os.path.basename(file)
distFilenames[baseName] = file distFilenames[baseName] = file
for artifact in artifacts[project]: for artifact in artifacts[project]:
if reJarWar.search(artifact): if reJarWar.search(artifact):
entries = getZipFileEntries(artifact)
artifactFilename = os.path.basename(artifact) artifactFilename = os.path.basename(artifact)
if artifactFilename not in distFilenames: if artifactFilename not in distFilenames:
raise RuntimeError('Maven artifact %s is not present in %s binary distribution' raise RuntimeError('Maven artifact %s is not present in %s binary distribution'
% (artifact, project)) % (artifact, project))
else: else:
binaryEntries = getZipFileEntries(distFilenames[artifactFilename]) identical = filecmp.cmp(artifact, distFilenames[artifactFilename], shallow=False)
if binaryEntries != entries: if not identical:
raise RuntimeError('Maven artifact %s has different contents than binary distribution\n maven:\n%s\n binary:\n%s\n' % \ raise RuntimeError('Maven artifact %s is not identical to %s in %s binary distribution'
(artifactFilename, % (artifact, distFilenames[artifactFilename], project))
'\n'.join(entries),
'\n'.join(binaryEntries)))
# TODO: Either fix the build to ensure that maven artifacts *are* identical, or recursively compare contents
# identical = filecmp.cmp(artifact, distFilenames[artifactFilename], shallow=False)
# if not identical:
# raise RuntimeError('Maven artifact %s is not identical to %s in %s binary distribution'
# % (artifact, distFilenames[artifactFilename], project))
def verifyMavenDigests(artifacts): def verifyMavenDigests(artifacts):
print(" verify Maven artifacts' md5/sha1 digests...")
reJarWarPom = re.compile(r'\.(?:[wj]ar|pom)$') reJarWarPom = re.compile(r'\.(?:[wj]ar|pom)$')
for project in ('lucene', 'solr'): for project in ('lucene', 'solr'):
for artifactFile in [a for a in artifacts[project] if reJarWarPom.search(a)]: for artifactFile in [a for a in artifacts[project] if reJarWarPom.search(a)]:
@ -1064,7 +1082,7 @@ def getPOMcoordinate(treeRoot):
return groupId, artifactId, packaging, version return groupId, artifactId, packaging, version
def verifyMavenSigs(baseURL, tmpDir, artifacts): def verifyMavenSigs(baseURL, tmpDir, artifacts):
"""Verify Maven artifact signatures""" print(' verify maven artifact sigs', end=' ')
for project in ('lucene', 'solr'): for project in ('lucene', 'solr'):
keysFile = '%s/%s.KEYS' % (tmpDir, project) keysFile = '%s/%s.KEYS' % (tmpDir, project)
if not os.path.exists(keysFile): if not os.path.exists(keysFile):
@ -1114,7 +1132,7 @@ def verifyMavenSigs(baseURL, tmpDir, artifacts):
print() print()
def verifyPOMperBinaryArtifact(artifacts, version): def verifyPOMperBinaryArtifact(artifacts, version):
"""verify that each binary jar and war has a corresponding POM file""" print(' verify that each binary artifact has a deployed POM...')
reBinaryJarWar = re.compile(r'%s\.[jw]ar$' % re.escape(version)) reBinaryJarWar = re.compile(r'%s\.[jw]ar$' % re.escape(version))
for project in ('lucene', 'solr'): for project in ('lucene', 'solr'):
for artifact in [a for a in artifacts[project] if reBinaryJarWar.search(a)]: for artifact in [a for a in artifacts[project] if reBinaryJarWar.search(a)]:
@ -1127,6 +1145,7 @@ def verifyDeployedPOMsCoordinates(artifacts, version):
verify that each POM's coordinate (drawn from its content) matches verify that each POM's coordinate (drawn from its content) matches
its filepath, and verify that the corresponding artifact exists. its filepath, and verify that the corresponding artifact exists.
""" """
print(" verify deployed POMs' coordinates...")
for project in ('lucene', 'solr'): for project in ('lucene', 'solr'):
for POM in [a for a in artifacts[project] if a.endswith('.pom')]: for POM in [a for a in artifacts[project] if a.endswith('.pom')]:
treeRoot = ET.parse(POM).getroot() treeRoot = ET.parse(POM).getroot()
@ -1142,7 +1161,7 @@ def verifyDeployedPOMsCoordinates(artifacts, version):
raise RuntimeError('Missing corresponding .%s artifact for POM %s' % (packaging, POM)) raise RuntimeError('Missing corresponding .%s artifact for POM %s' % (packaging, POM))
def verifyArtifactPerPOMtemplate(POMtemplates, artifacts, tmpDir, version): def verifyArtifactPerPOMtemplate(POMtemplates, artifacts, tmpDir, version):
"""verify that each POM template's artifact is present in artifacts""" print(' verify that there is an artifact for each POM template...')
namespace = '{http://maven.apache.org/POM/4.0.0}' namespace = '{http://maven.apache.org/POM/4.0.0}'
xpathPlugin = '{0}build/{0}plugins/{0}plugin'.format(namespace) xpathPlugin = '{0}build/{0}plugins/{0}plugin'.format(namespace)
xpathSkipConfiguration = '{0}configuration/{0}skip'.format(namespace) xpathSkipConfiguration = '{0}configuration/{0}skip'.format(namespace)
@ -1165,6 +1184,7 @@ def verifyArtifactPerPOMtemplate(POMtemplates, artifacts, tmpDir, version):
raise RuntimeError('Missing artifact %s' % artifact) raise RuntimeError('Missing artifact %s' % artifact)
def getPOMtemplates(POMtemplates, tmpDir, releaseBranchSvnURL): def getPOMtemplates(POMtemplates, tmpDir, releaseBranchSvnURL):
print(' get POM templates')
allPOMtemplates = [] allPOMtemplates = []
sourceLocation = releaseBranchSvnURL sourceLocation = releaseBranchSvnURL
if sourceLocation is None: if sourceLocation is None:
@ -1292,15 +1312,15 @@ def smokeTest(baseURL, svnRevision, version, tmpDir, isSigned, testArgs):
print('Test Lucene...') print('Test Lucene...')
checkSigs('lucene', lucenePath, version, tmpDir, isSigned) checkSigs('lucene', lucenePath, version, tmpDir, isSigned)
for artifact in ('lucene-%s.tgz' % version, 'lucene-%s.zip' % version): for artifact in ('lucene-%s.tgz' % version, 'lucene-%s.zip' % version):
unpackAndVerify('lucene', tmpDir, artifact, svnRevision, version, testArgs) unpackAndVerify('lucene', tmpDir, artifact, svnRevision, version, testArgs, baseURL)
unpackAndVerify('lucene', tmpDir, 'lucene-%s-src.tgz' % version, svnRevision, version, testArgs) unpackAndVerify('lucene', tmpDir, 'lucene-%s-src.tgz' % version, svnRevision, version, testArgs, baseURL)
print() print()
print('Test Solr...') print('Test Solr...')
checkSigs('solr', solrPath, version, tmpDir, isSigned) checkSigs('solr', solrPath, version, tmpDir, isSigned)
for artifact in ('solr-%s.tgz' % version, 'solr-%s.zip' % version): for artifact in ('solr-%s.tgz' % version, 'solr-%s.zip' % version):
unpackAndVerify('solr', tmpDir, artifact, svnRevision, version, testArgs) unpackAndVerify('solr', tmpDir, artifact, svnRevision, version, testArgs, baseURL)
unpackAndVerify('solr', tmpDir, 'solr-%s-src.tgz' % version, svnRevision, version, testArgs) unpackAndVerify('solr', tmpDir, 'solr-%s-src.tgz' % version, svnRevision, version, testArgs, baseURL)
print() print()
print('Test Maven artifacts for Lucene and Solr...') print('Test Maven artifacts for Lucene and Solr...')

View File

@ -174,6 +174,10 @@ Build
* LUCENE-5249, LUCENE-5257: All Lucene/Solr modules should use the same * LUCENE-5249, LUCENE-5257: All Lucene/Solr modules should use the same
dependency versions. (Steve Rowe) dependency versions. (Steve Rowe)
* LUCENE-5273: Binary artifacts in Lucene and Solr convenience binary
distributions accompanying a release, including on Maven Central,
should be identical across all distributions. (Steve Rowe)
======================= Lucene 4.5.0 ======================= ======================= Lucene 4.5.0 =======================
New features New features

View File

@ -490,12 +490,35 @@
<jarify/> <jarify/>
</target> </target>
<property name="lucene.tgz.file" location="${common.dir}/dist/lucene-${version}.tgz"/>
<available file="${lucene.tgz.file}" property="lucene.tgz.exists"/>
<property name="lucene.tgz.unpack.dir" location="${common.build.dir}/lucene.tgz.unpacked"/>
<available type="dir" file="${lucene.tgz.unpack.dir}" property="lucene.tgz.unpack.dir.exists"/>
<target name="-ensure-lucene-tgz-exists" unless="lucene.tgz.exists">
<ant dir="${common.dir}" target="package-tgz" inheritall="false"/>
</target>
<target name="-unpack-lucene-tgz" unless="lucene.tgz.unpack.dir.exists">
<antcall target="-ensure-lucene-tgz-exists" inheritall="false"/>
<mkdir dir="${lucene.tgz.unpack.dir}"/>
<untar compression="gzip" src="${lucene.tgz.file}" dest="${lucene.tgz.unpack.dir}"/>
</target>
<property name="dist.jar.dir.prefix" value="${lucene.tgz.unpack.dir}/lucene"/>
<pathconvert property="dist.jar.dir.suffix">
<mapper>
<chainedmapper>
<globmapper from="${common.dir}*" to="*"/>
<globmapper from="*build.xml" to="*"/>
</chainedmapper>
</mapper>
<path location="${ant.file}"/>
</pathconvert>
<macrodef name="m2-deploy" description="Builds a Maven artifact"> <macrodef name="m2-deploy" description="Builds a Maven artifact">
<element name="artifact-attachments" optional="yes"/> <element name="artifact-attachments" optional="yes"/>
<element name="parent-poms" optional="yes"/> <element name="parent-poms" optional="yes"/>
<element name="credentials" optional="yes"/> <element name="credentials" optional="yes"/>
<attribute name="pom.xml"/> <attribute name="pom.xml"/>
<attribute name="jar.file" default="${build.dir}/${final.name}.jar"/> <attribute name="jar.file" default="${dist.jar.dir.prefix}-${version}/${dist.jar.dir.suffix}/${final.name}.jar"/>
<sequential> <sequential>
<artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-7"/> <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-7"/>
<parent-poms/> <parent-poms/>
@ -1353,9 +1376,9 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
</target> </target>
<target name="dist-maven" <target name="dist-maven"
depends="filter-pom-templates, install-maven-tasks, m2-deploy-lucene-parent-pom, dist-maven-common"/> depends="filter-pom-templates, install-maven-tasks, m2-deploy-lucene-parent-pom, -unpack-lucene-tgz, dist-maven-common"/>
<target name="dist-maven-common" <target name="dist-maven-common"
depends="jar-core, jar-src, javadocs, install-maven-tasks, filter-pom-templates"> depends="jar-src, javadocs, install-maven-tasks, filter-pom-templates">
<sequential> <sequential>
<property name="top.level.dir" location="${common.dir}/.."/> <property name="top.level.dir" location="${common.dir}/.."/>
<pathconvert property="pom.xml"> <pathconvert property="pom.xml">
@ -1379,9 +1402,9 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
</target> </target>
<target name="dist-maven-src-java" <target name="dist-maven-src-java"
depends="filter-pom-templates, install-maven-tasks, m2-deploy-lucene-parent-pom, dist-maven-common-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" <target name="dist-maven-common-src-java"
depends="jar-core, jar-src, javadocs, install-maven-tasks, filter-pom-templates"> depends="-unpack-lucene-tgz, jar-src, javadocs, install-maven-tasks, filter-pom-templates">
<sequential> <sequential>
<property name="top.level.dir" location="${common.dir}/.."/> <property name="top.level.dir" location="${common.dir}/.."/>
<pathconvert property="pom.xml"> <pathconvert property="pom.xml">

View File

@ -44,8 +44,24 @@
<property name="changes.target.dir" location="${dest}/docs/changes"/> <property name="changes.target.dir" location="${dest}/docs/changes"/>
<property name="license.dir" location="${common-solr.dir}/licenses"/> <property name="license.dir" location="${common-solr.dir}/licenses"/>
<property name="solr.tgz.unpack.dir" location="${common-solr.dir}/build/solr.tgz.unpacked"/>
<property name="dist.jar.dir.prefix" value="${solr.tgz.unpack.dir}/solr"/>
<property name="dist.jar.dir.suffix" value="dist"/>
<import file="${common-solr.dir}/../lucene/module-build.xml"/> <import file="${common-solr.dir}/../lucene/module-build.xml"/>
<property name="solr.tgz.file" location="${common-solr.dir}/package/solr-${version}.tgz"/>
<available file="${solr.tgz.file}" property="solr.tgz.exists"/>
<available type="dir" file="${solr.tgz.unpack.dir}" property="solr.tgz.unpack.dir.exists"/>
<target name="-ensure-solr-tgz-exists" unless="solr.tgz.exists">
<ant dir="${common-solr.dir}" target="create-package" inheritall="false"/>
</target>
<target name="-unpack-solr-tgz" unless="${solr.tgz.unpack.dir.exists}">
<antcall target="-ensure-solr-tgz-exists"/>
<mkdir dir="${solr.tgz.unpack.dir}"/>
<untar compression="gzip" src="${solr.tgz.file}" dest="${solr.tgz.unpack.dir}"/>
</target>
<!-- backwards compatibility with existing targets/tasks; TODO: remove this! --> <!-- backwards compatibility with existing targets/tasks; TODO: remove this! -->
<property name="fullnamever" value="${final.name}"/> <property name="fullnamever" value="${final.name}"/>
@ -142,18 +158,16 @@
<property name="solr.deps.compiled" value="true"/> <property name="solr.deps.compiled" value="true"/>
</target> </target>
<target name="lucene-jars-to-solr" depends="prep-lucene-jars"> <target name="lucene-jars-to-solr" depends="-unpack-lucene-tgz">
<!-- TODO: clean this up -->
<sequential> <sequential>
<ant dir="${common.dir}" target="default" inheritall="false"> <pathconvert property="relative.solr.lucene.libs" pathsep=",">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<copy todir="${lucene-libs}" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
<path refid="solr.lucene.libs"/> <path refid="solr.lucene.libs"/>
<!-- NOTE: lucene-core is not already included in "solr.lucene.libs"
because of it's use in classpaths.
-->
<fileset file="${lucene-core.jar}"/> <fileset file="${lucene-core.jar}"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
</pathconvert>
<mkdir dir="${lucene-libs}"/>
<copy todir="${lucene-libs}" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
<fileset dir="${lucene.tgz.unpack.dir}/lucene-${version}" includes="${relative.solr.lucene.libs}"/>
</copy> </copy>
</sequential> </sequential>
</target> </target>
@ -309,10 +323,10 @@
</target> </target>
<target name="dist-maven" <target name="dist-maven"
depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, dist-maven-common"/> depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, -unpack-solr-tgz, dist-maven-common"/>
<target name="dist-maven-src-java" <target name="dist-maven-src-java"
depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, dist-maven-common-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"> <target name="-validate-maven-dependencies" depends="-validate-maven-dependencies.init">
<m2-validate-dependencies pom.xml="${maven.pom.xml}" licenseDirectory="${license.dir}"> <m2-validate-dependencies pom.xml="${maven.pom.xml}" licenseDirectory="${license.dir}">

View File

@ -49,11 +49,14 @@
code in the analysis-extras contrib, they must remain here in order to code in the analysis-extras contrib, they must remain here in order to
populate the Solr distribution populate the Solr distribution
--> -->
<target name="module-jars-to-solr" <target name="module-jars-to-solr" depends="-unpack-lucene-tgz">
depends="jar-analyzers-icu, jar-analyzers-smartcn, jar-analyzers-stempel, jar-analyzers-morfologik"> <pathconvert property="relative.analysis.extras.lucene.libs" pathsep=",">
<path refid="analysis.extras.lucene.libs"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
</pathconvert>
<mkdir dir="${build.dir}/lucene-libs"/> <mkdir dir="${build.dir}/lucene-libs"/>
<copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true"> <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
<path refid="analysis.extras.lucene.libs" /> <fileset dir="${lucene.tgz.unpack.dir}/lucene-${version}" includes="${relative.analysis.extras.lucene.libs}"/>
</copy> </copy>
</target> </target>

View File

@ -26,15 +26,23 @@
<import file="../contrib-build.xml"/> <import file="../contrib-build.xml"/>
<path id="classpath"> <path id="uima.lucene.libs">
<pathelement path="${analyzers-uima.jar}"/> <pathelement path="${analyzers-uima.jar}"/>
</path>
<path id="classpath">
<path refid="uima.lucene.libs"/>
<path refid="solr.base.classpath"/> <path refid="solr.base.classpath"/>
</path> </path>
<target name="module-jars-to-solr" depends="jar-analyzers-uima"> <target name="module-jars-to-solr" depends="-unpack-lucene-tgz">
<pathconvert property="relative.uima.lucene.libs" pathsep=",">
<path refid="uima.lucene.libs"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
</pathconvert>
<mkdir dir="${build.dir}/lucene-libs"/> <mkdir dir="${build.dir}/lucene-libs"/>
<copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true"> <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
<fileset file="${analyzers-uima.jar}"/> <fileset dir="${lucene.tgz.unpack.dir}/lucene-${version}" includes="${relative.uima.lucene.libs}"/>
</copy> </copy>
</target> </target>

View File

@ -71,11 +71,14 @@
</sequential> </sequential>
</target> </target>
<target name="module-jars-to-solr" <target name="module-jars-to-solr" depends="-unpack-lucene-tgz">
depends="jar-test-framework"> <pathconvert property="relative.solr.test.framework.lucene.libs" pathsep=",">
<path refid="solr.test.framework.lucene.libs"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
</pathconvert>
<mkdir dir="${build.dir}/lucene-libs"/> <mkdir dir="${build.dir}/lucene-libs"/>
<copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true"> <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
<path refid="solr.test.framework.lucene.libs" /> <fileset dir="${lucene.tgz.unpack.dir}/lucene-${version}" includes="${relative.solr.test.framework.lucene.libs}"/>
</copy> </copy>
</target> </target>

View File

@ -42,7 +42,7 @@
<target name="dist" <target name="dist"
description="Creates the Solr WAR Distribution file." description="Creates the Solr WAR Distribution file."
depends="test, init-dist, dist-core, dist-solrj, lucene-jars-to-solr"> depends="test, init-dist, dist-core, dist-solrj, -unpack-lucene-tgz, lucene-jars-to-solr">
<build-manifest title="Apache Solr Search Server" <build-manifest title="Apache Solr Search Server"
implementation.title="org.apache.solr" implementation.title="org.apache.solr"
spec.version="${spec.version}"/> spec.version="${spec.version}"/>