Apply the java plugin before 'repositories' and 'dependencies'