4040 MAVEN_ARGS : " -B --no-transfer-progress"
4141 AWS_REGION : ${{ vars.AWS_REGION_MAVEN_RELEASE }}
4242 OIDC_ROLE_ARN : ${{ secrets.AWS_ROLE_MAVEN_RELEASE }}
43+ # ECR pull-through cache used for the native JNI base images. ECR_REGISTRY is
44+ # the login target; BASE_REGISTRY (with the /ecr-public prefix) is passed to
45+ # the Dockerfiles as a build-arg.
46+ ECR_REGISTRY : ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ vars.AWS_REGION_MAVEN_RELEASE }}.amazonaws.com
47+ BASE_REGISTRY : ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ vars.AWS_REGION_MAVEN_RELEASE }}.amazonaws.com/ecr-public
4348
4449jobs :
4550 # Build each architecture's native libs (glibc + musl) on a native runner.
7984 echo "JAVA_HOME=$JAVA_8_HOME" >> "$GITHUB_ENV"
8085 echo "$JAVA_8_HOME/bin" >> "$GITHUB_PATH"
8186 "$JAVA_8_HOME/bin/java" -version
87+ mkdir -p "$HOME/.m2"
88+ cat > "$HOME/.m2/toolchains.xml" <<EOF
89+ <?xml version="1.0" encoding="UTF-8"?>
90+ <toolchains>
91+ <toolchain>
92+ <type>jdk</type>
93+ <provides><version>8</version></provides>
94+ <configuration><jdkHome>$JAVA_8_HOME</jdkHome></configuration>
95+ </toolchain>
96+ </toolchains>
97+ EOF
8298
8399 # Route all mvn resolution through the CodeArtifact mirror. Must precede
84100 # resolve-release-version, which invokes `mvn help:evaluate`. Ambient
@@ -92,6 +108,14 @@ jobs:
92108 module : ${{ env.MODULE }}
93109 release-version-override : ${{ env.RELEASE_VERSION_INPUT }}
94110
111+ # The native JNI build shells out to `docker build` against the ECR
112+ # pull-through cache (see src/main/jni/Dockerfile.*). Authenticate first so
113+ # the base-image pulls don't hit public.ecr.aws. Uses ambient runner creds.
114+ - name : Log in to Amazon ECR (pull-through cache)
115+ run : |
116+ aws ecr get-login-password --region "$AWS_REGION" \
117+ | docker login --username AWS --password-stdin "$ECR_REGISTRY"
118+
95119 # -DskipTests: only installed so the module compiles, not released here.
96120 - name : Install intra-repo dependencies
97121 run : |
@@ -149,6 +173,17 @@ jobs:
149173 echo "JAVA_HOME=$JAVA_8_HOME" >> "$GITHUB_ENV"
150174 echo "$JAVA_8_HOME/bin" >> "$GITHUB_PATH"
151175 "$JAVA_8_HOME/bin/java" -version
176+ mkdir -p "$HOME/.m2"
177+ cat > "$HOME/.m2/toolchains.xml" <<EOF
178+ <?xml version="1.0" encoding="UTF-8"?>
179+ <toolchains>
180+ <toolchain>
181+ <type>jdk</type>
182+ <provides><version>8</version></provides>
183+ <configuration><jdkHome>$JAVA_8_HOME</jdkHome></configuration>
184+ </toolchain>
185+ </toolchains>
186+ EOF
152187
153188 # Route all mvn resolution through the CodeArtifact mirror. Must precede
154189 # resolve-release-version (which invokes `mvn help:evaluate`) and the OIDC
@@ -163,6 +198,14 @@ jobs:
163198 module : ${{ env.MODULE }}
164199 release-version-override : ${{ env.RELEASE_VERSION_INPUT }}
165200
201+ # The native JNI build shells out to `docker build` against the ECR
202+ # pull-through cache (see src/main/jni/Dockerfile.*). Authenticate first so
203+ # the base-image pulls don't hit public.ecr.aws. Uses ambient runner creds.
204+ - name : Log in to Amazon ECR (pull-through cache)
205+ run : |
206+ aws ecr get-login-password --region "$AWS_REGION" \
207+ | docker login --username AWS --password-stdin "$ECR_REGISTRY"
208+
166209 - name : Resolve next development version and tag
167210 run : |
168211 # Next development version: use the override, or bump the patch.
@@ -200,7 +243,7 @@ jobs:
200243 - name : Run tests
201244 env :
202245 IS_JAVA_8 : true
203- run : mvn test --file "$MODULE/pom.xml"
246+ run : mvn test -DargLineForReflectionTestOnly="" - -file "$MODULE/pom.xml"
204247
205248 # JARs to attach + .so files for the fat main JAR.
206249 - name : Download native artifacts
0 commit comments