diff --git a/cdaschema/build.gradle b/cdaschema/build.gradle index 2d1ef7648..21d74be49 100644 --- a/cdaschema/build.gradle +++ b/cdaschema/build.gradle @@ -44,11 +44,6 @@ task generateXmlBeans(type: JavaExec) { } -task copyJar(type: Copy) { - from 'build/libs/cda-schema.jar' - into "${project(':data-ingestion-service').projectDir}/libs/" -} - compileJava.dependsOn generateXmlBeans // Disable the default jar task @@ -63,5 +58,9 @@ artifacts { archives cdaSchemaJar } +task copyJar(type: Copy) { + from "${buildDir}/libs/cda-schema.jar" + into "${project(':data-ingestion-service').projectDir}/libs/" +} cdaSchemaJar.mustRunAfter compileJava -build.finalizedBy copyJar +generateXmlBeans.finalizedBy(copyJar) diff --git a/data-ingestion-service/build.gradle b/data-ingestion-service/build.gradle index 33231f62b..07bf5cefc 100644 --- a/data-ingestion-service/build.gradle +++ b/data-ingestion-service/build.gradle @@ -182,7 +182,7 @@ task jaxb { compileJava.dependsOn jaxb if (project != project.rootProject || project.hasProperty('remoteBuild')) { - compileJava.mustRunAfter(":hl7-parser:build") + compileJava.mustRunAfter(":hl7-parser:copyJar") compileJava.mustRunAfter(":cdaschema:copyJar") } @@ -283,7 +283,7 @@ jar { // Conditionally add dependencies from projects if (findProject(':hl7-parser')) { - dependsOn(':hl7-parser:jar') + dependsOn(':hl7-parser:copyJar') } if (findProject(':cdaschema')) { diff --git a/hl7-parser/build.gradle b/hl7-parser/build.gradle index 9cf9dac78..39aecee45 100644 --- a/hl7-parser/build.gradle +++ b/hl7-parser/build.gradle @@ -39,5 +39,5 @@ task copyJar(type: Copy) { into "${project(':data-ingestion-service').projectDir}/libs/" } -build.dependsOn copyJar +build.finalizedBy(copyJar)