Skip to content

fix(core): support Velocity 4 Guice injection#64

Merged
robinbraemer merged 2 commits into
mainfrom
fm/connect-java-velocity4-bedrock-di-fix-v1
Jul 24, 2026
Merged

fix(core): support Velocity 4 Guice injection#64
robinbraemer merged 2 commits into
mainfrom
fm/connect-java-velocity4-bedrock-di-fix-v1

Conversation

@robinbraemer

Copy link
Copy Markdown
Member

Intent

Fix the Connect (connect-java) plugin failing to load on Velocity 4.0.0 with 'Cant create plugin connect', a Guice dependency-injection provisioning failure: Guice cannot provision com.minekube.connect.bedrock.BedrockIdentityKeyProvider (no @Inject constructor / no no-arg constructor) as the 2nd param of CommonModule.bedrockIdentityReadiness, failing the whole VelocityPlugin injector.

Root cause (proven, not assumed): the Velocity plugin does NOT shade Guice (velocity/build.gradle.kts marks guice 'provided') and VelocityPlugin builds a CHILD of Velocity's own injector, so it runs on the platform's Guice. Velocity 4.0.0 (new major) provides Guice 7, which dropped javax.inject support and recognizes only com.google.inject/jakarta.inject annotations. Of every injectable class in the codebase, only the Bedrock DI classes used javax.inject; everything else already uses com.google.inject. So on Guice 7 the rest of the plugin works but the javax.inject-annotated classes are invisible to constructor discovery. Spigot/Bungee shade their own Guice 6 and Velocity 3.x ships Guice 5 (both accept javax), which is why only Velocity 4.0.0 broke. Git history shows the javax.inject JIT constructor was introduced in #59 (which replaced an explicit @provides factory with a JIT javax.inject.Inject constructor); #61 (initially suspected) touched only a test file and is NOT the cause.

Fix (smallest proven counterfactual): switch the five DI classes that still used javax.inject (BedrockIdentityKeyProvider, BedrockAdmissionCoordinator, BedrockIdentityEnforcer, VerifiedBedrockIdentityRegistry, Metrics) to their com.google.inject.* equivalents (Inject, Singleton, name.Named) — the codebase standard everywhere else. Deliberately chose com.google.inject over jakarta.inject because jakarta would break Velocity 3.x (Guice 5); com.google.inject is portable across Guice 5/6/7. This is a pure annotation-provider swap with identical DI semantics — no Bedrock-identity behavior change. Deliberately fixed all five javax.inject users, not just the reported BedrockIdentityKeyProvider, because the others (@singleton scope, @nAmed qualifier) would fail or misbehave next on the Guice 7 graph.

Regression test: added core/.../bedrock/BedrockVelocityGuice7ProvisioningTest. Because the repo compiles/tests against Guice 6 (which recognizes BOTH javax and com.google.inject) and no Guice 7 / Velocity 4.0.0 harness is on the classpath, a plain Guice-6 provisioning test cannot reproduce the failure; the test instead replicates Guice 7's exact injectable-constructor discovery rule and forbids javax.inject annotations on these graph classes. Verified it fails before the fix (3/4 tests) and passes after. This harness limitation is documented explicitly in the test Javadoc. Also added a concise AGENTS.md 'DI annotations (Guice provider portability)' entry. Validation: ./gradlew build is green (checkstyle, libp2p isolation verification, and core/velocity/spigot/bungee test suites all pass), confirming no regression to other platforms.

What Changed

  • Switched the five remaining DI classes from javax.inject to portable com.google.inject annotations.
  • Added a Guice 7 constructor-discovery regression test covering the Bedrock dependency graph.
  • Documented Guice annotation portability guidance in AGENTS.md.

Risk Assessment

✅ Low: The change is a bounded annotation-provider swap across all five identified DI classes, and surrounding injector paths show no material source risk.

Testing

Fresh targeted runs exercised the Guice-7 constructor-discovery replica, all five DI classes’ annotation scan, real Guice graph provisioning, parent-injector startup guards, Bedrock behavior checks, and the Velocity plugin lifecycle test. No real Velocity 4/Guice 7 server harness is present, so the documented exact-rule replica is the runtime limitation.

