Search code examples
antsolrsolr4solrcloud

How to build solr.tgz file from source using "ant package"


I want to build a .tgz distribution file from solr.

The build.xml file tells me to use "ant package".

However, running ant package gets everything from svn and builds ./package/solr-6.0.0-SNAPSHOT.zip whereas my code base is from lucene_4_10_x branch.

How do I build ./package/solr-4.10.3.zip from the source code?

I need to build from the source code because I have some local changes that I want to compile and deploy.


Solution

  • According to LUCENE-4288, Solr will only package properly if it's checked out from SVN by default. However, if you change package-src-tgz to package-local-src-tgz, it will properly package. Find the following lines in solr/build.xml:

    <!-- make a distribution -->
    <target name="package" depends="package-src-tgz,..."/>
    

    And change package-src-tgz to package-local-src-tgz.

    <!-- make a distribution -->
    <target name="package" depends="package-local-src-tgz,..."/>
    

    Then just rerun ant package inside solr/, and the packaged archives (solr-<version>-SNAPSHOT.tgz and solr-<version>-SNAPSHOT.zip) will be available under solr/package/.