Add Java Platform Module System (JPMS) Support

Open
#372 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java

Research direction

Start with function-maven-plugin/src/main/java/com/google/cloud/functions/plugin/RunFunction.java at the hardcoded classpath configuration. Trace how the Invoker CLI and Maven/Gradle plugins launch functions, then determine how module-path configuration must reach the cloud runtime. Done requires coordinated support across local invocation, build tooling, and cloud execution.

Written by the indexing model from the issue text.

Description

enhancement P2

Add support for running functions on the module path (--module-path) instead of only the classpath (--classpath) to enable full Java Platform Module System (JPMS) features in the Functions Framework.

Currently, the Functions Framework for Java only supports classpath-based execution, which prevents developers from utilizing JPMS features at runtime even when their code is properly modularized with module-info.java files.

Modern Java applications using JPMS face the following issues:

  1. module-info.java files are ignored at runtime (treated as regular classes on classpath)
  2. provides...with service provider declarations don't work, requiring fallback to legacy META-INF/services files
  3. Module encapsulation and strong accessibility rules are not enforced
  4. No module-level dependency management or version conflict resolution
  5. Cannot leverage jlink to create optimized custom runtime images with only required modules, resulting in larger deployment artifacts

This feature request requires changes across three layers:

  1. Local Development (Invoker CLI) - Add --module-path support
  2. Build Tooling (Maven/Gradle plugins) - Add module-path configuration (right now classpath is hardcoded here
  3. Cloud Runtime Infrastructure - Update Google Cloud Functions runtime to support modular execution
Dominant language
Java
Stars
154
Forks
63
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GoogleCloudPlatform/functions-framework-java

All issues in GoogleCloudPlatform/functions-framework-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.