Evidence: Targeted test cases
<testsuite name="com.minekube.connect.bedrock.BedrockVelocityGuice7ProvisioningTest" tests="4" skipped="0" failures="0" errors="0" timestamp="2026-07-24T23:42:43" hostname="Robins-MacBook-Pro.fritz.box" time="0.058">
  <testcase name="bedrockGraphResolvesThroughRealGuiceInjector()" classname="com.minekube.connect.bedrock.BedrockVelocityGuice7ProvisioningTest" time="0.055"/>
  <testcase name="bedrockAdmissionCoordinatorIsProvisionableUnderGuice7()" classname="com.minekube.connect.bedrock.BedrockVelocityGuice7ProvisioningTest" time="0.0"/>
  <testcase name="connectDiClassesCarryNoJavaxInjectAnnotations()" classname="com.minekube.connect.bedrock.BedrockVelocityGuice7ProvisioningTest" time="0.002"/>
  <testcase name="bedrockIdentityKeyProviderIsProvisionableUnderGuice7()" classname="com.minekube.connect.bedrock.BedrockVelocityGuice7ProvisioningTest" time="0.0"/>
<testsuite name="com.minekube.connect.module.BedrockParentInjectorStartupTest" tests="2" skipped="0" failures="0" errors="0" timestamp="2026-07-24T23:42:43" hostname="Robins-MacBook-Pro.fritz.box" time="0.008">
  <testcase name="resolvingAdmissionCoordinatorDoesNotBindConfigOnParentInjector()" classname="com.minekube.connect.module.BedrockParentInjectorStartupTest" time="0.005"/>
  <testcase name="resolvingBedrockGraphDoesNotBindConfigOnParentInjector()" classname="com.minekube.connect.module.BedrockParentInjectorStartupTest" time="0.002"/>
<testsuite name="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" tests="13" skipped="0" failures="0" errors="0" timestamp="2026-07-24T23:42:37" hostname="Robins-MacBook-Pro.fritz.box" time="6.343">
  <testcase name="usesBoundedStaleKeysWhenMetadataScopeRefreshIsInvalid()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.038"/>
  <testcase name="backsOffFailedRefreshesAndFailsClosedAfterHardStaleDeadline()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.007"/>
  <testcase name="failsClosedWhenConfiguredMetadataCannotBeInitiallyValidated()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.003"/>
  <testcase name="limitsMetadataCallsToFiveSeconds()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="6.008"/>
  <testcase name="rejectsPlaintextMetadataUrlBeforeFetching()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.001"/>
  <testcase name="usesPostFailureTimeForStaleEligibilityAndRetryBackoff()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.011"/>
  <testcase name="rejectsStaticKeyThatTheVerifierCannotParse()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.0"/>
  <testcase name="returnsStaticConfiguredKeys()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.001"/>
  <testcase name="fetchesCurrentAndPreviousMetadataKeys()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.004"/>
  <testcase name="rejectsRedirectAndOversizedMetadataBeforeCaching()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.005"/>
  <testcase name="rejectsMetadataUrlsWithRawUserinfoDelimiterBeforeFetching()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.001"/>
  <testcase name="sharesOneExpiredMetadataRefreshAcrossConcurrentCallers()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.258"/>
  <testcase name="rejectsMetadataWithUnexpectedIssuerOrInvalidKeySize()" classname="com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest" time="0.004"/>
<testsuite name="com.minekube.connect.bedrock.BedrockAdmissionCoordinatorTest" tests="7" skipped="0" failures="0" errors="0" timestamp="2026-07-24T23:42:37" hostname="Robins-MacBook-Pro.fritz.box" time="0.218">
  <testcase name="delayedNoIdentityProposalCannotReplaceNewerBedrockGeneration()" classname="com.minekube.connect.bedrock.BedrockAdmissionCoordinatorTest" time="0.024"/>
  <testcase name="proposalGenerationsAreOpaqueAndMonotonic()" classname="com.minekube.connect.bedrock.BedrockAdmissionCoordinatorTest" time="0.002"/>
  <testcase name="noIdentityJavaControlRaceKeepsNewestProposal()" classname="com.minekube.connect.bedrock.BedrockAdmissionCoordinatorTest" time="0.0"/>
  <testcase name="coordinatorCreatedJavaProposalHasGenerationToken()" classname="com.minekube.connect.bedrock.BedrockAdmissionCoordinatorTest" time="0.0"/>
  <testcase name="delayedOlderProposalCannotReplaceNewerGeneration()" classname="com.minekube.connect.bedrock.BedrockAdmissionCoordinatorTest" time="0.001"/>
  <testcase name="noIdentityProposalCannotStageOrRegisterAfterClose()" classname="com.minekube.connect.bedrock.BedrockAdmissionCoordinatorTest" time="0.001"/>
  <testcase name="admissionTokenCanVerifyExactlyOnce()" classname="com.minekube.connect.bedrock.BedrockAdmissionCoordinatorTest" time="0.188"/>
