diff --git a/src/main/groovy/org/beryx/jlink/PrepareMergedJarsDirTask.groovy b/src/main/groovy/org/beryx/jlink/PrepareMergedJarsDirTask.groovy index d44d2751..e30822a6 100644 --- a/src/main/groovy/org/beryx/jlink/PrepareMergedJarsDirTask.groovy +++ b/src/main/groovy/org/beryx/jlink/PrepareMergedJarsDirTask.groovy @@ -65,7 +65,7 @@ class PrepareMergedJarsDirTask extends BaseTask { PrepareMergedJarsDirTask() { description = 'Merges all non-modularized jars into a single module' - project.afterEvaluate { + project.getGradle().projectsEvaluated { def projects = Util.getAllDependentProjects(project) + project def jarTasks = projects*.getTasksByName('jar', true).flatten() as Task[] dependsOn(jarTasks)