title: Gradle to load Groovy 3 library
body: <p>I am using these lines to add groovy 3.0.3 library to the project. I didn't like the hard coding the path in <code>build.gradle</code> file. Is there a better way to include Groovy 3.0 library to the project?</p>
  <pre><code>  implementation 'org.codehaus.groovy:groovy-all:3.0.3'    
      compile fileTree(dir: 'C:\\Software\\groovy-3.0.3\\lib', includes: ['*.jar'])
  </code></pre>
  <p>Thanks
  SR</p>
  <p>If I remove compile line getting this error.</p>
  <pre><code>Starting Gradle Daemon...
  Gradle Daemon started in 7 s 310 ms
  &gt; Task :compileJava
  
  &gt; Task :compileGroovy
  startup failed:
  C:\work\src\main\groovyCheckCertificate.groovy: 2: unable to resolve class groovy.yaml.YamlSlurper
   @ line 2, column 1.
     import groovy.yaml.YamlSlurper
     ^
  
  1 error
  
  
  &gt; Task :compileGroovy FAILED
  </code></pre>