<testsuite name="com.minekube.connect.VelocityPluginTest" tests="1" skipped="0" failures="0" errors="0" timestamp="2026-07-24T23:42:55" hostname="Robins-MacBook-Pro.fritz.box" time="0.165">
  <testcase name="proxyShutdownDisablesConnectPlatform()" classname="com.minekube.connect.VelocityPluginTest" time="0.165"/>
/var/folders/1y/cjgf53nj31n_dxsspqnjfjvc0000gn/T/no-mistakes-evidence/01KYB7VV0BNT1CYEY8SHZ6P8FM/velocity-plugin-targeted.log:395:BUILD SUCCESSFUL in 1s
/var/folders/1y/cjgf53nj31n_dxsspqnjfjvc0000gn/T/no-mistakes-evidence/01KYB7VV0BNT1CYEY8SHZ6P8FM/core-bedrock-targeted.log:455:BUILD SUCCESSFUL in 18s
Evidence: Core targeted run
Initialized native services in: /Users/robin/.gradle/native
Initialized jansi services in: /Users/robin/.gradle/native
Received JVM installation metadata from '/opt/homebrew/Cellar/openjdk@21/21.0.11/libexec/openjdk.jdk/Contents/Home': {JAVA_HOME=/opt/homebrew/Cellar/openjdk@21/21.0.11/libexec/openjdk.jdk/Contents/Home, JAVA_VERSION=21.0.11, JAVA_VENDOR=Homebrew, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=21.0.11, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=21.0.11, VM_VENDOR=Homebrew, OS_ARCH=aarch64}
The client will now receive all logging from the daemon (pid: 31517). The daemon log file: /Users/robin/.gradle/daemon/8.5/daemon-31517.out.log
Starting 8th build in daemon [uptime: 13 mins 7.225 secs, performance: 99%, GC rate: 0.00/s, heap usage: 17% of 512 MiB, non-heap usage: 31% of 384 MiB]
Using 12 worker leases.
Configuration on demand is an incubating feature.
Closing daemon's stdin at end of input.
The daemon will no longer process any standard input.
Now considering [/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic, /Users/robin/.treehouse/connect-java-aadf0a/2/connect-java/build-logic, /Users/robin/.treehouse/connect-java-aadf0a/2/connect-java] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file '/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/settings.gradle.kts'.
Using local directory build cache for the root build (location = /Users/robin/.gradle/caches/build-cache-1, removeUnusedEntriesAfter = 7 days).
Now considering [/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM, /Users/robin/.treehouse/connect-java-aadf0a/2/connect-java/build-logic, /Users/robin/.treehouse/connect-java-aadf0a/2/connect-java] as hierarchies to watch
Type-safe project accessors is an incubating feature.
Skipping generation of project accessors as it is up-to-date.
Projects loaded. Root project using build file '/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build.gradle.kts'.
Included projects: [root project 'connect-parent', project ':api', project ':bungee', project ':core', project ':spigot', project ':velocity']
Task path ':core:test' matched project ':core'

