In multiprojects, parent jar fails to include child classes

In a multiproject, gradle jar in a parent context should recognize that it needs to include classes built from child projects.

As a workaround, users can manually add configuration like:

allprojects {
  apply plugin: 'maven'

  repositories {
    mavenCentral()
    mavenLocal()
  }
}

// Fix `gradle install` for Maven multiproject
subprojects.each { subproject ->
  evaluationDependsOn(subproject.path)
}
task mmJar(type: Jar, dependsOn: subprojects.jar) {
  subprojects.each { subproject ->
    from subproject.configurations.archives.artifacts.files.collect {
      zipTree(it)
    }
  }
}
install.dependsOn mmJar

But it would be better if the jar task were simply recursive by default.

I don’t agree. Building a multi-project into a single fatjar is a very specific use case. We have no intention of changing the default behavior of jar-per-project for the ‘java’ plugin.