How to reference a task defined in model block from outside it?

Hi,
can anyone tell me how to reference a task defined in model block from outside it?

I just want to zip some native .so files (hence the task “zipAllSharedLibraries”) and to use the generated archive as an artifact for deployment to remote repo via maven-publish plugin. (the zip generation works well)

Unfortunately, the task is not recognized this way.

Any help? Thank you in advance.
M.

model {
    tasks {
        zipAllSharedLibraries(Zip) {}
    }
}

publishing {
    publications {
        natives(MavenPublication) {
            groupId 'org.example'
            artifactId 'natives'

            artifact zipAllSharedLibraries
        }
    }
}