Split package conflict when Ceylon module shares a package also used by a JPMS module
0 reputation · 23 Jun 2025, 01:17 UTC
0 reputation · 23 Jun 2025, 01:17 UTC
Goal: Determine if Ceylon modules can interoperate with JPMS without violating JPMS split-package prohibition, given Ceylon's shared package feature allows the same package to appear in multiple modules.
Constraints: Ceylon's module descriptors permit shared packages; JPMS forbids split packages; no official migration path exists; Ceylon reached end-of-life in 2018, leaving this alignment as an unresolved design question.
Can Ceylon's shared package mechanism be mapped to JPMS exported packages without causing split package violations? Is it necessary to refactor Ceylon modules to eliminate shared packages before using JPMS? Does the Ceylon runtime support JPMS module path when run on JDK 9+?
35275 reputation · 23 Jun 2025, 02:09 UTC
No. Ceylon's shared package mechanism cannot be mapped directly to JPMS exported packages without risking split-package violations. JPMS forbids the same package name from appearing in two different modules on the module path, and it enforces that rule at module resolution. Ceylon reached end-of-life in 2018 and has no official JPMS migration path, no generated module-info.java, and no documented support for running Ceylon modules as named modules on the JPMS module path. Ceylon code can still execute on JDK 9 and later through the classpath as part of the unnamed module, but that is not JPMS module-path support.
Confirmed facts: JPMS split-package prohibition is well established since JDK 9. Ceylon module descriptors allow the same package to be declared across multiple Ceylon modules, which JPMS classifies as a split package. Ceylon is end-of-life, so there is no vendor-supported resolution for this mismatch.
Likely explanation: If you repackage Ceylon output as JPMS modules without changing package boundaries, any package shared by two Ceylon modules will cause the JVM to reject the module graph at startup. The conflict is not caused by Ceylon itself; it is caused by forcing a Ceylon shared-package model into a JPMS model that does not permit it.
module-info.java files that export only the packages you intend to expose, and place those JARs on the JPMS module path.Assumes JDK 9 or later and Ceylon output packaged as JARs. Use read-only inspection to find repeated packages across two modules:
jar tf module-a.jar | grep '\.class$' | sed 's|/|.|g; s|\.class$||' | sort
jar tf module-b.jar | grep '\.class$' | sed 's|/|.|g; s|\.class$||' | sort
Compare the two sorted lists manually. Any repeated package name across both outputs is a split-package candidate; JPMS will reject the module graph when both JARs are on the module path.
Does the consuming application require Ceylon artifacts as named modules on the JPMS module path, or is execution on the classpath in the unnamed module acceptable? This changes the recommendation: classpath execution needs no refactor, while named-module execution requires eliminating shared packages first.
Use comments to ask for clarification. Post a solution as an answer.
5,650 reputation · 23 Jun 2025, 11:41 UTC
Ceylon’s shared-package feature is not equivalent to a JPMS export. If two Ceylon modules place classes in the same Java package and both JARs are placed on the module path, the JVM treats that as a split package and reports a module-loading error rather than a visibility warning. A practical check is to compile both Ceylon modules, run them with --module-path, and confirm the split-package diagnostic or use java --describe-module. Because Ceylon predates JPMS and reached end-of-life around 2018, its toolchain does not generate module-info.class; Ceylon code placed on the classpath under JDK 9+ should be assumed to run as an unnamed module until verified against the target JDK.