> Configure project :build-logic
Evaluating project ':build-logic' using build file '/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic/build.gradle.kts'.
Using Kotlin Gradle Plugin gradle81 variant
kotlin scripting plugin: created the scripting discovery configuration: kotlinScriptDef
kotlin scripting plugin: created the scripting discovery configuration: testKotlinScriptDef
file or directory '/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic/src/main/java', not found
Build cache key for Kotlin DSL accessors for project ':build-logic' is c0ec5cf8b5ddbe03165331786d4e5209
Skipping Kotlin DSL accessors for project ':build-logic' as it is up-to-date.
Resolve mutations for :build-logic:checkKotlinGradlePluginConfigurationErrors (Thread[#1178,Execution worker,5,main]) started.
:build-logic:checkKotlinGradlePluginConfigurationErrors (Thread[#1178,Execution worker,5,main]) started.

> Task :build-logic:checkKotlinGradlePluginConfigurationErrors
Caching disabled for task ':build-logic:checkKotlinGradlePluginConfigurationErrors' because:
  This task renders reported diagnostics; caching this task will hide diagnostics and obscure issues in the build
Task ':build-logic:checkKotlinGradlePluginConfigurationErrors' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
Resolve mutations for :build-logic:generateExternalPluginSpecBuilders (Thread[#1178,Execution worker,5,main]) started.
:build-logic:generateExternalPluginSpecBuilders (Thread[#1178,Execution worker,5,main]) started.

> Task :build-logic:generateExternalPluginSpecBuilders
Build cache key for task ':build-logic:generateExternalPluginSpecBuilders' is 03331b7d3f212e837b1d6cd06bb3fada
Task ':build-logic:generateExternalPluginSpecBuilders' is not up-to-date because:
  Executed with '--rerun-tasks'.
Stored cache entry for task ':build-logic:generateExternalPluginSpecBuilders' with cache key 03331b7d3f212e837b1d6cd06bb3fada
Resolve mutations for :build-logic:extractPrecompiledScriptPluginPlugins (Thread[#1178,Execution worker,5,main]) started.
:build-logic:extractPrecompiledScriptPluginPlugins (Thread[#1178,Execution worker,5,main]) started.

> Task :build-logic:extractPrecompiledScriptPluginPlugins
Build cache key for task ':build-logic:extractPrecompiledScriptPluginPlugins' is 1af3530a5adc340fd08f5ec4c7cb56c2
Task ':build-logic:extractPrecompiledScriptPluginPlugins' is not up-to-date because:
  Executed with '--rerun-tasks'.
Stored cache entry for task ':build-logic:extractPrecompiledScriptPluginPlugins' with cache key 1af3530a5adc340fd08f5ec4c7cb56c2
Resolve mutations for :build-logic:compilePluginsBlocks (Thread[#1178,Execution worker,5,main]) started.
:build-logic:compilePluginsBlocks (Thread[#1178,Execution worker,5,main]) started.

> Configure project :
Evaluating root project 'connect-parent' using build file '/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build.gradle.kts'.
Skipping generation of project accessors as it is up-to-date.

> Task :build-logic:compilePluginsBlocks
Build cache key for task ':build-logic:compilePluginsBlocks' is 11fab19113e7c5bc16de6b1b9d7f1b1c
Task ':build-logic:compilePluginsBlocks' is not up-to-date because:
  Executed with '--rerun-tasks'.
Stored cache entry for task ':build-logic:compilePluginsBlocks' with cache key 11fab19113e7c5bc16de6b1b9d7f1b1c
Resolve mutations for :build-logic:generatePrecompiledScriptPluginAccessors (Thread[#1178,Execution worker,5,main]) started.
:build-logic:generatePrecompiledScriptPluginAccessors (Thread[#1178,Execution worker,5,main]) started.

> Task :build-logic:generatePrecompiledScriptPluginAccessors
Build cache key for task ':build-logic:generatePrecompiledScriptPluginAccessors' is e97a220d37c3583b16c85fadc57a30ad
Task ':build-logic:generatePrecompiledScriptPluginAccessors' is not up-to-date because:
  Executed with '--rerun-tasks'.
Now considering [/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic/build/tmp/generatePrecompiledScriptPluginAccessors/accessors10073174050042662, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM, /Users/robin/.treehouse/connect-java-aadf0a/2/connect-java/build-logic, /Users/robin/.treehouse/connect-java-aadf0a/2/connect-java] as hierarchies to watch
Now considering [/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic/build/tmp/generatePrecompiledScriptPluginAccessors/accessors4924656932357135306, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic/build/tmp/generatePrecompiledScriptPluginAccessors/accessors10073174050042662, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM, /Users/robin/.treehouse/connect-java-aadf0a/2/connect-java/build-logic, /Users/robin/.treehouse/connect-java-aadf0a/2/connect-java] as hierarchies to watch
Now considering [/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic/build/tmp/generatePrecompiledScriptPluginAccessors/accessors2985966537026145200, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic/build/tmp/generatePrecompiledScriptPluginAccessors/accessors4924656932357135306, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/build-logic/build/tmp/generatePrecompiledScriptPluginAccessors/accessors10073174050042662, /Users/robin/.no-m

... [93483 bytes truncated] ...

che key for task ':core:generateProto' is 50cd755bae5647c5c9990fa0b93ad956
Task ':core:generateProto' is not up-to-date because:
  Executed with '--rerun-tasks'.
Resolved artifact: /Users/robin/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.19.4/923eaa50672afae49579e672f0753bf7a908453c/protoc-3.19.4-osx-aarch_64.exe
Resolved artifact: /Users/robin/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.44.0/59608d612125b9f8acdbbe5a328e4b84f4daa7b2/protoc-gen-grpc-java-1.44.0-osx-aarch_64.exe
[/Users/robin/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.19.4/923eaa50672afae49579e672f0753bf7a908453c/protoc-3.19.4-osx-aarch_64.exe, -I/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/src/main/proto, -I/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/build/extracted-protos/main, -I/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/build/extracted-include-protos/main, --java_out=/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/build/generated/source/proto/main/java, --plugin=protoc-gen-grpc=/Users/robin/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.44.0/59608d612125b9f8acdbbe5a328e4b84f4daa7b2/protoc-gen-grpc-java-1.44.0-osx-aarch_64.exe, --grpc_out=/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/build/generated/source/proto/main/grpc, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/src/main/proto/com/minekube/connect/v1alpha1/connect_libp2p.proto, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/src/main/proto/com/minekube/connect/v1alpha1/tunnel_service.proto, /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/src/main/proto/com/minekube/connect/v1alpha1/watch_service.proto]
protoc: stdout: . stderr: 
Stored cache entry for task ':core:generateProto' with cache key 50cd755bae5647c5c9990fa0b93ad956
Resolve mutations for :core:compileJava (Thread[#1186,Execution worker Thread 9,5,main]) started.
:core:compileJava (Thread[#1186,Execution worker Thread 9,5,main]) started.

> Task :core:compileJava
Build cache key for task ':core:compileJava' is 70742226199d1cda0d42c4ec311e5e85
Task ':core:compileJava' is not up-to-date because:
  Executed with '--rerun-tasks'.
The input changes require a full rebuild for incremental task ':core:compileJava'.
Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments.
Compiling with toolchain '/opt/homebrew/Cellar/openjdk@21/21.0.11/libexec/openjdk.jdk/Contents/Home'.
Compiling with JDK Java compiler API.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Class dependency analysis for incremental compilation took 0.011 secs.
Created classpath snapshot for incremental compilation in 0.003 secs.
Stored cache entry for task ':core:compileJava' with cache key 70742226199d1cda0d42c4ec311e5e85
Resolve mutations for :core:classes (Thread[#1186,Execution worker Thread 9,5,main]) started.
:core:classes (Thread[#1186,Execution worker Thread 9,5,main]) started.

> Task :core:classes
Skipping task ':core:classes' as it has no actions.
Resolve mutations for :core:extractIncludeTestProto (Thread[#1186,Execution worker Thread 9,5,main]) started.
:core:extractIncludeTestProto (Thread[#1186,Execution worker Thread 9,5,main]) started.

> Task :core:extractIncludeTestProto
Caching disabled for task ':core:extractIncludeTestProto' because:
  Caching has not been enabled for the task
Task ':core:extractIncludeTestProto' is not up-to-date because:
  Executed with '--rerun-tasks'.
Resolve mutations for :core:generateTestProto (Thread[#1186,Execution worker Thread 9,5,main]) started.
:core:generateTestProto (Thread[#1186,Execution worker Thread 9,5,main]) started.

> Task :core:generateTestProto NO-SOURCE
Skipping task ':core:generateTestProto' as it has no source files and no previous output files.
Resolve mutations for :core:compileTestJava (Thread[#1186,Execution worker Thread 9,5,main]) started.
:core:compileTestJava (Thread[#1186,Execution worker Thread 9,5,main]) started.

> Task :core:compileTestJava
Build cache key for task ':core:compileTestJava' is 081220111ce65f0d31bf3ed9e3e05992
Task ':core:compileTestJava' is not up-to-date because:
  Executed with '--rerun-tasks'.
The input changes require a full rebuild for incremental task ':core:compileTestJava'.
Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments.
Compiling with toolchain '/opt/homebrew/Cellar/openjdk@21/21.0.11/libexec/openjdk.jdk/Contents/Home'.
file or directory '/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/build/generated/source/proto/test/java', not found
Compiling with JDK Java compiler API.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Class dependency analysis for incremental compilation took 0.004 secs.
Created classpath snapshot for incremental compilation in 0.002 secs.
Stored cache entry for task ':core:compileTestJava' with cache key 081220111ce65f0d31bf3ed9e3e05992
Resolve mutations for :core:testClasses (Thread[#1186,Execution worker Thread 9,5,main]) started.
:core:testClasses (Thread[#1186,Execution worker Thread 9,5,main]) started.

> Task :core:testClasses
Skipping task ':core:testClasses' as it has no actions.
Resolve mutations for :core:test (Thread[#1181,Execution worker Thread 4,5,main]) started.
:core:test (Thread[#1181,Execution worker Thread 4,5,main]) started.
Gradle Test Executor 7 started executing tests.

> Task :core:test
Build cache key for task ':core:test' is 0688a5ae249aec6def353c732a7924e5
Task ':core:test' is not up-to-date because:
  Executed with '--rerun-tasks'.
Starting process 'Gradle Test Executor 7'. Working directory: /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core Command: /opt/homebrew/Cellar/openjdk@21/21.0.11/libexec/openjdk.jdk/Contents/Home/bin/java -Dorg.gradle.internal.worker.tmpdir=/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/build/tmp/test/work -Dorg.gradle.native=false @/Users/robin/.gradle/.tmp/gradle-worker-classpath14297639543158964470txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 7'
Successfully started process 'Gradle Test Executor 7'

BedrockAdmissionCoordinatorTest > proposalGenerationsAreOpaqueAndMonotonic() STANDARD_OUT
    TOKEN shape: fields=1, fieldType=long, newerGeneration=true

BedrockAdmissionCoordinatorTest > admissionTokenCanVerifyExactlyOnce() STANDARD_OUT
    TOKEN consumption: firstVerification=allowed, secondVerification=rejected

Gradle Test Executor 7 finished executing tests.

> Task :core:test
Finished generating test XML results (0.001 secs) into: /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/build/test-results/test
Generating HTML test report...
Finished generating test html results (0.003 secs) into: /Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM/core/build/reports/tests/test
Stored cache entry for task ':core:test' with cache key 0688a5ae249aec6def353c732a7924e5

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 18s
26 actionable tasks: 26 executed
Watched directory hierarchies: [/Users/robin/.no-mistakes/worktrees/bd6a9ec68e4b/01KYB7VV0BNT1CYEY8SHZ6P8FM, /Users/robin/.treehouse/connect-java-aadf0a/2/connect-java]

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • ./gradlew :core:test --tests com.minekube.connect.bedrock.BedrockVelocityGuice7ProvisioningTest --tests com.minekube.connect.module.BedrockParentInjectorStartupTest --tests com.minekube.connect.bedrock.BedrockIdentityKeyProviderTest --tests com.minekube.connect.bedrock.BedrockAdmissionCoordinatorTest --rerun-tasks --console=plain --info
  • ./gradlew :velocity:test --tests com.minekube.connect.VelocityPluginTest --console=plain --info
  • Verified the JUnit XML evidence and confirmed the worktree has no generated build or Gradle-cache directories.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Velocity 4.0.0 fails to load the Connect plugin ("Cant create plugin
connect") because Guice cannot provision BedrockIdentityKeyProvider, the
2nd parameter of CommonModule.bedrockIdentityReadiness on the
VelocityPlugin injector.

Root cause: the Velocity plugin does not shade Guice (it is `provided`)
and VelocityPlugin builds a child of Velocity's own injector, so it runs
on the platform's Guice. Velocity 4.0.0 provides Guice 7, which dropped
javax.inject support and recognizes only com.google.inject/jakarta.inject
annotations. BedrockIdentityKeyProvider and BedrockAdmissionCoordinator
were annotated with javax.inject.Inject/@singleton, so under Guice 7 they
have no discoverable @Inject constructor and no no-arg constructor and
cannot be provisioned — failing the whole injector. Spigot/Bungee shade
Guice 6 and Velocity 3.x ships Guice 5; both still accept javax, so only
Velocity 4.0.0 broke. The javax dependency was introduced in #59 (which
replaced an explicit @provides factory with a JIT javax.inject.Inject
constructor), not #61.

Switch the five DI classes that still used javax.inject (BedrockIdentity-
KeyProvider, BedrockAdmissionCoordinator, BedrockIdentityEnforcer,
VerifiedBedrockIdentityRegistry, Metrics) to their com.google.inject.*
equivalents — the codebase standard everywhere else. This is portable
across Guice 5/6/7 and changes no DI semantics.

Add BedrockVelocityGuice7ProvisioningTest, which replicates Guice 7's
injectable-constructor discovery rule and forbids javax.inject on these
graph classes (no Guice 7 / Velocity 4.0.0 harness is on the classpath;
Guice 6 masks the failure). It fails before this change and passes after.
@robinbraemer
robinbraemer merged commit b4bec7d into main Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant