After migrating to gradle 2.4 maven-publish tasks ignored

In my custom plugin I’m using “maven-publish” plugin with number of publications (labels is list of custom objects):

    project.publishing {
        publications {
            labels.each { info ->
                "model${}"(MavenPublication) {
                    artifactId "${info.artifactId}"
                    artifact project.tasks."${info.lower}Jar"
                    artifact project.tasks."source${}Jar"

        repositories {
            maven { name 'release'; url extension.releaseRepository }
            maven { name 'snapshot'; url extension.snapshotRepository }

Then I create task:

def releaseTask = project.task('modelRelease')
releaseTask.dependsOn project.tasks.matching {'ToReleaseRepository') }
releaseTask.dependsOn project.tasks.createTag = 'Model release'
releaseTask.description = 'Release new model'

When running ‘modelRelease’ task of my project:
Using gradle 2.3 everything works fine, all model artifacts upload to release maven repository successfully.
Using gradle 2.4 ‘modelRelease’ task ignores publish tasks:

$ ./gradlew model:tasks --all
modelRelease - Release new model [publishModelBasePublicationToReleaseRepository, publishModelDemoPublicationToReleaseRepository]

$ ./gradlew model:modelRelease
Parallel execution with configuration on demand is an incubating feature.

How can I fix it?

See Change of behaviour for @Finalize between 2.3 and 2.4 release - #5 by Francois_Guillot
Since 2.4, tasks are not created if not used. Therefore your ‘matching’ logic does not work anymore.
See @luke_daley answer in the link above for workaround, waiting for the true solution
which will be to create a @Mutate rule between your releaseTask and the publishXXXToReleaseRepository tasks