Working Gradle script for correct deployment