title: Method return type in build.gradle
body: <p>I have a method in build.gradle that basically creates an oracle database connection and returns it. But while running the script, it shows build failed as seen in the screenshot below. </p>
  
  <pre><code>def ext.getOracleConnection = { -&gt;
              java.sql.Connection conn = null;
              try{
                  configurations.jdbcdriver.files.each {
                      groovy.sql.Sql.classLoader.addURL(it.toURI().toURL())
                  }   
                  configurations.xdb.files.each {
                      groovy.sql.Sql.classLoader.addURL(it.toURI().toURL())
                  }
                  //load the jdbc driver and create the connection.
                  java.sql.DriverManager.registerDriver(groovy.sql.Sql.classLoader.loadClass("oracle.jdbc.OracleDriver").newInstance())
                  readProperites();
                  conn = java.sql.DriverManager.getConnection(db_url, dbUser, dbPassword);
  
              }
              catch(Exception e){
                  e.printStackTrace();
              }
              return conn;
          }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/KAx3A.png" alt="enter image description here"></p>
  
  <p>I tried changing the return type to java.sql.Connection but it doesn't work. Can anyone suggest a solution?.</p>