@@ -215,6 +215,39 @@ artifacts {
215215 solrSlimTgz(slimDistTar)
216216}
217217
218+ tasks. register(' runDev' , JavaExec ) {
219+ group = ' application'
220+ description = ' Starts Solr for local experimentation. Does NOT use the bin/solr script.'
221+ dependsOn ' devSlim'
222+
223+ workingDir = file(" $slimDevDir /server" )
224+
225+ // Intentionally not synchronizing the logic here with bin/solr; don't want the burden
226+
227+ doFirst {
228+ println " To attach a debugger, at the CLI pass: --debug-jvm"
229+ println " To pass JVM args, at the CLI pass: -PjvmArgs='--add-modules jdk.incubator.vector'"
230+ println " To pass system properties, at the CLI pass: -Dsolr.port.listen=8983"
231+ }
232+
233+ maxHeapSize = project. findProperty(' maxHeapSize' ) ?: ' 1G'
234+
235+ jvmArgs = [] // don't use defaults from our build that assume this is a typical build task
236+ jvmArgs((project. findProperty(' jvmArgs' ) ?: ' ' ). split())
237+
238+ systemProperty ' solr.port.listen' , ' 8983'
239+ systemProperty ' solr.install.dir' , file(" $workingDir /.." )
240+ systemProperty ' solr.logs.dir' , file(" $workingDir /logs" )
241+ systemProperty ' solr.zookeeper.server.enabled' , ' true' // SolrCloud; embedded ZK
242+
243+ // Propagate CLI system properties (override defaults above)
244+ systemProperties + = gradle. startParameter. systemPropertiesArgs
245+
246+ classpath = files(" $workingDir /start.jar" )
247+
248+ args((project. findProperty(' args' ) ?: ' --module=http' ). split())
249+ }
250+
218251task downloadBats (type : NpmTask ) {
219252 group = ' Build Dependency Download'
220253 args = [" install" , " https://github.com/bats-core/bats-core#v${ libs.versions.bats.core.get()} " ,
0 commit comments