Regarding sourceCodeCompatibility

In my root project , I have the below configuration

subprojects {
apply plugin: 'java'
sourceCompatibility = 1.6

I want to move this configuration to init.gradle under user-home directory.

When I add the above to init.gradle , then I get the below error

Execution failed for task ‘:uploadArchives’. > Could not publish configuration ‘:archives’.

For artifact {:framework-app:unspecified:jar}: The groupId cannot be empty.

Does apply plugin: ‘java’ has impact on maven artifact Id ?

no it doesnt, but the uploadArchives task requires you to set the group property of your project.

The same configuration works if i move the apply plugin:‘java’ out of the init.gradle and move it to the individual project.