@@ -383,7 +383,7 @@ task packageDistroWithDependencies(type: Zip, dependsOn: buildDistroWithDependen
383383
384384assemble. dependsOn packageLanguages, packageTests
385385
386- static def addDependency (Object pom , Object groupId , Object artifactId , Object version , Object type = null ) {
386+ static def addDependency (Object pom , Object groupId , Object artifactId , Object version , Object type = null , String scope = null ) {
387387 pom. withXml { XmlProvider prov ->
388388 Node root = prov. asNode()
389389 Node deps = root. dependencies[0 ] ?: root. appendNode(" dependencies" )
@@ -394,14 +394,16 @@ static def addDependency(Object pom, Object groupId, Object artifactId, Object v
394394 if (type != null ) {
395395 dep. appendNode(" type" , type)
396396 }
397+ if (scope != null ) {
398+ dep. appendNode(" scope" , scope)
399+ }
397400 }
398401}
399402
400- static def addDependency (Object pom , Configuration config ) {
403+ static def addDependency (MavenPom pom , Configuration config , String scope = null ) {
401404 config. resolvedConfiguration. firstLevelModuleDependencies. each {
402- addDependency(pom, it. moduleGroup, it. moduleName, it. moduleVersion, it. moduleArtifacts[0 ]. type)
405+ addDependency(pom, it. moduleGroup, it. moduleName, it. moduleVersion, it. moduleArtifacts[0 ]. type, scope )
403406 }
404-
405407}
406408
407409ext. additionalPomInfo = {
@@ -425,6 +427,12 @@ ext.additionalPomInfo = {
425427 }
426428}
427429
430+ ext. addBundledDependencies = { MavenPom pom ->
431+ bundledDeps. each {
432+ addDependency(pom, configurations[it. configName], ' provided' )
433+ }
434+ }
435+
428436publishing {
429437 repositories {
430438 maven {
@@ -458,6 +466,8 @@ publishing {
458466
459467 addDependency(pom, configurations. languageLibs)
460468
469+ pom addBundledDependencies
470+
461471 pom additionalPomInfo
462472 }
463473
0 commit comments