In a spring boot application in the build.gradle

```
task loadDbConfigFromSpringProfile {

  def activeProfileProperties = new Properties()
    file("src/main/resources/application.properties").withInputStream {
      activeProfileProperties.load(it)
    }

  def profileProperties = new Properties()
    file("src/main/resources/application-" + activeProfileProperties.getProperty("spring.profiles.active") + ".properties").withInputStream {
     profileProperties.load(it)
  }

  active_db_url = profileProperties.getProperty("spring.datasource.url")

}

loadDbConfigFromSpringProfile.execute()

```

When i run application with **gradle 4.4**, I get

> 
> The TaskInternal.execute() method has been deprecated and is scheduled
>  to be removed in Gradle 5.0.
> 
> 
> 

I started to create a class who extends extends DefaultTask but I'm not sure if it's the easier way to fix issue.