title: running mlcp through gradle and getting Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
body: <p>I am running a gradle task</p>
  <pre><code>gradlew -b import.gradle copy_taskName -PinputHost=&quot;Host1&quot; -PoutputHost=&quot;Host2&quot; -Pduration=1 --stacktrace
  </code></pre>
  <p>In import.gradle , there is a mlcp task, where we are passing a taskName.json(where all the query are written in json format to fetch the data from input host) in <code>query_filter</code> field.</p>
  <p>While running the task, I am getting:</p>
  <blockquote>
  <p>Caused by: java.io.IOException: Cannot run program &quot;C:\Program Files\Java\jdk1.8.0_211\bin\java.exe&quot; (in directory &quot;D:\Data1&quot;): CreateProcess error=206, The filename or extension is too long
  at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
  ... 5 more
  Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
  ... 6 more</p>
  </blockquote>
  <p>When I removed some query from taskName.json, I am not getting any issue.
  I want to know, are there any constraints over size or number of queries written in taskName.json that we should have to pass in <code>query_filter</code> parameter to run the mlcp task?</p>
  <p>total no of line of query content in taskName.json is 398</p>
  <p>taskName.json file content sample</p>
  <pre><code>{
      &quot;andQuery&quot;: {
          &quot;queries&quot;: [{
              &quot;collectionQuery&quot;: {
                  &quot;uris&quot;: [&quot;collection1&quot;]
              }
          },
          {
              &quot;orQuery&quot;: {
                  &quot;queries&quot;: [
                  {
                      &quot;elementValueQuery&quot;: {
                          &quot;element&quot;: [&quot;{http://namespace.com/a/b}id&quot;],
                          &quot;text&quot;: [&quot;text1&quot;],
                          &quot;options&quot;: [&quot;lang=en&quot;]
                      }
                  },
                  {
                      &quot;elementValueQuery&quot;: {
                          &quot;element&quot;: [&quot;{http://namespace.com/a/b}id&quot;],
                          &quot;text&quot;: [&quot;text2&quot;],
                          &quot;options&quot;: [&quot;lang=en&quot;]
                      }
                  }]
              }
          },
          {
              &quot;notQuery&quot;: {
                  &quot;query&quot;: {
                      &quot;elementRangeQuery&quot;: {
                          &quot;element&quot;: [&quot;{http://namespace.com/a/b}date&quot;],
                          &quot;operator&quot;: &quot;&gt;&quot;,
                          &quot;value&quot;: [{
                              &quot;type&quot;: &quot;dateTime&quot;,
                              &quot;val&quot;: &quot;%%now%%&quot;
                          }]
                      }
                  }
              }
          }]
      }
  }
  </code></pre>
  <p>import.gradle</p>
  <pre><code>def importDirs =  new File(&quot;./teams&quot;).listFiles()
  
  importDirs.each { importDir -&gt;
      def queries = importDir.listFiles()
      queries.each { file -&gt;
          def taskname = importDir.name + &quot;_&quot; +file.name.replace('.json', '')        
          task &quot;copy_$taskname&quot; (
                      type: com.marklogic.gradle.task.MlcpTask,
                      group: 'abc',
                      dependsOn: []) {            
                  classpath = configurations.mlcp
                  command = 'COPY'
                  input_database = mlAppConfig.contentDatabaseName
                  input_host = inputHost
                  input_port = port
                  input_username = inputUsername
                  input_password = inputPassword
                  output_database = mlAppConfig.contentDatabaseName
                  output_host = outputHost
                  output_port = port
                  output_username = outputUsername
                  output_password = outputPassword
                  query_filter = file.text.replaceAll('&quot;','\\\\&quot;').replaceAll('%%now%%', now).replaceAll('%%targetDate%%', targetDate)
                  max_split_size = 500                   
          }
      }
  }
  </code></pre>