diff --git a/.github/workflows/microshed-ci.yml b/.github/workflows/microshed-ci.yml index faa2bac5..8f98ddf9 100644 --- a/.github/workflows/microshed-ci.yml +++ b/.github/workflows/microshed-ci.yml @@ -51,19 +51,20 @@ jobs: max-parallel: 18 matrix: include: - - category: JAXRS - projects: > - jaxrs-json - jaxrs-basicauth - jaxrs-mpjwt - everything-app - category: GENERAL projects: > maven-app - everything-app - everything-jakarta-app jdbc-app kafka-app + - category: COMPLEX + projects: > + everything-app + everything-jakarta-app + - category: RESTFUL + projects: > + jaxrs-json + jaxrs-basicauth + jaxrs-mpjwt - category: LIBERTY/PAYARA projects: > liberty-app diff --git a/build.gradle b/build.gradle index 279449fc..d1a334da 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,11 @@ ext.lastRelease = '0.9.1' subprojects { apply plugin: 'java' + apply plugin: 'java-library' + + // java-library will force inter-project dependencies to use class files instead of jars + // This system property disables that and goes back to using jars + System.setProperty("org.gradle.java.compile-classpath-packaging", "true"); ext.publishScript = rootProject.rootDir.absolutePath + '/publish.gradle' diff --git a/core/build.gradle b/core/build.gradle index e27ddb56..406c28d6 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -2,18 +2,21 @@ ext.title = "MicroShed Testing Framework" description="A test framework for black-box testing MicroProfile and Java EE applications" dependencies { - compile 'org.junit.jupiter:junit-jupiter-api:5.10.1' + //API for artifact and unit testing + api 'org.junit.jupiter:junit-jupiter-api:5.10.1' + //Java EE implementation 'org.eclipse:yasson:1.0.11' implementation 'org.glassfish:javax.json:1.1.4' + //Support Libraries implementation 'cglib:cglib-nodep:3.3.0' implementation 'org.apache.cxf:cxf-rt-rs-client:3.6.2' implementation 'org.apache.cxf:cxf-rt-rs-extension-providers:3.6.2' implementation 'org.bitbucket.b_c:jose4j:0.7.2' + //Unit testing testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } - apply from: publishScript diff --git a/core/jakarta/build.gradle b/core/jakarta/build.gradle index 3dbaf41a..1633abf1 100644 --- a/core/jakarta/build.gradle +++ b/core/jakarta/build.gradle @@ -4,61 +4,78 @@ ext.title = "MicroShed Testing Framework" description="A test framework for black-box testing MicroProfile and Jakarta EE applications" configurations { - transformer - parent {extendsFrom compile} + transformer {extendsFrom implementation} } dependencies { - compile 'org.junit.jupiter:junit-jupiter-api:5.10.1' + //API for artifact and unit testing + api 'org.junit.jupiter:junit-jupiter-api:5.10.1' + //Jakarta EE implementation 'org.eclipse:yasson:2.0.4' implementation 'org.eclipse.parsson:parsson:1.0.5' + //Support Libraries implementation 'cglib:cglib-nodep:3.3.0' implementation 'org.apache.cxf:cxf-rt-rs-client:4.0.3' implementation 'org.apache.cxf:cxf-rt-rs-extension-providers:4.0.3' implementation 'org.bitbucket.b_c:jose4j:0.7.2' + //Unit testing testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' + //Transform microshed-testing-core -> microshed-testing-core-jakarta transformer 'org.eclipse.transformer:org.eclipse.transformer.cli:0.5.0' - - parent project(':microshed-testing-core') } -ext.parent_jar = configurations.parent.find{ - it.name.startsWith("microshed-testing-core") -} -ext.transformed_jar = new File(projectDir, 'build/tmp/transformed/' + parent_jar.getName().replace('core', 'core-jakarta')) +jar { + mustRunAfter project(':microshed-testing-core').tasks.jar + mustRunAfter project(':microshed-testing-core').tasks.javadocJar + mustRunAfter project(':microshed-testing-core').tasks.sourcesJar -//Deletes previously transformed jar otherwise transformer will produce an error -task cleanupTransform() { - if(transformed_jar.exists()) { - transformed_jar.delete() - } -} + dependsOn project(':microshed-testing-core').tasks.jar + dependsOn project(':microshed-testing-core').tasks.javadocJar + dependsOn project(':microshed-testing-core').tasks.sourcesJar -//Creates the transformed archive in the build/tmp/transformed/ directory -task transform(type: JavaExec) { - dependsOn cleanupTransform - classpath = configurations.transformer - main = 'org.eclipse.transformer.cli.JakartaTransformerCLI' - args parent_jar, transformed_jar -} + def baseDir = project(':microshed-testing-core').buildDir + def baseJars = fileTree(baseDir).matching {include 'libs/*.jar' } -//Creates an empty jar file in the build/libs directory -//since there are no source files -jar.dependsOn transform + inputs.files(baseJars).skipWhenEmpty() + outputs.dir project.buildDir -//Overwrites the empty jar with the transformed jar in the build/libs directory -task overwrite(type: Copy) { - from(transformed_jar) - into('build/libs') -} + doLast { + new File(project.buildDir, "libs").mkdirs() + fileTree(project.buildDir).matching { include 'libs/*.jar' }.each { delete it } + + baseJars.each { bundleJar -> + def sourceJar = baseDir.path + '/libs/' + bundleJar.name + println 'Source jar name [ ' + sourceJar + ' ]' + + def transformedJar = project.buildDir.path + '/libs/' + bundleJar.name.replaceAll( 'microshed-testing-core', 'microshed-testing-core-jakarta' ) + println 'Transformed jar name [ ' + transformedJar + ' ]' -jar.finalizedBy overwrite + def transformerArgs = [sourceJar, transformedJar] + + javaexec { + classpath configurations.transformer + main = 'org.eclipse.transformer.cli.JakartaTransformerCLI' + args = transformerArgs + } + } + } +} apply from: publishScript +javadocJar { + mustRunAfter jar + dependsOn jar +} + +sourcesJar { + mustRunAfter jar + dependsOn jar +} + publishToMavenLocal.dependsOn ':microshed-testing-core:publishToMavenLocal' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 6b6ea3ab..f3d88b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0b7ed8da..db9a6b82 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip diff --git a/gradlew b/gradlew index cccdd3d5..2fe81a7d 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` @@ -138,19 +154,19 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -159,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index f9553162..24467a14 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,84 +1,100 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/modules/liberty/build.gradle b/modules/liberty/build.gradle index 43b33de5..6672fbd8 100644 --- a/modules/liberty/build.gradle +++ b/modules/liberty/build.gradle @@ -2,7 +2,8 @@ ext.title = "MicroShed Testing Framework :: Liberty extensions" description = "Extensions for using MicroShed Testing with Liberty servers" dependencies { - compile project(':microshed-testing-testcontainers') + api project(':microshed-testing-testcontainers') + compileOnly project(':microshed-testing-core') } diff --git a/modules/payara-micro/build.gradle b/modules/payara-micro/build.gradle index 1e05ca76..1b1e676b 100644 --- a/modules/payara-micro/build.gradle +++ b/modules/payara-micro/build.gradle @@ -2,7 +2,8 @@ ext.title = "MicroShed Testing Framework :: Payara Micro extensions" description = "Extensions for using MicroShed Testing with Payara Micro servers" dependencies { - compile project(':microshed-testing-testcontainers') + api project(':microshed-testing-testcontainers') + compileOnly project(':microshed-testing-core') } diff --git a/modules/payara-server/build.gradle b/modules/payara-server/build.gradle index 62f71d2c..563fce1c 100644 --- a/modules/payara-server/build.gradle +++ b/modules/payara-server/build.gradle @@ -2,7 +2,8 @@ ext.title = "MicroShed Testing Framework :: Payara Server extensions" description = "Extensions for using MicroShed Testing with Payara servers" dependencies { - compile project(':microshed-testing-testcontainers') + api project(':microshed-testing-testcontainers') + compileOnly project(':microshed-testing-core') } diff --git a/modules/quarkus/build.gradle b/modules/quarkus/build.gradle index 34af56eb..9b9a0cc3 100644 --- a/modules/quarkus/build.gradle +++ b/modules/quarkus/build.gradle @@ -2,9 +2,10 @@ ext.title = "MicroShed Testing Framework :: Quarkus extensions" description = "Extensions for using MicroShed Testing with Quarkus" dependencies { - compile project(':microshed-testing-testcontainers') + api 'io.quarkus:quarkus-junit5:1.8.3.Final' + api project(':microshed-testing-testcontainers') + compileOnly project(':microshed-testing-core') - compileOnly 'io.quarkus:quarkus-junit5:1.8.3.Final' } apply from: publishScript diff --git a/modules/testcontainers/build.gradle b/modules/testcontainers/build.gradle index 4717ee0e..d5dbf653 100644 --- a/modules/testcontainers/build.gradle +++ b/modules/testcontainers/build.gradle @@ -3,24 +3,30 @@ description = "Extensions for using MicroShed Testing with Testcontainers for ma configurations { intTestImplementation.extendsFrom testImplementation - intTestCompile.extendsFrom testCompile intTestRuntimeOnly.extendsFrom testRuntimeOnly } sourceSets { integrationTest { - compileClasspath += sourceSets.main.output + configurations.testCompile - runtimeClasspath += output + compileClasspath + configurations.intTestImplementation + compileClasspath += sourceSets.main.output + configurations.intTestImplementation + runtimeClasspath += output + compileClasspath + configurations.intTestRuntimeOnly } } dependencies { - compile 'org.testcontainers:junit-jupiter:1.19.1' + api 'org.junit.jupiter:junit-jupiter-api:5.10.1' + api 'org.testcontainers:junit-jupiter:1.19.1' + compileOnly project(':microshed-testing-core') - testCompile 'org.eclipse.microprofile.rest.client:microprofile-rest-client-api:1.4.1' - testCompile 'org.slf4j:slf4j-log4j12:1.7.36' - testCompile 'org.testcontainers:mockserver:1.19.1' - testCompile project(':microshed-testing-core') + + //Unit + Integration testing + testImplementation project(':microshed-testing-core') + + testImplementation 'org.eclipse.microprofile.rest.client:microprofile-rest-client-api:1.4.1' + + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' + testImplementation 'org.testcontainers:mockserver:1.19.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } @@ -33,6 +39,7 @@ test { apply from: publishScript publishToMavenLocal.dependsOn ':microshed-testing-core:publishToMavenLocal' +publishToMavenLocal.dependsOn ':microshed-testing-core-jakarta:publishToMavenLocal' task integrationTest(type: Test) { description = 'Runs integration tests.' diff --git a/modules/wildfly/build.gradle b/modules/wildfly/build.gradle index c30287b7..86455fa8 100644 --- a/modules/wildfly/build.gradle +++ b/modules/wildfly/build.gradle @@ -2,7 +2,8 @@ ext.title = "MicroShed Testing Framework :: WildFly extensions" description = "Extensions for using MicroShed Testing with WildFly servers" dependencies { - compile project(':microshed-testing-testcontainers') + api project(':microshed-testing-testcontainers') + compileOnly project(':microshed-testing-core') } diff --git a/sample-apps/everything-app/build.gradle b/sample-apps/everything-app/build.gradle index da46cb34..79c5f3ea 100644 --- a/sample-apps/everything-app/build.gradle +++ b/sample-apps/everything-app/build.gradle @@ -3,23 +3,23 @@ plugins { } dependencies { - providedCompile 'javax:javaee-api:8.0.1' - providedCompile 'org.eclipse.microprofile:microprofile:2.1' + api 'javax:javaee-api:8.0.1' + api 'org.eclipse.microprofile:microprofile:2.1' - compile 'org.mongodb:mongo-java-driver:3.11.2' + implementation 'org.mongodb:mongo-java-driver:3.11.2' - testCompile project(':microshed-testing-testcontainers') - testCompile project(':microshed-testing-core') + testImplementation project(':microshed-testing-testcontainers') + testImplementation project(':microshed-testing-core') - testCompile 'org.slf4j:slf4j-log4j12:1.7.36' - testCompile 'org.testcontainers:mockserver:1.19.1' - testCompile 'org.mock-server:mockserver-client-java:5.15.0' - testCompile 'io.rest-assured:rest-assured:5.3.2' + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' + testImplementation 'org.testcontainers:mockserver:1.19.1' + testImplementation 'org.mock-server:mockserver-client-java:5.15.0' + testImplementation 'io.rest-assured:rest-assured:5.3.2' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } -war.archiveName 'myservice.war' +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' // Always re-run tests on every build for the sake of this sample diff --git a/sample-apps/everything-jakarta-app/build.gradle b/sample-apps/everything-jakarta-app/build.gradle index f96d0673..7895db07 100644 --- a/sample-apps/everything-jakarta-app/build.gradle +++ b/sample-apps/everything-jakarta-app/build.gradle @@ -4,24 +4,27 @@ plugins { dependencies { //TODO update to Jakarta EE 10 once compiling/testing with JDK 17 - providedCompile 'jakarta.platform:jakarta.jakartaee-api:9.0.0' - //TODO update to 6.1 once using Jakarta EE 10 - providedCompile 'org.eclipse.microprofile:microprofile:5.0' + //TODO update to microprofile 6.1 once using Jakarta EE 10 + api 'jakarta.platform:jakarta.jakartaee-api:9.0.0' + api 'org.eclipse.microprofile:microprofile:5.0' - compile 'org.mongodb:mongo-java-driver:3.11.2' + implementation 'org.mongodb:mongo-java-driver:3.11.2' - testCompile project(':microshed-testing-testcontainers') - testCompile project(':microshed-testing-core-jakarta') + testImplementation project(':microshed-testing-testcontainers') + testImplementation project(':microshed-testing-core-jakarta') - testCompile 'org.slf4j:slf4j-log4j12:1.7.36' - testCompile 'org.testcontainers:mockserver:1.19.1' - testCompile 'org.mock-server:mockserver-client-java:5.15.0' - testCompile 'io.rest-assured:rest-assured:5.3.2' + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' + testImplementation 'org.testcontainers:mockserver:1.19.1' + testImplementation 'org.mock-server:mockserver-client-java:5.15.0' + testImplementation 'io.rest-assured:rest-assured:5.3.2' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } -war.archiveName 'myservice.war' +//Ensure the transformed library is available before testing +compileTestJava.dependsOn ':microshed-testing-core-jakarta:jar' + +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' // Always re-run tests on every build for the sake of this sample diff --git a/sample-apps/jaxrs-basicauth/build.gradle b/sample-apps/jaxrs-basicauth/build.gradle index 3ffbff6f..73f41374 100644 --- a/sample-apps/jaxrs-basicauth/build.gradle +++ b/sample-apps/jaxrs-basicauth/build.gradle @@ -3,16 +3,18 @@ plugins { } dependencies { - providedCompile 'javax:javaee-api:8.0.1' - providedCompile 'org.eclipse.microprofile:microprofile:2.1' - testCompile project(':microshed-testing-testcontainers') - testCompile project(':microshed-testing-core') - testCompile group: 'org.assertj', name: 'assertj-core', version: '3.15.0' - testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.36' + api 'javax:javaee-api:8.0.1' + api 'org.eclipse.microprofile:microprofile:2.1' + + testImplementation project(':microshed-testing-testcontainers') + testImplementation project(':microshed-testing-core') + + testImplementation 'org.assertj:assertj-core:3.15.0' + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } -war.archiveName 'myservice.war' +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' // Always re-run tests on every build for the sake of this sample diff --git a/sample-apps/jaxrs-json/build.gradle b/sample-apps/jaxrs-json/build.gradle index 1077f53b..fe63ee4b 100644 --- a/sample-apps/jaxrs-json/build.gradle +++ b/sample-apps/jaxrs-json/build.gradle @@ -3,15 +3,17 @@ plugins { } dependencies { - providedCompile 'javax:javaee-api:8.0.1' - providedCompile 'org.eclipse.microprofile:microprofile:2.1' - testCompile project(':microshed-testing-testcontainers') - testCompile project(':microshed-testing-core') - testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.36' + api 'javax:javaee-api:8.0.1' + api 'org.eclipse.microprofile:microprofile:2.1' + + testImplementation project(':microshed-testing-testcontainers') + testImplementation project(':microshed-testing-core') + + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } -war.archiveName 'myservice.war' +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' // Always re-run tests on every build for the sake of this sample diff --git a/sample-apps/jaxrs-mpjwt/build.gradle b/sample-apps/jaxrs-mpjwt/build.gradle index 1077f53b..fe63ee4b 100644 --- a/sample-apps/jaxrs-mpjwt/build.gradle +++ b/sample-apps/jaxrs-mpjwt/build.gradle @@ -3,15 +3,17 @@ plugins { } dependencies { - providedCompile 'javax:javaee-api:8.0.1' - providedCompile 'org.eclipse.microprofile:microprofile:2.1' - testCompile project(':microshed-testing-testcontainers') - testCompile project(':microshed-testing-core') - testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.36' + api 'javax:javaee-api:8.0.1' + api 'org.eclipse.microprofile:microprofile:2.1' + + testImplementation project(':microshed-testing-testcontainers') + testImplementation project(':microshed-testing-core') + + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } -war.archiveName 'myservice.war' +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' // Always re-run tests on every build for the sake of this sample diff --git a/sample-apps/jdbc-app/build.gradle b/sample-apps/jdbc-app/build.gradle index 76146e28..b3f255de 100644 --- a/sample-apps/jdbc-app/build.gradle +++ b/sample-apps/jdbc-app/build.gradle @@ -7,13 +7,16 @@ configurations { } dependencies { - providedCompile 'javax:javaee-api:8.0.1' - providedCompile 'org.eclipse.microprofile:microprofile:2.1' - testCompile 'org.testcontainers:postgresql:1.15.0' - testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.36' - testCompile project(':microshed-testing-testcontainers') - testCompile project(':microshed-testing-core') + api 'javax:javaee-api:8.0.1' + api 'org.eclipse.microprofile:microprofile:2.1' + + testImplementation 'org.testcontainers:postgresql:1.15.0' + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' + + testImplementation project(':microshed-testing-testcontainers') + testImplementation project(':microshed-testing-core') + postgres 'org.postgresql:postgresql:42.2.8' } @@ -24,7 +27,7 @@ task copyDriver(type: Copy) { rename 'postgresql.*jar', 'postgresql.jar' } -war.archiveName 'myservice.war' +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' test.dependsOn 'copyDriver' diff --git a/sample-apps/kafka-app/build.gradle b/sample-apps/kafka-app/build.gradle index 73f054d8..7a729a47 100644 --- a/sample-apps/kafka-app/build.gradle +++ b/sample-apps/kafka-app/build.gradle @@ -3,23 +3,23 @@ plugins { } dependencies { - providedCompile 'javax:javaee-api:8.0.1' - providedCompile 'org.eclipse.microprofile:microprofile:3.3' - providedCompile 'org.eclipse.microprofile.reactive.messaging:microprofile-reactive-messaging-api:1.0' + api 'javax:javaee-api:8.0.1' + api 'org.eclipse.microprofile:microprofile:3.3' + api 'org.eclipse.microprofile.reactive.messaging:microprofile-reactive-messaging-api:1.0' - compile 'org.apache.kafka:kafka-clients:3.6.0' + implementation 'org.apache.kafka:kafka-clients:3.6.0' - testCompile project(':microshed-testing-testcontainers') - testCompile project(':microshed-testing-core') + testImplementation project(':microshed-testing-testcontainers') + testImplementation project(':microshed-testing-core') - testCompile 'org.awaitility:awaitility:4.0.2' - testCompile 'org.testcontainers:kafka:1.15.0' - testCompile 'org.slf4j:slf4j-log4j12:1.7.36' + testImplementation 'org.awaitility:awaitility:4.0.2' + testImplementation 'org.testcontainers:kafka:1.15.0' + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } -war.archiveName 'myservice.war' +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' // Always re-run tests on every build for the sake of this sample diff --git a/sample-apps/liberty-app/build.gradle b/sample-apps/liberty-app/build.gradle index 91e4365f..e0e8d3b6 100644 --- a/sample-apps/liberty-app/build.gradle +++ b/sample-apps/liberty-app/build.gradle @@ -3,15 +3,17 @@ plugins { } dependencies { - providedCompile 'javax:javaee-api:8.0.1' - providedCompile 'org.eclipse.microprofile:microprofile:3.0' - testCompile project(':microshed-testing-liberty') - testCompile project(':microshed-testing-core') - testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.36' + api 'javax:javaee-api:8.0.1' + api 'org.eclipse.microprofile:microprofile:3.0' + + testImplementation project(':microshed-testing-liberty') + testImplementation project(':microshed-testing-core') + + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } -war.archiveName 'myservice.war' +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' // Always re-run tests on every build for the sake of this sample diff --git a/sample-apps/payara-app/build.gradle b/sample-apps/payara-app/build.gradle index 9c4a424d..8d8a055f 100644 --- a/sample-apps/payara-app/build.gradle +++ b/sample-apps/payara-app/build.gradle @@ -3,15 +3,17 @@ plugins { } dependencies { - providedCompile 'javax:javaee-api:8.0.1' - providedCompile 'org.eclipse.microprofile:microprofile:2.1' - testCompile project(':microshed-testing-payara-server') - testCompile project(':microshed-testing-core') - testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.36' + api 'javax:javaee-api:8.0.1' + api 'org.eclipse.microprofile:microprofile:2.1' + + testImplementation project(':microshed-testing-payara-server') + testImplementation project(':microshed-testing-core') + + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } -war.archiveName 'myservice.war' +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' // Always re-run tests on every build for the sake of this sample diff --git a/sample-apps/wildfly-app/build.gradle b/sample-apps/wildfly-app/build.gradle index 4f14bc77..98b6c9de 100644 --- a/sample-apps/wildfly-app/build.gradle +++ b/sample-apps/wildfly-app/build.gradle @@ -3,15 +3,17 @@ plugins { } dependencies { - providedCompile 'javax:javaee-api:8.0.1' - providedCompile 'org.eclipse.microprofile:microprofile:2.1' - testCompile project(':microshed-testing-wildfly') - testCompile project(':microshed-testing-core') - testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.36' + api 'javax:javaee-api:8.0.1' + api 'org.eclipse.microprofile:microprofile:2.1' + + testImplementation project(':microshed-testing-wildfly') + testImplementation project(':microshed-testing-core') + + testImplementation 'org.slf4j:slf4j-log4j12:1.7.36' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' } -war.archiveName 'myservice.war' +war.archiveFileName.set 'myservice.war' test.dependsOn 'war' // Always re-run tests on every build for the sake of this sample