Should a task extension's properties by annotated as @Input?


Suppose I add an extension object to a Jar task’s ExtensionContainer, in order to extend its DSL like this:

jar {
    myExtension {
        myInput = 'myCustomValue'


class MyExtension @Inject constructor(objects: ObjectFactory) {
    val myInput: Property<String> =

I have previously been assuming that Gradle will detect the myInput property and its @Input annotation automatically, but now I am not so sure… Do I actually need to register this property manually via TaskInputs? Something like:

tasks.named('jar', Jar) {'myInput', myExtension.myInput)

I see this approach explicitly states that it does not support @Nested :man_facepalming:, presumably to prevent me from doing something like this:

tasks.named('jar', Jar) {

This is exactly what I really want to do, of course. Does, value) at least work with “lazy” properties and task configuration avoidance please?