It’s not recommended to explicitly call the ‘execute’ method of a task. This is done by Gradle internally. If you want a task to be executed as part of your task execution graph, you will need to make a task dependency of another task or directed request its execution from the command line.
I’d need to have more information to determine what can be configured during configuration or execution time. Please provide more information on your use case.