@@ -449,6 +449,29 @@ bundlePlugin {
449449 }
450450}
451451
452+ // create source set 'integrationTest'
453+ // add classes from the main source set to the compilation and runtime classpaths of the integrationTest
454+ sourceSets {
455+ integrationTest {
456+ java {
457+ srcDir file (' src/integrationTest/java' )
458+ compileClasspath + = sourceSets. main. output
459+ runtimeClasspath + = sourceSets. main. output
460+ }
461+ resources {
462+ srcDir file(' src/integrationTest/resources' )
463+ }
464+ processIntegrationTestResources {
465+ duplicatesStrategy(DuplicatesStrategy . INCLUDE )
466+ }
467+ }
468+ }
469+
470+ configurations {
471+ integrationTestImplementation. extendsFrom implementation
472+ integrationTestRuntimeOnly. extendsFrom runtimeOnly
473+ }
474+
452475configurations {
453476 all {
454477 resolutionStrategy {
@@ -497,9 +520,24 @@ configurations {
497520 force " com.google.guava:failureaccess:1.0.3"
498521 }
499522 }
523+ }
500524
501- integrationTestImplementation. extendsFrom implementation
502- integrationTestRuntimeOnly. extendsFrom runtimeOnly
525+ subprojects {
526+ plugins. withId(' java' ) {
527+ dependencies {
528+ testImplementation ' org.hamcrest:hamcrest:2.2'
529+ testImplementation ' junit:junit:4.13.2'
530+ testImplementation " org.opensearch:opensearch:${ opensearch_version} "
531+ testImplementation " org.mockito:mockito-core:5.20.0"
532+ }
533+
534+ afterEvaluate {
535+ if (project. configurations. findByName(' integrationTestImplementation' )) {
536+ configurations. integrationTestImplementation. extendsFrom configurations. implementation
537+ configurations. integrationTestRuntimeOnly. extendsFrom configurations. runtimeOnly
538+ }
539+ }
540+ }
503541}
504542
505543allprojects {
@@ -513,87 +551,62 @@ allprojects {
513551 maven { url " build.shibboleth.net/maven/releases" }
514552 }
515553
516- configurations {
517- integrationTestImplementation. extendsFrom implementation
518- compile. extendsFrom compileOnly
519- compile. extendsFrom testImplementation
520- }
521- dependencies {
522- // unit test framework
523- testImplementation ' org.hamcrest:hamcrest:2.2'
524- testImplementation ' junit:junit:4.13.2'
525- testImplementation " org.opensearch:opensearch:${ opensearch_version} "
526- testImplementation " org.mockito:mockito-core:5.20.0"
527-
528- // integration test framework:
529- integrationTestImplementation(' com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3' ) {
530- exclude(group : ' junit' , module : ' junit' )
531- }
532- integrationTestImplementation ' junit:junit:4.13.2'
533- integrationTestImplementation(" org.opensearch.plugin:reindex-client:${ opensearch_version} " ){
534- exclude(group : ' org.slf4j' , module : ' slf4j-api' )
535- }
536- integrationTestImplementation " org.opensearch:protobufs:${ versions.opensearchprotobufs} "
537- integrationTestImplementation " io.grpc:grpc-stub:${ versions.grpc} "
538- integrationTestImplementation " io.grpc:grpc-netty-shaded:${ versions.grpc} "
539- integrationTestImplementation " org.opensearch.plugin:transport-grpc:${ opensearch_version} "
540- integrationTestImplementation " org.opensearch.plugin:percolator-client:${ opensearch_version} "
541- integrationTestImplementation ' commons-io:commons-io:2.21.0'
542- integrationTestImplementation " org.apache.logging.log4j:log4j-core:${ versions.log4j} "
543- integrationTestImplementation " org.apache.logging.log4j:log4j-jul:${ versions.log4j} "
544- integrationTestImplementation ' org.hamcrest:hamcrest:2.2'
545- integrationTestImplementation " org.bouncycastle:bc-fips:${ versions.bouncycastle_jce} "
546- integrationTestImplementation " org.bouncycastle:bcpkix-fips:${ versions.bouncycastle_pkix} "
547- integrationTestImplementation " org.bouncycastle:bcutil-fips:${ versions.bouncycastle_util} "
548- integrationTestImplementation(' org.awaitility:awaitility:4.3.0' ) {
549- exclude(group : ' org.hamcrest' , module : ' hamcrest' )
550- }
551- integrationTestImplementation ' com.unboundid:unboundid-ldapsdk:4.0.14'
552- integrationTestImplementation " org.opensearch.plugin:mapper-size:${ opensearch_version} "
553- integrationTestImplementation " org.apache.httpcomponents:httpclient-cache:4.5.14"
554- integrationTestImplementation " org.apache.httpcomponents:httpclient:4.5.14"
555- integrationTestImplementation " org.apache.httpcomponents:fluent-hc:4.5.14"
556- integrationTestImplementation " org.apache.httpcomponents:httpcore:4.4.16"
557- integrationTestImplementation " org.apache.httpcomponents:httpasyncclient:4.1.5"
558- integrationTestImplementation " org.mockito:mockito-core:5.20.0"
559- integrationTestImplementation " org.passay:passay:1.6.6"
560- integrationTestImplementation " org.opensearch:opensearch:${ opensearch_version} "
561- integrationTestImplementation " org.opensearch.plugin:transport-netty4-client:${ opensearch_version} "
562- integrationTestImplementation " org.opensearch.plugin:aggs-matrix-stats-client:${ opensearch_version} "
563- integrationTestImplementation " org.opensearch.plugin:parent-join-client:${ opensearch_version} "
564- integrationTestImplementation " com.password4j:password4j:${ versions.password4j} "
565- integrationTestImplementation " com.google.guava:guava:${ guava_version} "
566- integrationTestImplementation " org.apache.commons:commons-lang3:${ versions.commonslang} "
567- integrationTestImplementation " com.fasterxml.jackson.core:jackson-databind:${ versions.jackson_databind} "
568- integrationTestImplementation ' org.greenrobot:eventbus-java:3.3.1'
569- integrationTestImplementation " org.apache.commons:commons-collections4:${ versions.commonscollections4} "
570- integrationTestImplementation(' com.flipkart.zjsonpatch:zjsonpatch:0.4.16' ){
571- exclude(group :' com.fasterxml.jackson.core' )
572- exclude(group : ' org.apache.commons' , module : ' commons-collections4' )
573- }
574- integrationTestImplementation ' org.slf4j:slf4j-api:2.0.12'
575- integrationTestImplementation ' com.selectivem.collections:special-collections-complete:1.4.0'
576-
577- integrationTestImplementation (' com.jayway.jsonpath:json-path:2.10.0' ) {
578- exclude(group : ' net.minidev' , module : ' json-smart' )
579- }
580- }
581- }
554+ afterEvaluate {
555+ if (project. configurations. findByName(' integrationTestImplementation' )) {
556+ dependencies {
557+ // integration test framework:
558+ integrationTestImplementation(' com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3' ) {
559+ exclude(group : ' junit' , module : ' junit' )
560+ }
561+ integrationTestImplementation ' junit:junit:4.13.2'
562+ integrationTestImplementation(" org.opensearch.plugin:reindex-client:${ opensearch_version} " ){
563+ exclude(group : ' org.slf4j' , module : ' slf4j-api' )
564+ }
565+ integrationTestImplementation " org.opensearch:protobufs:${ versions.opensearchprotobufs} "
566+ integrationTestImplementation " io.grpc:grpc-stub:${ versions.grpc} "
567+ integrationTestImplementation " io.grpc:grpc-netty-shaded:${ versions.grpc} "
568+ integrationTestImplementation " org.opensearch.plugin:transport-grpc:${ opensearch_version} "
569+ integrationTestImplementation " org.opensearch.plugin:percolator-client:${ opensearch_version} "
570+ integrationTestImplementation ' commons-io:commons-io:2.21.0'
571+ integrationTestImplementation " org.apache.logging.log4j:log4j-core:${ versions.log4j} "
572+ integrationTestImplementation " org.apache.logging.log4j:log4j-jul:${ versions.log4j} "
573+ integrationTestImplementation ' org.hamcrest:hamcrest:2.2'
574+ integrationTestImplementation " org.bouncycastle:bc-fips:${ versions.bouncycastle_jce} "
575+ integrationTestImplementation " org.bouncycastle:bcpkix-fips:${ versions.bouncycastle_pkix} "
576+ integrationTestImplementation " org.bouncycastle:bcutil-fips:${ versions.bouncycastle_util} "
577+ integrationTestImplementation(' org.awaitility:awaitility:4.3.0' ) {
578+ exclude(group : ' org.hamcrest' , module : ' hamcrest' )
579+ }
580+ integrationTestImplementation ' com.unboundid:unboundid-ldapsdk:4.0.14'
581+ integrationTestImplementation " org.opensearch.plugin:mapper-size:${ opensearch_version} "
582+ integrationTestImplementation " org.apache.httpcomponents:httpclient-cache:4.5.14"
583+ integrationTestImplementation " org.apache.httpcomponents:httpclient:4.5.14"
584+ integrationTestImplementation " org.apache.httpcomponents:fluent-hc:4.5.14"
585+ integrationTestImplementation " org.apache.httpcomponents:httpcore:4.4.16"
586+ integrationTestImplementation " org.apache.httpcomponents:httpasyncclient:4.1.5"
587+ integrationTestImplementation " org.mockito:mockito-core:5.20.0"
588+ integrationTestImplementation " org.passay:passay:1.6.6"
589+ integrationTestImplementation " org.opensearch:opensearch:${ opensearch_version} "
590+ integrationTestImplementation " org.opensearch.plugin:transport-netty4-client:${ opensearch_version} "
591+ integrationTestImplementation " org.opensearch.plugin:aggs-matrix-stats-client:${ opensearch_version} "
592+ integrationTestImplementation " org.opensearch.plugin:parent-join-client:${ opensearch_version} "
593+ integrationTestImplementation " com.password4j:password4j:${ versions.password4j} "
594+ integrationTestImplementation " com.google.guava:guava:${ guava_version} "
595+ integrationTestImplementation " org.apache.commons:commons-lang3:${ versions.commonslang} "
596+ integrationTestImplementation " com.fasterxml.jackson.core:jackson-databind:${ versions.jackson_databind} "
597+ integrationTestImplementation ' org.greenrobot:eventbus-java:3.3.1'
598+ integrationTestImplementation " org.apache.commons:commons-collections4:${ versions.commonscollections4} "
599+ integrationTestImplementation(' com.flipkart.zjsonpatch:zjsonpatch:0.4.16' ){
600+ exclude(group :' com.fasterxml.jackson.core' )
601+ exclude(group : ' org.apache.commons' , module : ' commons-collections4' )
602+ }
603+ integrationTestImplementation ' org.slf4j:slf4j-api:2.0.12'
604+ integrationTestImplementation ' com.selectivem.collections:special-collections-complete:1.4.0'
582605
583- // create source set 'integrationTest'
584- // add classes from the main source set to the compilation and runtime classpaths of the integrationTest
585- sourceSets {
586- integrationTest {
587- java {
588- srcDir file (' src/integrationTest/java' )
589- compileClasspath + = sourceSets. main. output
590- runtimeClasspath + = sourceSets. main. output
591- }
592- resources {
593- srcDir file(' src/integrationTest/resources' )
594- }
595- processIntegrationTestResources {
596- duplicatesStrategy(DuplicatesStrategy . INCLUDE )
606+ integrationTestImplementation (' com.jayway.jsonpath:json-path:2.10.0' ) {
607+ exclude(group : ' net.minidev' , module : ' json-smart' )
608+ }
609+ }
597610 }
598611 }
599612}
@@ -801,24 +814,14 @@ dependencies {
801814}
802815
803816jar {
804- libsDirName = ' .'
805- into ' ' , {
806- from ' NOTICE.txt' , " THIRD-PARTY.txt" , " LICENSE"
807- }
808- processResources {
809- exclude(" KEYS" )
810- }
817+ from(' NOTICE.txt' , ' THIRD-PARTY.txt' , ' LICENSE' )
811818}
812819
813820tasks. register(' testsJar' , Jar ) {
814821 archiveClassifier = ' tests'
815822 from(sourceSets. test. output)
816823}
817824
818- testsJar {
819- libsDirName = ' .'
820- }
821-
822825task bundleSecurityAdminStandalone (dependsOn : jar, type : Zip ) {
823826 archiveClassifier = ' securityadmin-standalone'
824827 from(configurations. runtimeClasspath) {
@@ -901,7 +904,7 @@ afterEvaluate {
901904 version = " ${ project.version} " - " -SNAPSHOT"
902905
903906 into ' /usr/share/opensearch/plugins'
904- from(zipTree(bundlePlugin. archivePath )) {
907+ from(zipTree(bundlePlugin. archiveFile )) {
905908 into opensearchplugin. name
906909 }
907910
0 commit comments