Gradle does nothing on distZip task from distribution plugin

I found out what the Problem was:

The distZip wasn't working, because there were no files or libraries configured to be packed into the archive. By default, only the src/$distribution.name/dist is considered. The rest must be specified.

To ensure that at least the jar-File of the project is contained too, I used the plugin "java-library-distribution" instead of "distribution"

Furthermore I specified more files to consider:

distributions {
    main {
        contents {
            from { 'distrib' }
        }
    }
}

If your $buildDir is empty, you have to configure a distribution:

distributions {
    main {
        baseName = 'someName'
        contents {
            from { 'src/readme' }
        }
    }
}

Also see https://gradle.org/docs/current/userguide/distribution_plugin.html