Inhouse Conventions for Standard Plugins , Implementation Pattern

I want to write a Inhouse specific strongly opinated Plugin, which shortcuts and supplies in-house defaults for the standard MavenPlugin. Additionally it is also a requirement that the developer is able to “overwrite” the defaults values, where it makes sense.

So i looked for guidance in the and specifically

This was a good starting point. The convention for the Java sourceSets is enforced with

SourceSet main = javaConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);

Now, for my scenario the developer should be able to “overrule” this convention: it should be a default, which can be changed.

So I added a Extension Class for the Plugin and moved the above SourceSet configuration to a method configure() the Extension Class:

public void configure() {
        JavaPluginConvention javaConvention =
            SourceSet main = javaConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);

In the Plugin class i only apply the JavaPlugin and create the Extension “javaConventions” with the Project instance as constructor arg:

public void apply(Project project) {
		final ExtensionContainer ext = project.getExtensions();
		final PluginContainer plugins = project.getPlugins();
		ext.create("javaConventions", InhouseConventionJavaExtension.class, project);

It seems to work fine, for the following build.gradle i get the expected output:

apply plugin: extensiontest.InhouseConventionJavaPlugin
javaConventions {

javaConventions.sourceDir = "src/main/java"

My question: Is this a valid pattern to provide reasonable defaults, but which can be changed, for Grade Plugins, for example the MavenPlugin? What disturbs me with this solution is the necessity of javaConventions.configure(). Are there better way to achieve the same?

Any input, feedback, options greatly appreciated