Run solr 4.4 from gradle

(Arvind Das) #1

Hi All

I am having some trouble with running solr as a gradle task . Example from shows running of solr 4.0 but I want to run it through solr 4.4 . I have done configurations as

configurations {



dependencies {

solrWebApp “org.apache.solr:solr:4.4.0@war”

testCompile “junit:junit:4.10”

testCompile “org.apache.solr:solr-test-framework:4.4.0”

compile group: ‘org.slf4j’, name: ‘slf4j-api’, version: ‘1.7.+’


jettyRun.webAppSourceDirectory = file(“webapp”)

task runSolr(type: JettyRunWar) {

webApp = configurations.solrWebApp.singleFile


runSolr.doFirst {

System.setProperty(“solr.solr.home”, “/opt/solr_home”)


httpPort = 8080

stopPort = 9451

My solr_home points to the core having lucene version 4.4 too, but error message shows .

Unable to create core: helloworld org.apache.solr.common.SolrException: Invalid luceneMatchVersion ‘4.4’, valid values are: [LUCENE_30, LUCENE_31, LUCENE_32, LUCENE_33, LUCENE_34, LUCENE_35, LUCENE_36, LUCENE_40, LUCENE_CURRENT] or a string in format ‘V.V’

Caused by: java.lang.IllegalArgumentException: No enum const class org.apache.lucene.util.Version.LUCENE_44 at java.lang.Enum.valueOf( at org.apache.lucene.util.Version.valueOf( at org.apache.lucene.util.Version.parseLeniently( at org.apache.solr.core.Config.parseLuceneVersionString( … 130 more /

My solr home has lucene4.4

Can anyone help me out with this ?

Thanks Arvind

(Benjamin Muschko) #2

This works fine for me when pointing the system property “solr.solr.home” to the example directory solr-4.4.0/example/solr. What’s the content of your directory /opt/solr_home?

(Arvind Das) #3

Hi Benjamin,

Thanks for your reply . In my /opt/solr_home I have a new core HelloWorld with a conf and lib directories . Conf contains solr configurations like schema and solrconfig and other files.My Solrconfig points to luceneMatchVersion 4.4.

Nothing else.

Thanks Arvind

(Arvind Das) #4

Also, I tried to run it through default solr configuration but then it does not load solr page correcctly. This time I set solr home to /opt/solr-4.4.0/example/solr .

Thanks Arvind

(Benjamin Muschko) #5

If you can provide a project on GitHub that emulates the issue I can have a look. It’s hard to analyze your described problem otherwise.

I noticed as well that there was a loading spinner on the Solar page but I don’t think this is an issue related to Gradle. I’d check the JavaScript console of your browser to see if there’s anything that helps you determine the issue.