<NME> build.gradle
<BEF> allprojects {
    apply plugin: 'java'
    apply plugin: 'eclipse'

    version = '1.9.0'

    group = 'de.bwaldvogel'

    sourceCompatibility = 1.8
    targetCompatibility = 1.8

    compileJava.options.encoding = 'UTF-8'

    repositories {
        mavenCentral()
    }

    dependencies {
        components.all { ComponentMetadataDetails details ->
            if (details.id.version =~ /(?i).+(-|\.)(CANDIDATE|RC|BETA|ALPHA|PR|M\d+).*/) {
                details.status = 'milestone'
            }
        }
    }

    dependencyLocking {
        lockAllConfigurations()
    }
}

subprojects {
    dependencies {
        implementation group: 'org.slf4j', name: 'slf4j-api', version: 'latest.release'

        testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: 'latest.release'
        testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: 'latest.release'
        testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: 'latest.release'
        testImplementation group: 'org.assertj', name: 'assertj-core', version: 'latest.release'
        testRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic', version: '[1.3.0, 1.4.0)'
        testRuntimeOnly group: 'org.slf4j', name: 'jcl-over-slf4j', version: 'latest.release'
    }

    test {

}

// https://github.com/bmuschko/gradle-nexus-plugin
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
    }
}

ext {
    title = 'mongo-java-server'
    url = 'https://www.github.com/bwaldvogel/mongo-java-server'

ext {
    title = 'mongo-java-server'
    isReleaseVersion = !version.endsWith('SNAPSHOT')
}

jar {
    manifest {
        attributes 'Implementation-Title': title, 'Implementation-Version': archiveVersion
    }
}

allprojects {
    task sourceJar(type: Jar) {
        archiveClassifier = "sources"
        from sourceSets.main.allJava
    }

    task javadocJar(type: Jar, dependsOn: javadoc) {
        archiveClassifier = "javadoc"
        from javadoc.destinationDir
    }
}

configure(allprojects.findAll {it.name != 'mongo-java-server-examples'}) {
    apply plugin: 'maven-publish'
    apply plugin: 'signing'

    publishing {
        publications {
            mavenJava(MavenPublication) {
                groupId = 'de.bwaldvogel'
                artifactId = project.name
                version = project.version
                pom {
                    name = title
                    description = 'Fake implementation of MongoDB in Java that speaks the wire protocol'
                    url = 'https://github.com/bwaldvogel/mongo-java-server'
                    inceptionYear = '2012'

                    licenses {
                        license {
                            name = 'The BSD License'
                            url = 'http://www.opensource.org/licenses/bsd-license.php'
                            distribution = 'repo'
                        }
                    }
                    developers {
                        developer {
                            id = 'bwaldvogel'
                            name = 'Benedikt Waldvogel'
                            email = 'mail@bwaldvogel.de'
                        }
                    }
                    scm {
}

wrapper {
	gradleVersion = "4.10.2"
	distributionType = Wrapper.DistributionType.ALL
}

dependencies {
    gradleVersion = "7.5"
    distributionType = Wrapper.DistributionType.ALL
}

javadoc {
    options.addBooleanOption('html5', true)
}

dependencies {
    api project(':mongo-java-server-core')
    api project(':mongo-java-server-memory-backend')

    jacocoAggregation subprojects
}

tasks.named('check') {
    dependsOn tasks.named('testCodeCoverageReport', JacocoReport)
}


<MSG> Add coveralls plugin

<DFF> @@ -1,6 +1,21 @@
+// https://github.com/bmuschko/gradle-nexus-plugin
+buildscript {
+    repositories {
+        jcenter()
+    }
+
+    dependencies {
+        classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
+    }
+}
+
+plugins {
+    id 'com.github.kt3k.coveralls' version '2.8.2'
+}
+
 allprojects {
     apply plugin: 'java'
-    apply plugin: 'eclipse'
+    apply plugin: 'jacoco'
 
     version = '1.9.0'
 
@@ -44,17 +59,6 @@ allprojects {
 
 }
 
-// https://github.com/bmuschko/gradle-nexus-plugin
-buildscript {
-    repositories {
-        jcenter()
-    }
-
-    dependencies {
-        classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
-    }
-}
-
 ext {
     title = 'mongo-java-server'
     url = 'https://www.github.com/bwaldvogel/mongo-java-server'
@@ -116,8 +120,44 @@ allprojects {
 }
 
 wrapper {
-	gradleVersion = "4.10.2"
-	distributionType = Wrapper.DistributionType.ALL
+    gradleVersion = "4.10.2"
+    distributionType = Wrapper.DistributionType.ALL
+}
+
+task jacocoMerge(type: JacocoMerge) {
+    subprojects.each { subproject ->
+        executionData subproject.tasks.withType(Test)
+    }
+    doFirst {
+        executionData = files(executionData.findAll { it.exists() })
+    }
+}
+
+task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
+    description = 'Generates an aggregate report from all subprojects'
+    dependsOn subprojects.test, jacocoMerge
+
+    additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
+    sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
+    classDirectories = files(subprojects.sourceSets.main.output)
+    executionData jacocoMerge.destinationFile
+
+    reports {
+        html.enabled = true // human readable
+        xml.enabled = true // required by coveralls
+    }
+}
+
+coveralls {
+    sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
+    jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
+}
+
+tasks.coveralls {
+    group = 'Coverage reports'
+    description = 'Uploads the aggregated coverage report to Coveralls'
+
+    dependsOn jacocoRootReport
 }
 
 dependencies {

Add coveralls plugin