Skip to content

Add Ecore model of Java module system concepts#1

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/create-ecore-model-java-modules
Draft

Add Ecore model of Java module system concepts#1
Copilot wants to merge 3 commits intomainfrom
copilot/create-ecore-model-java-modules

Conversation

Copy link

Copilot AI commented Mar 21, 2026

Models the Java 9+ module system (module-info.java) as an EMF Ecore model, enabling programmatic representation and manipulation of module declarations.

Ecore Model (model/model/java-module.ecore)

Six EClasses covering all module directives:

Class Maps to Key attributes
Module module M { ... } name, containment refs to all directives
Requires requires [transitive] [static] M name, transitive, static
Exports exports pkg [to M1, M2] name, modules[]
Opens opens pkg [to M1, M2] name, modules[]
Provides provides S with I1, I2 service, implementations[]
Uses uses S service

Generated EMF Java Code (model/src/main/java/)

  • JavaModulePackage — package singleton with class/feature IDs and Literals inner interface
  • JavaModuleFactory — factory interface and implementation
  • Model interfaces + impl/ implementations using eDynamicGet/eDynamicSet with dynamic feature delegation
  • util/JavaModuleSwitch, util/JavaModuleAdapterFactory — standard EMF visitor/adapter infrastructure

Project Structure

Standard Nasdanika multi-module Maven layout matching sibling models (e.g., bank):

  • pom.xml (parent) + model/pom.xml
  • model/model/java-module.genmodel
  • model/META-INF/MANIFEST.MF (OSGi bundle descriptor)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Nasdanika-Models/java-module/git/trees/c473643
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • https://api.github.com/repos/Nasdanika-Models/ncore/git/trees/48a05b2ea9ea59458055493be18b85065d51e962
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • https://api.github.com/search/code
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
    • Triggering command: /usr/bin/python3 python3 /tmp/search_ecore.py (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Create an ecore model of Java module concepts - module, requires (transitive), exports, opens, provides, uses, ...

https://www.baeldung.com/java-modularity


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI and others added 2 commits March 21, 2026 17:43
Create full Ecore model project for Java module system (module-info.java concepts):
- Module, Requires (transitive/static), Exports, Opens, Provides, Uses EClasses
- Ecore model (.ecore) and genmodel (.genmodel) files
- Java interfaces (JavaModulePackage, JavaModuleFactory, model classes)
- Impl classes using dynamic EMF feature delegation
- Util classes (Switch, AdapterFactory)
- Parent and model Maven POMs with EMF Ecore dependency

Notes:
- Compiled with Java 17 (environment constraint); <release> set to 17
- module-info.java omitted: ncore dependency (2025.12.0) requires Java 21 bytecode
- JavaModuleEPackageResourceSetCapabilityFactory omitted for same reason

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merge both additionalOptions into a single element to prevent the second
declaration from silently overriding the first.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI changed the title [WIP] Create Ecore model for Java module concepts Add Ecore model of Java module system concepts Mar 21, 2026
Copilot AI requested a review from pvlasov March 21, 2026 17:49
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.

2 participants