How can I resolve warnings?

In my project, I got some warnings and I want to know how to resolve them.
I would appreciate it if you could help me.

Warnings:

Plugin validation failed. See https://docs.gradle.org/6.5/userguide/more_about_tasks.html#sec:task_input_output_annotations for more information on how to annotate task properties.
Warning: Type ‘JarmonicaCreateTask’: field ‘taskType’ without corresponding getter has been annotated with @Internal.
Warning: Type ‘JarmonicaCreateTask’: property ‘taskType$harmonica’ is not annotated with an input or output annotation.
Warning: Type ‘JarmonicaDownTask’: property ‘taskType$harmonica’ is not annotated with an input > or output annotation.
Warning: Type ‘JarmonicaMigrationTask’: property ‘taskType$harmonica’ is not annotated with an input or output annotation.
Warning: Type ‘JarmonicaUpTask’: property ‘taskType$harmonica’ is not annotated with an input or output annotation.
Warning: Type ‘JarmonicaVersionTask’: property ‘taskType$harmonica’ is not annotated with an input or output annotation.

Code:

// Kotlin
package com.improve_future.harmonica.plugin

import org.gradle.api.tasks.Internal

open class JarmonicaCreateTask : JarmonicaMigrationTask() {
    @Internal
    override val taskType = JarmonicaTaskType.Create

    override fun exec() {
        val migrationName =
                if (project.hasProperty("migrationName"))
                    project.properties["migrationName"] as String
                else "Migration"

        jvmArgs = listOf<String>()
        args = buildJarmonicaArgument(migrationName).toList()
        super.exec()
    }
}

Full project: https://github.com/KenjiOhtsuka/harmonica

I think the problem is this parent class has an internal field. But when I add @Internal annotation to it, the error “This annotation is not applicable to target 'member property without backing field or delegate” rises.

// Kotlin
abstract class JarmonicaMigrationTask : JavaExec() {
    internal abstract val taskType: JarmonicaTaskType

Thanks in advance

Hi,

does this work:

    @get:Internal
    override val taskType = ...

Cheers,
Stefan

Thank you! It worked!