You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2013/10/12 09:06:05 UTC

svn commit: r1531507 - in /lucene/dev/branches/branch_4x: ./ dev-tools/ dev-tools/scripts/ lucene/ solr/ solr/contrib/ solr/contrib/analysis-extras/ solr/contrib/uima/ solr/test-framework/ solr/webapp/

Author: sarowe
Date: Sat Oct 12 07:06:05 2013
New Revision: 1531507

URL: http://svn.apache.org/r1531507
Log:
LUCENE-5273: Binary artifacts in Lucene and Solr convenience binary distributions accompanying a release, including on Maven Central, should be identical across all distributions. (merged trunk r1531354)

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/dev-tools/   (props changed)
    lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/lucene/common-build.xml   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/common-build.xml   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/contrib/analysis-extras/build.xml
    lucene/dev/branches/branch_4x/solr/contrib/uima/build.xml
    lucene/dev/branches/branch_4x/solr/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/solr/test-framework/build.xml
    lucene/dev/branches/branch_4x/solr/webapp/   (props changed)
    lucene/dev/branches/branch_4x/solr/webapp/build.xml

Modified: lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py?rev=1531507&r1=1531506&r2=1531507&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py (original)
+++ lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py Sat Oct 12 07:06:05 2013
@@ -258,8 +258,12 @@ def checkJARMetaData(desc, jarFile, svnR
 def normSlashes(path):
   return path.replace(os.sep, '/')
     
-def checkAllJARs(topDir, project, svnRevision, version):
-  print('    verify JAR/WAR metadata...')  
+def checkAllJARs(topDir, project, svnRevision, version, tmpDir, baseURL):
+  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):
 
     normRoot = normSlashes(root)
@@ -281,30 +285,54 @@ def checkAllJARs(topDir, project, svnRev
         noJavaPackageClasses('JAR file "%s"' % fullPath, fullPath)
         if file.lower().find('lucene') != -1 or file.lower().find('solr') != -1:
           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
   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)
 
+  distFilenames = dict()
+  for file in getBinaryDistFiles('lucene', tmpDir, version, baseURL):
+    distFilenames[os.path.basename(file)] = file
+
   with zipfile.ZipFile(warFileName, 'r') as z:
     for name in z.namelist():
       if name.endswith('.jar'):
+        jarInsideWarContents = z.read(name)
         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:
           checkJARMetaData('JAR file %s inside WAR file %s' % (name, warFileName),
-                           io.BytesIO(z.read(name)),
+                           io.BytesIO(jarInsideWarContents),
                            svnRevision,
                            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):
 
   print('  test basics...')
@@ -584,7 +612,7 @@ def getDirEntries(urlString):
       if text == 'Parent Directory' or text == '..':
         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
   if os.path.exists(destDir):
     shutil.rmtree(destDir)
