gradle
8.3

# registerIfAbsent

abstract fun <T : BuildService<P>?, P : BuildServiceParameters?> registerIfAbsent(name: String, implementationType: Class<T>, configureAction: Action<out Any>): Provider<T>

Registers a service, if a service with the given name is not already registered. The service is not created until required, when the returned Provider is queried.

#### Return

A Provider that will create the service instance when queried.

#### Parameters

name

A name to use to identify the service.

implementationType

The service implementation type. Instances of the service are created as for newInstance.

configureAction

An action to configure the registration. You can use this to provide parameters to the service instance.