@@ -604,14 +632,14 @@ def unpackAndVerify(project, tmpDir, art
     raise RuntimeError('unpack produced entries %s; expected only %s' % (l, 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_LICENSE = None
 SOLR_NOTICE = 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_LICENSE
   global SOLR_NOTICE
@@ -750,14 +778,14 @@ def verifyUnpacked(project, artifact, un
 
   else:
 
-    checkAllJARs(os.getcwd(), project, svnRevision, version)
+    checkAllJARs(os.getcwd(), project, svnRevision, version, tmpDir, baseURL)
     
     if project == 'lucene':
       testDemo(isSrc, version, '1.6')
       testDemo(isSrc, version, '1.7')
 
     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 6 ...')
       java6UnpackPath = '%s-java6' %unpackPath
@@ -953,11 +981,10 @@ def checkMaven(baseURL, tmpDir, svnRevis
     if text == releaseBranchText:
       releaseBranchSvnURL = subURL
 
-  print('    get POM templates', end=' ')
   POMtemplates = defaultdict()
   getPOMtemplates(POMtemplates, tmpDir, releaseBranchSvnURL)
   print()
-  print('    download artifacts', end=' ')
+  print('    download artifacts')
   artifacts = {'lucene': [], 'solr': []}
   for project in ('lucene', 'solr'):
     artifactsURL = '%s/%s/maven/org/apache/%s' % (baseURL, project, project)
@@ -966,54 +993,51 @@ def checkMaven(baseURL, tmpDir, svnRevis
       os.makedirs(targetDir)
     crawl(artifacts[project], artifactsURL, targetDir)
   print()
-  print('    verify that each binary artifact has a deployed POM...')
   verifyPOMperBinaryArtifact(artifacts, version)
-  print('    verify that there is an artifact for each POM template...')
   verifyArtifactPerPOMtemplate(POMtemplates, artifacts, tmpDir, version)
-  print("    verify Maven artifacts' md5/sha1 digests...")
   verifyMavenDigests(artifacts)
-  print('    check for javadoc and sources artifacts...')
   checkJavadocAndSourceArtifacts(artifacts, version)
-  print("    verify deployed POMs' coordinates...")
   verifyDeployedPOMsCoordinates(artifacts, version)
   if isSigned:
-    print('    verify maven artifact sigs', end=' ')
     verifyMavenSigs(baseURL, tmpDir, artifacts)
 
-  distributionFiles = getDistributionsForMavenChecks(tmpDir, version, baseURL)
-
-  print('    verify that Maven artifacts are same as in the binary distribution...')
-  checkIdenticalMavenArtifacts(distributionFiles, artifacts, version)
+  distFiles = getBinaryDistFilesForMavenChecks(tmpDir, version, baseURL)
+  checkIdenticalMavenArtifacts(distFiles, artifacts, version)
 
-  checkAllJARs('%s/maven/org/apache/lucene' % tmpDir, 'lucene', svnRevision, version)
-  checkAllJARs('%s/maven/org/apache/solr' % tmpDir, 'solr', svnRevision, version)
+  checkAllJARs('%s/maven/org/apache/lucene' % tmpDir, 'lucene', svnRevision, version, tmpDir, baseURL)
+  checkAllJARs('%s/maven/org/apache/solr' % tmpDir, 'solr', svnRevision, version, tmpDir, baseURL)
 
-def getDistributionsForMavenChecks(tmpDir, version, baseURL):
-  distributionFiles = defaultdict()
+def getBinaryDistFilesForMavenChecks(tmpDir, version, baseURL):
+  distFiles = defaultdict()
   for project in ('lucene', 'solr'):
-    distribution = '%s-%s.tgz' % (project, version)
-    if not os.path.exists('%s/%s' % (tmpDir, distribution)):
-      distURL = '%s/%s/%s' % (baseURL, project, distribution)
-      print('    download %s...' % distribution, end=' ')
-      download(distribution, distURL, tmpDir)
-    destDir = '%s/unpack-%s-maven' % (tmpDir, project)
-    if os.path.exists(destDir):
-      shutil.rmtree(destDir)
-    os.makedirs(destDir)
-    os.chdir(destDir)
-    print('    unpack %s...' % distribution)
-    unpackLogFile = '%s/unpack-%s-maven-checks.log' % (tmpDir, distribution)
-    run('tar xzf %s/%s' % (tmpDir, distribution), unpackLogFile)
-    if project == 'solr': # unpack the Solr war
-      unpackLogFile = '%s/unpack-solr-war-maven-checks.log' % tmpDir
-      print('        unpack Solr war...')
-      run('jar xvf */dist/*.war', unpackLogFile)
-    distributionFiles[project] = []
-    for root, dirs, files in os.walk(destDir):
-      distributionFiles[project].extend([os.path.join(root, file) for file in files])
+    distFiles[project] = getBinaryDistFiles(project, tmpDir, version, baseURL)
+  return distFiles
+    
+def getBinaryDistFiles(project, tmpDir, version, baseURL):
+  distribution = '%s-%s.tgz' % (project, version)
+  if not os.path.exists('%s/%s' % (tmpDir, distribution)):
+    distURL = '%s/%s/%s' % (baseURL, project, distribution)
+    print('    download %s...' % distribution, end=' ')
+    download(distribution, distURL, tmpDir)
+  destDir = '%s/unpack-%s-getBinaryDistFiles' % (tmpDir, project)
+  if os.path.exists(destDir):
+    shutil.rmtree(destDir)
+  os.makedirs(destDir)
+  os.chdir(destDir)
+  print('    unpack %s...' % distribution)
+  unpackLogFile = '%s/unpack-%s-getBinaryDistFiles.log' % (tmpDir, distribution)
+  run('tar xzf %s/%s' % (tmpDir, distribution), unpackLogFile)
+  if project == 'solr': # unpack the Solr war
+    unpackLogFile = '%s/unpack-solr-war-getBinaryDistFiles.log' % tmpDir
+    print('        unpack Solr war...')
+    run('jar xvf */dist/*.war', unpackLogFile)
+  distributionFiles = []
+  for root, dirs, files in os.walk(destDir):
+    distributionFiles.extend([os.path.join(root, file) for file in files])
   return distributionFiles
 
 def checkJavadocAndSourceArtifacts(artifacts, version):
+  print('    check for javadoc and sources artifacts...')
   for project in ('lucene', 'solr'):
     for artifact in artifacts[project]:
       if artifact.endswith(version + '.jar'):
@@ -1033,35 +1057,28 @@ def getZipFileEntries(fileName):
   entries.sort()
   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
   for project in ('lucene', 'solr'):
     distFilenames = dict()
-    for file in distributionFiles[project]:
+    for file in distFiles[project]:
       baseName = os.path.basename(file)
       distFilenames[baseName] = file
     for artifact in artifacts[project]:
       if reJarWar.search(artifact):
-        entries = getZipFileEntries(artifact)
         artifactFilename = os.path.basename(artifact)
         if artifactFilename not in distFilenames:
           raise RuntimeError('Maven artifact %s is not present in %s binary distribution'
                             % (artifact, project))
         else:
-          binaryEntries = getZipFileEntries(distFilenames[artifactFilename])
-          if binaryEntries != entries:
-            raise RuntimeError('Maven artifact %s has different contents than binary distribution\n  maven:\n%s\n  binary:\n%s\n' % \
-                  (artifactFilename,
-                   '\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))
+          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):
+  print("    verify Maven artifacts' md5/sha1 digests...")
   reJarWarPom = re.compile(r'\.(?:[wj]ar|pom)$')
   for project in ('lucene', 'solr'):
     for artifactFile in [a for a in artifacts[project] if reJarWarPom.search(a)]:
@@ -1108,7 +1125,7 @@ def getPOMcoordinate(treeRoot):
   return groupId, artifactId, packaging, version
 
 def verifyMavenSigs(baseURL, tmpDir, artifacts):
-  """Verify Maven artifact signatures"""
+  print('    verify maven artifact sigs', end=' ')
   for project in ('lucene', 'solr'):
     keysFile = '%s/%s.KEYS' % (tmpDir, project)
     if not os.path.exists(keysFile):
@@ -1158,7 +1175,7 @@ def verifyMavenSigs(baseURL, tmpDir, art
   print()
 
 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))
   for project in ('lucene', 'solr'):
     for artifact in [a for a in artifacts[project] if reBinaryJarWar.search(a)]:
@@ -1171,6 +1188,7 @@ def verifyDeployedPOMsCoordinates(artifa
   verify that each POM's coordinate (drawn from its content) matches
   its filepath, and verify that the corresponding artifact exists.
   """
+  print("    verify deployed POMs' coordinates...")
   for project in ('lucene', 'solr'):
     for POM in [a for a in artifacts[project] if a.endswith('.pom')]:
       treeRoot = ET.parse(POM).getroot()
@@ -1186,7 +1204,7 @@ def verifyDeployedPOMsCoordinates(artifa
         raise RuntimeError('Missing corresponding .%s artifact for POM %s' % (packaging, POM))
 
 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}'
   xpathPlugin = '{0}build/{0}plugins/{0}plugin'.format(namespace)
   xpathSkipConfiguration = '{0}configuration/{0}skip'.format(namespace)
@@ -1209,6 +1227,7 @@ def verifyArtifactPerPOMtemplate(POMtemp
           raise RuntimeError('Missing artifact %s' % artifact)
 
 def getPOMtemplates(POMtemplates, tmpDir, releaseBranchSvnURL):
+  print('    get POM templates')
   allPOMtemplates = []
   sourceLocation = releaseBranchSvnURL
   if sourceLocation is None:
@@ -1336,15 +1355,15 @@ def smokeTest(baseURL, svnRevision, vers
   print('Test Lucene...')
   checkSigs('lucene', lucenePath, version, tmpDir, isSigned)
   for artifact in ('lucene-%s.tgz' % version, 'lucene-%s.zip' % version):
-    unpackAndVerify('lucene', tmpDir, artifact, svnRevision, version, testArgs)
-  unpackAndVerify('lucene', tmpDir, 'lucene-%s-src.tgz' % version, svnRevision, version, testArgs)
+    unpackAndVerify('lucene', tmpDir, artifact, svnRevision, version, testArgs, baseURL)
+  unpackAndVerify('lucene', tmpDir, 'lucene-%s-src.tgz' % version, svnRevision, version, testArgs, baseURL)
 
   print()
   print('Test Solr...')
   checkSigs('solr', solrPath, version, tmpDir, isSigned)
   for artifact in ('solr-%s.tgz' % version, 'solr-%s.zip' % version):
-    unpackAndVerify('solr', tmpDir, artifact, svnRevision, version, testArgs)
-  unpackAndVerify('solr', tmpDir, 'solr-%s-src.tgz' % version, svnRevision, version, testArgs)
+    unpackAndVerify('solr', tmpDir, artifact, svnRevision, version, testArgs, baseURL)
+  unpackAndVerify('solr', tmpDir, 'solr-%s-src.tgz' % version, svnRevision, version, testArgs, baseURL)
 
   print()
   print('Test Maven artifacts for Lucene and Solr...')

Modified: lucene/dev/branches/branch_4x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/CHANGES.txt?rev=1531507&r1=1531506&r2=1531507&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/lucene/CHANGES.txt Sat Oct 12 07:06:05 2013
@@ -124,6 +124,10 @@ Build
 
 * LUCENE-5249, LUCENE-5257: All Lucene/Solr modules should use the same
   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)
 
 Tests
 

Modified: lucene/dev/branches/branch_4x/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/common-build.xml?rev=1531507&r1=1531506&r2=1531507&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/common-build.xml (original)
+++ lucene/dev/branches/branch_4x/lucene/common-build.xml Sat Oct 12 07:06:05 2013
@@ -493,12 +493,35 @@
     <jarify/>
   </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">
   	<element name="artifact-attachments" optional="yes"/>
     <element name="parent-poms" optional="yes"/>
     <element name="credentials" optional="yes"/>
     <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>
       <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-7"/>
       <parent-poms/>
@@ -1356,9 +1379,9 @@ ${tests-output}/junit4-*.suites     - pe
   </target>
 
   <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"
-          depends="jar-core, jar-src, javadocs, install-maven-tasks, filter-pom-templates">
+          depends="jar-src, javadocs, install-maven-tasks, filter-pom-templates">
     <sequential>
       <property name="top.level.dir" location="${common.dir}/.."/>
       <pathconvert property="pom.xml">
@@ -1382,9 +1405,9 @@ ${tests-output}/junit4-*.suites     - pe
   </target>
 
   <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"
-          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>
       <property name="top.level.dir" location="${common.dir}/.."/>
       <pathconvert property="pom.xml">

Modified: lucene/dev/branches/branch_4x/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/common-build.xml?rev=1531507&r1=1531506&r2=1531507&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/common-build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/common-build.xml Sat Oct 12 07:06:05 2013
@@ -44,8 +44,24 @@
   <property name="changes.target.dir" location="${dest}/docs/changes"/>
   <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"/>
 
+  <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! -->
   <property name="fullnamever" value="${final.name}"/>
 
@@ -142,19 +158,17 @@
   	  <property name="solr.deps.compiled" value="true"/>
   </target>
 	
-  <target name="lucene-jars-to-solr" depends="prep-lucene-jars">
-    <!-- TODO: clean this up -->
+  <target name="lucene-jars-to-solr" depends="-unpack-lucene-tgz">
     <sequential>
-    <ant dir="${common.dir}" target="default" inheritall="false">
-      <propertyset refid="uptodate.and.compiled.properties"/>
-    </ant>
-    <copy todir="${lucene-libs}" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
-      <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}" />
-    </copy>
+      <pathconvert property="relative.solr.lucene.libs" pathsep=",">
+        <path refid="solr.lucene.libs"/>
+        <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>
     </sequential>
   </target>
 
@@ -309,10 +323,10 @@
   </target>
 
   <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"
-          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">
     <m2-validate-dependencies pom.xml="${maven.pom.xml}" licenseDirectory="${license.dir}">

Modified: lucene/dev/branches/branch_4x/solr/contrib/analysis-extras/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/contrib/analysis-extras/build.xml?rev=1531507&r1=1531506&r2=1531507&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/contrib/analysis-extras/build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/contrib/analysis-extras/build.xml Sat Oct 12 07:06:05 2013
@@ -49,11 +49,14 @@
     code in the analysis-extras contrib, they must remain here in order to
     populate the Solr distribution
    -->
-  <target name="module-jars-to-solr"
-          depends="jar-analyzers-icu, jar-analyzers-smartcn, jar-analyzers-stempel, jar-analyzers-morfologik">
+  <target name="module-jars-to-solr" depends="-unpack-lucene-tgz">
+    <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"/>
     <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>
   </target>
 

Modified: lucene/dev/branches/branch_4x/solr/contrib/uima/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/contrib/uima/build.xml?rev=1531507&r1=1531506&r2=1531507&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/contrib/uima/build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/contrib/uima/build.xml Sat Oct 12 07:06:05 2013
@@ -26,15 +26,23 @@
 
   <import file="../contrib-build.xml"/>
   
-  <path id="classpath">
+  <path id="uima.lucene.libs">
     <pathelement path="${analyzers-uima.jar}"/>
+  </path>
+
+  <path id="classpath">
+    <path refid="uima.lucene.libs"/>
     <path refid="solr.base.classpath"/>
   </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"/>
     <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>
   </target>
 

Modified: lucene/dev/branches/branch_4x/solr/test-framework/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/test-framework/build.xml?rev=1531507&r1=1531506&r2=1531507&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/test-framework/build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/test-framework/build.xml Sat Oct 12 07:06:05 2013
@@ -71,11 +71,14 @@
     </sequential>
   </target>
 
-  <target name="module-jars-to-solr"
-          depends="jar-test-framework">
+  <target name="module-jars-to-solr" depends="-unpack-lucene-tgz">
+    <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"/>
     <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>
   </target>
 

Modified: lucene/dev/branches/branch_4x/solr/webapp/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/webapp/build.xml?rev=1531507&r1=1531506&r2=1531507&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/webapp/build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/webapp/build.xml Sat Oct 12 07:06:05 2013
@@ -42,7 +42,7 @@
 
   <target name="dist"
           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"
                     implementation.title="org.apache.solr"
                     spec.version="${spec.version}"/>
@@ -63,8 +63,9 @@
     </war>
   </target>
 
-  <target name="dist-maven" depends="dist, filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom">
-    <m2-deploy jar.file="${dist}/solr-${version}.war"
+  <target name="dist-maven" 
+          depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, -unpack-solr-tgz">
+    <m2-deploy jar.file="${solr.tgz.unpack.dir}/solr-${version}/dist/solr-${version}.war"
                pom.xml="${filtered.pom.templates.dir}/solr/webapp/pom.xml"/>
   </target>
 </project>