{"id":26629934,"url":"https://github.com/gradlex-org/java-module-dependencies","last_synced_at":"2025-04-10T15:22:57.871Z","repository":{"id":63706173,"uuid":"421963253","full_name":"gradlex-org/java-module-dependencies","owner":"gradlex-org","description":"A Gradle plugin to use dependencies from 'module-info.java' files.","archived":false,"fork":false,"pushed_at":"2025-04-01T07:41:59.000Z","size":1358,"stargazers_count":51,"open_issues_count":14,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-01T08:38:21.965Z","etag":null,"topics":["dependencies","gradle-plugin","java","java-modules","jpms"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gradlex-org.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-27T20:23:49.000Z","updated_at":"2025-04-01T07:41:32.000Z","dependencies_parsed_at":"2023-10-04T13:22:12.045Z","dependency_job_id":"5486c703-fdf7-4d3a-8f78-629702f4e9a9","html_url":"https://github.com/gradlex-org/java-module-dependencies","commit_stats":null,"previous_names":["jjohannes/java-module-dependencies"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradlex-org%2Fjava-module-dependencies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradlex-org%2Fjava-module-dependencies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradlex-org%2Fjava-module-dependencies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradlex-org%2Fjava-module-dependencies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gradlex-org","download_url":"https://codeload.github.com/gradlex-org/java-module-dependencies/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248243421,"owners_count":21071054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependencies","gradle-plugin","java","java-modules","jpms"],"created_at":"2025-03-24T13:16:16.706Z","updated_at":"2025-04-10T15:22:57.859Z","avatar_url":"https://github.com/gradlex-org.png","language":"Java","readme":"# Java Module Dependencies Gradle plugin\n\n[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fgradlex-org%2Fjava-module-dependencies%2Fbadge%3Fref%3Dmain\u0026style=flat)](https://actions-badge.atrox.dev/gradlex-org/java-module-dependencies/goto?ref=main)\n[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v?label=Plugin%20Portal\u0026metadataUrl=https%3A%2F%2Fplugins.gradle.org%2Fm2%2Forg%2Fgradlex%2Fjava-module-dependencies%2Forg.gradlex.java-module-dependencies.gradle.plugin%2Fmaven-metadata.xml)](https://plugins.gradle.org/plugin/org.gradlex.java-module-dependencies)\n\nA Gradle plugin to make Gradle use dependencies from _module-info.java_ files automatically.\nIf you have a project that fully uses Java Modules, you do **not** need to declare dependencies in the `dependencies { }` block anymore.\nGradle will use the information from your `module-info.java` directly.\n\nMinimal required Gradle version:\n- **Gradle 7.4** if you **not** use the plugin in `settings.gradle.kts`\n- **Gradle 8.8** to use the plugin in `settings.gradle.kts` and the [additional functionality](#project-structure-definition-when-using-this-plugin-as-settings-plugin) that comes with it.\n\nTo manage the versions of Java Modules, the plugin integrates with\n[Platform Projects](https://docs.gradle.org/current/userguide/java_platform_plugin.html#sec:java_platform_usage) and \n[Dependency Versions Constraints](https://docs.gradle.org/current/userguide/dependency_constraints.html#sec:adding-constraints-transitive-deps) in general\nas well as [Version Catalogs](https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog).\n\nThis [GradleX](https://gradlex.org) plugin is maintained by me, [Jendrik Johannes](https://github.com/jjohannes).\nI offer consulting and training for Gradle and/or the Java Module System - please [reach out](mailto:jendrik.johannes@gmail.com) if you are interested.\nThere is also my [YouTube channel](https://www.youtube.com/playlist?list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE) on Gradle topics.\n\nIf you have a suggestion or a question, please [open an issue](https://github.com/gradlex-org/java-module-dependencies/issues/new).\n\nThere is a [CHANGELOG.md](CHANGELOG.md).\n\n# Java Modules with Gradle\n\nIf you build Java Modules with Gradle, you should consider using these plugins on top of Gradle core:\n\n- [`id(\"org.gradlex.java-module-dependencies\")`](https://github.com/gradlex-org/java-module-dependencies) (this plugin)\n  Avoid duplicated dependency definitions and get your Module Path under control\n- [`id(\"org.gradlex.java-module-testing\")`](https://github.com/gradlex-org/java-module-testing)  \n  Proper test setup for Java Modules\n- [`id(\"org.gradlex.extra-java-module-info\")`](https://github.com/gradlex-org/extra-java-module-info)  \n  Only if you cannot avoid using non-module legacy Jars\n\n[In episodes 31, 32, 33 of Understanding Gradle](https://github.com/jjohannes/understanding-gradle) I explain what these plugins do and why they are needed.\n[\u003cimg src=\"https://onepiecesoftware.github.io/img/videos/31.png\" width=\"260\"\u003e](https://www.youtube.com/watch?v=X9u1taDwLSA\u0026list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE)\n[\u003cimg src=\"https://onepiecesoftware.github.io/img/videos/32.png\" width=\"260\"\u003e](https://www.youtube.com/watch?v=T9U0BOlVc-c\u0026list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE)\n[\u003cimg src=\"https://onepiecesoftware.github.io/img/videos/33.png\" width=\"260\"\u003e](https://www.youtube.com/watch?v=6rFEDcP8Noc\u0026list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE)\n\n# How to use?\n\nWorking (example) projects to inspect:\n- [java-module-system](https://github.com/jjohannes/java-module-system) contains a compact sample and further documentation\n- [gradle-project-setup-howto](https://github.com/jjohannes/gradle-project-setup-howto/tree/java_module_system) is a full-fledged Java Module System project setup\n- [hedera-services](https://github.com/hashgraph/hedera-services) is an open-source Java project using this plugin large scale\n\nFor general information about how to structure Gradle builds and apply community plugins like this one\nyou can check out my [Understanding Gradle video series](https://www.youtube.com/playlist?list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE). \n\n## Plugin dependency\n\nAdd this to the build file of your convention plugin's build\n(e.g. `gradle/plugins/build.gradle(.kts)` or `buildSrc/build.gradle(.kts)`).\n\n```\ndependencies {\n  implementation(\"org.gradlex:java-module-dependencies:1.8.1\")\n}\n```\n\n\u003e ⚠️ Due to [this bug](https://github.com/gradle/gradle/issues/21490#issuecomment-1458887481) in Gradle which may affect the plugin, it is recommented to add the following to your `settings.gradle(.kts)` file:\n\u003e ```\n\u003e includeBuild(\".\")\n\u003e ```\n\n## Apply the plugin\n\nThe plugin can be used in two ways:\n\n1. As _Settings Plugin_ in `settings.gradle(.kts)` file **(recommended)**\n2. As _Project Plugin_ in `build.gradle(.kts)` files (sometimes easier to add to existing setups)\n\n```\nplugins {\n  id(\"org.gradlex.java-module-dependencies\")\n}\n```\n\n## Effect of the plugin\n\nOnce the plugin is applied, dependencies are automatically determined based on the `requires` directives in your `module-info.java` files. For example:\n\n```\nmodule org.example.mymodule {\n  requires com.fasterxml.jackson.core;   // -\u003e implementation(\"com.fasterxml.jackson.core:jackson-core\")\n  requires transitive org.slf4j;         // -\u003e api(\"org.slf4j:slf4j-api\")\n  requires static jakarta.servlet;       // -\u003e compileOnly(\"jakarta.servlet:jakarta.servlet-api\")\n  requires /*runtime*/ org.slf4j.simple; // -\u003e runtimeOnly(\"org.slf4j:slf4j-simple\")\n}\n```\n\nNote that `requires /*runtime*/` is a directive specifically supported by this plugin to allow the specification of _runtime only_ dependencies.\n\n## Project structure definition when using this plugin as Settings Plugin\n\nThe plugin offers a Gradle DSL extension to configure the location of _Java Modules_ in the project structure to be used\nin the `settings.gradle(.kts)` file. It is an alternative to Gradle's native `include(...)` statement to configure\nsubprojects. The advantage of using this is that it is more compact than Gradle's `include(...)` and allows the plugin\nto pick up more information during the [initialization phase](https://docs.gradle.org/current/userguide/build_lifecycle.html#sec:initialization).\nBy this, the plugin is later able to establish dependencies between your own modules without making assumptions about\nhow they need to be named (which is different when you use the plugin as\n[Project Plugin](#project-structure-definition-when-using-this-plugin-as-project-plugin)).\n\n```\n// settings.gradle(.kts)\njavaModules { // use instead of 'include(...)'\n  module(\"module-a\") // Module in directory, discovers 'src/*/java/module-info.java' files\n  \n  module(\"module-b\") {\n    group = \"org.example\"  // define group early so that all subprojects know all groups\n    artifact = \"lib-x\"     // Gradle subproject name (if differnt than directory)\n    plugin(\"java-library\") // apply plugin to the Module's subproject to omit 'build.gradle'\n  }\n\n  directory(\"modules\") {   // Auto-include all Modules in subfolders of 'modules' \n    group = \"org.example\"  // group for all Modules\n    plugin(\"java-library\") // apply plugin to all Modules' subprojects\n    module(\"app\") { ... }  // individualise Module (only if needed)\n    \n    // To optimze Configuration Cache hits:\n    exclusions.add(\"_.*\")  // do not inspect certain folders (regex)\n    requiresBuildFile      // only look at folder containing a build.gradle(.kts)\n  }\n  \n  versions(\"gradle/versions\") // subproject configured as Platform Project\n}\n```\n\nIf you need more control over the properties of a Gradle subproject, in particular to define a nested project path,\nyou can still use Gradle's `include(...)` and then register the subproject with this plugin.\n\n```\ninclude(\":project:with:custom:path\")\njavaModules { \n  module(project(\":project:with:custom:path\")) {\n    group = \"org.example\"  // define group early so that all subprojects know all groups\n    plugin(\"java-library\") // apply plugin to the Module's subproject to omit 'build.gradle'\n  }\n}\n```\n\n## Project structure definition when using this plugin as Project Plugin\n\nIn this setup, subprojects with Java Modules are configured as in any traditional Gradle build: by using the\n`include(...)` statement in `settings.gradle(.kts)`. The plugin is then applied in all subprojects with Java Modules,\nideally through a convention plugin. If you use the plugin like this, it needs to [make some assumption](#naming-patterns-for-modules-in-the-build-if-used-as-project-plugin) \ndue to missing information and thus, for example, requires you to have the Gradle _project names_, _groups_ and _Java Module Names_ align.\nThe preferred way to use the plugin is to use it as [Settings Plugin](#project-structure-definition-when-using-this-plugin-as-settings-plugin).\n\n## Define additional module dependencies in build files\n\nWith this plugin you move dependency definitions into `module-info.java` files and no longer use the `dependencies {}` block in build files.\nHowever, there are certain dependency \"scopes\" not supported by the `module-info.java` syntax.\nFor this, the plugin offers an extension of Gradle's DSL to be used in `build.gradle(.kts)` files.\n\n```\nmainModuleInfo {\n  runtimeOnly(\"org.slf4j.simple\") // runtime only dependency for the 'main' module\n  annotationProcessor(\"dagger.compiler\")  // annotation processor dependency for the 'main' module\n}\n```\n\nFor modules in other source sets, there are corresponding blocks to define dependencies if needed – e.g. `testFixturesModuleInfo {}`.\n\nIn case a source set does **not** contain a `module-info.java`, all dependencies can be defined in the `build.gradle(.kts)` files.\nThe only case where this should be used is for whitebox testing activated via the [org.gradlex.java-module-testing](https://github.com/gradlex-org/java-module-testing) plugin.\n\n```\ntestModuleInfo {\n  requires(\"org.assertj.core\")\n  requires(\"org.hamcrest\")\n  requires(\"org.junit.jupiter.api\")\n}\n```\n\n## Add Module Name mapping information (if needed)\n\nYou may define additional mappings from _Module Name_ to _group:name (GA) coordinates_.\n\nThe plugin already knows about Modules available on Maven Central. The information is stored in:\n\n- [modules.properties](src/main/resources/org/gradlex/javamodule/dependencies/modules.properties) - [please open a PR](https://github.com/gradlex-org/extra-java-module-info/pulls) if you miss an entry\n- [unique_modules.properties](src/main/resources/org/gradlex/javamodule/dependencies/unique_modules.properties) - this information is extracted from [modules.properties](https://github.com/sormuras/modules/blob/main/com.github.sormuras.modules/com/github/sormuras/modules/modules.properties) by [@sormuras](https://github.com/sormuras)\n\nYou define additional entries (or overwrite entries from the plugin) in a `gradle/modules.properties` file in your project:\n\n```\norg.apache.commons.lang3=org.apache.commons:commons-lang3\norg.apache.commons.lang3.test.fixtures=org.apache.commons:commons-lang3|test-fixtures\n```\n\n**Or** as part of the plugin configuration in your convention plugins:\n\n```\njavaModuleDependencies {\n  // Module Name to Component GA Coordinates\n  moduleNameToGA.put(\"org.apache.commons.lang3\", \"org.apache.commons:commons-lang3\")\n\n  // Module Name to Component GA Coordinates \u0026 Capability GA Coordinates\n  moduleNameToGA.put(\"org.apache.commons.lang3.test.fixtures\", \"org.apache.commons:commons-lang3|test-fixtures\")\n}\n```\n\nThere is also the option to register a mapping for all Modules that share a common _name prefix_ and _group_.\nFor example: `moduleNamePrefixToGroup.put(\"com.example.product.module.\", \"com.example.product\")`.\n\n## Naming patterns for Modules in the build (if used as Project Plugin)\n\nThis plugin makes the following assumption about _Module Names_ of your own Modules in the build to establish dependencies between them:\n\n- **Module Name** == `\"${prefixOfYourChoice}.${project.name}`\n\nOr:\n\n- **Module Name** == `\"${prefixOfYourChoice}.${project.name}.${sourceSet.name}\"`\n\nA `project.name` is determined by the `include(projectName)` statement in the settings file.\nA `sourceSet.name` is typically the name of the folder where the sources are located - e.g _main_ or _test_.\n\nIf you have a `prefixOfYourChoice`, all your Modules **need to have the same prefix** in order for the plugin to establish dependencies between the projects.\n\n## Define Module versions in a Platform project as Dependency Constraints\n\nUse Gradle's dependency constraints and/or platforms to define versions for the modules you depend on.\nFor that you can combine the `java-platform` with the `org.gradlex.java-module-versions` plugin which adds a `moduleInfo { }` configuration block.\nIn that block, you have the `version(\"module.name\", \"1.0\")` notation to define a version by Module Name instead of coordinates.\nFor libraries that consist of multiple components and have a BOM for version management, you might prefer to include the BOM, which you need to do by coordinates, because a BOM does not have a Module Name.\n\n```\nplugins {\n  id(\"java-platform\")\n  id(\"org.gradlex.java-module-versions\")\n}\n\n// Define versions for Modules via the Module Name\nmoduleInfo {\n  version(\"org.apache.xmlbeans\", \"5.0.1\")\n  version(\"org.slf4j\", \"2.0.7\")\n  version(\"org.slf4j.simple\", \"2.0.7\")\n}\n\n// Use BOMs for Modules that are part of a library of multiple Modules\njavaPlatform.allowDependencies()\ndependencies {\n  api(platform(\"com.fasterxml.jackson:jackson-bom:2.13.2\"))\n  api(platform(\"org.junit:junit-bom:5.8.2\"))\n}\n```\n\nNote: If you need to declare additional dependencies without version, or want to use Gradle's rich versions, you can also use the `ga()` shortcut to map a Module Name to the corresponding GA coordinates.\nFor example:\n\n```\ndependencies {\n  javaModuleDependencies {\n    testRuntimeOnly(ga(\"org.junit.jupiter.engine\"))\n  }\n}\n```\n\n## Define Module versions in a version catalog\n\nAlternatively, versions can be defined in the `[version]` block of a [version catalog](https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog).\n- *Note, if you use the _libs.versions.toml_ notation:* Since `.` is not supported, you need to use `_` as delimiter in the module names.\n\n**settings.gradle.kts**\n\n```\ndependencyResolutionManagement {\n  versionCatalogs.create(\"libs\") {\n    version(\"org.apache.xmlbeans\", \"5.0.1\")\n    version(\"com.fasterxml.jackson.databind\", \"2.12.5\")\n    version(\"org.slf4j\", \"2.0.7\")\n    \n    version(\"org.junit.jupiter.api\", \"5.8.2\")\n  }\n}\n```\n\n**gradle/libs.versions.toml**\n```\n[versions]\norg_apache_xmlbeans = \"5.0.1\"\ncom_fasterxml_jackson_databind = \"2.12.5\"\norg_slf4j = \"2.0.7\"\n\norg-junit-jupiter-api = \"5.7.2\"\n```\n- Note that the TOML notation does not support `.` as separater in the Module Names, but allows you to use `_` or `-` instead.\n- _If_ you use a catalog with a custom name (not `libs`), you can tell the plugin using `versionCatalogName.set(\"customName\")`.\n\n## Find the latest stable version of a Module\n\nThe `recommendModuleVersions` help task prints the latest available versions of the Modules you require.\n\nYou may copy/paste the version constraints for your _platform project_ or _convention plugin_ from the task output:\n\n```\n$ ./gradlew :app:recommendModuleVersions -q\n\nLatest Stable Versions of Java Modules - use in your platform project's build.gradle(.kts)\n==========================================================================================\nmoduleInfo {\n  version(\"com.fasterxml.jackson.annotation\", \"2.13.2\")\n  version(\"com.fasterxml.jackson.core\", \"2.13.2\")\n  version(\"com.fasterxml.jackson.databind\", \"2.13.2.2\")\n  version(\"org.apache.logging.log4j\", \"2.17.2\")\n  version(\"org.apache.xmlbeans\", \"5.0.3\")\n  version(\"org.junit.jupiter.api\", \"5.8.2\")\n  version(\"org.junit.jupiter.engine\", \"5.8.2\")\n  version(\"org.junit.platform.commons\", \"1.8.2\")\n  version(\"org.junit.platform.engine\", \"1.8.2\")\n  version(\"org.junit.platform.launcher\", \"1.8.2\")\n  version(\"org.opentest4j\", \"1.2.0\")\n  version(\"org.slf4j\", \"1.7.36\")\n  version(\"org.slf4j.simple\", \"1.7.36\")\n}\n```\n\n## Check module-info.java files\n\nYou can use the `checkAllModuleInfo` check task to validate all `module-info.java` files for the following:\n\n- Do the _requires_ directives correspond to what is needed in the source code?\n  To activate this functionality, you need to apply the [com.autonomousapps.dependency-analysis](https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin) in the root project.\n- Are the _requires_ directives defined in alphabetical order?\n\n## Analyze Module Paths\n\nYou can use the `moduleDependencies` and `analyzeModulePath` help task to analyse the Module Paths of a project.\nIt will show you which Modules are used and to which GAV coordinates they map.\nIt will also print potential issues - like Jars that are not Modules\n(and are therefore put on the classpath)\nor wrong custom mappings from Module Names to GAs where the Jars are not Modules.\n\n```\n$ ./gradlew :app:moduleDependencies --configuration=runtimeClasspath -q\n\n------------------------------------------------------------\nProject ':app'\n------------------------------------------------------------\n\nruntimeClasspath - Runtime classpath of source set 'main'.\n+--- org.example.product.bespin\n|    +--- org.example.product.corellia\n|    |    +--- org.apache.poi.poi (5.2.2)\n|    |    |    +--- org.apache.commons.codec (1.15)\n|    |    |    +--- org.apache.commons.collections4 (4.4)\n|    |    |    +--- commons.math3 (3.6.1)\n|    |    |    +--- org.apache.commons.io (2.11.0)\n|    |    |    +--- SparseBitSet (1.2)\n|    |    |    \\--- org.apache.logging.log4j (2.17.2)\n|    |    +--- org.apache.commons.io (2.11.0)\n|    |    \\--- org.apache.poi.ooxml (5.2.2)\n|    |         +--- org.apache.poi.poi (5.2.2) (*)\n|    |         +--- org.apache.poi.ooxml.schemas (5.2.2)\n|    |         |    \\--- org.apache.xmlbeans (5.0.3)\n|    |         |         \\--- org.apache.logging.log4j (2.17.2)\n|    |         +--- org.apache.xmlbeans (5.0.3) (*)\n|    |         +--- org.apache.commons.compress (1.21)\n|    |         +--- org.apache.commons.io (2.11.0)\n|    |         +--- com.github.virtuald.curvesapi (1.07)\n|    |         +--- org.apache.logging.log4j (2.17.2)\n|    |         \\--- org.apache.commons.collections4 (4.4)\n|    +--- org.example.product.coruscant\n|    |    +--- com.fasterxml.jackson.annotation (2.13.4)\n|    |    +--- com.fasterxml.jackson.databind (2.13.4)\n|    |    |    +--- com.fasterxml.jackson.annotation (2.13.4)\n|    |    |    \\--- com.fasterxml.jackson.core (2.13.4)\n|    |    +--- com.google.common (30.1-jre)\n|    |    +--- java.inject (1.0.5)\n|    |    +--- com.fasterxml.jackson.core (2.13.4)\n|    |    +--- com.fasterxml.jackson.datatype.jsr310 (2.13.4)\n|    |    |    +--- com.fasterxml.jackson.annotation (2.13.4)\n|    |    |    +--- com.fasterxml.jackson.core (2.13.4)\n|    |    |    \\--- com.fasterxml.jackson.databind (2.13.4) (*)\n|    |    +--- jakarta.activation (1.2.2)\n|    |    +--- jakarta.mail (1.6.7)\n|    |    |    \\--- jakarta.activation (1.2.2)\n|    |    \\--- org.slf4j (2.0.3)\n|    \\--- velocity.engine.core (2.3)\n|         +--- org.apache.commons.lang3 (3.11)\n|         \\--- org.slf4j (2.0.3)\n+--- org.example.product.corellia (*)\n+--- org.example.product.kamino\n|    \\--- org.example.product.coruscant (*)\n+--- org.example.product.kashyyyk\n|    +--- org.example.product.naboo\n|    +--- org.example.product.tatooine\n|    +--- org.example.product.bespin (*)\n|    \\--- org.example.product.kamino (*)\n+--- org.example.product.naboo\n+--- org.example.product.tatooine\n+--- jakarta.servlet (6.0.0)\n\\--- org.slf4j (2.0.3)\n```\n\n\n```\n$ ./gradlew :app:analyzeModulePath -q\n\n[INFO] All Java Modules required by this project\n================================================\ncom.fasterxml.jackson.annotation -\u003e com.fasterxml.jackson.core:jackson-annotations (2.13.2)\ncom.fasterxml.jackson.core -\u003e com.fasterxml.jackson.core:jackson-core (2.13.2)\ncom.fasterxml.jackson.databind -\u003e com.fasterxml.jackson.core:jackson-databind (2.13.2)\norg.apache.logging.log4j -\u003e org.apache.logging.log4j:log4j-api (2.14.0)\norg.apache.xmlbeans -\u003e org.apache.xmlbeans:xmlbeans (5.0.1)\norg.apiguardian.api -\u003e org.apiguardian:apiguardian-api (1.1.2)\norg.junit.jupiter.api -\u003e org.junit.jupiter:junit-jupiter-api (5.8.2)\norg.junit.jupiter.engine -\u003e org.junit.jupiter:junit-jupiter-engine (5.8.2)\norg.junit.platform.commons -\u003e org.junit.platform:junit-platform-commons (1.8.2)\norg.junit.platform.engine -\u003e org.junit.platform:junit-platform-engine (1.8.2)\norg.junit.platform.launcher -\u003e org.junit.platform:junit-platform-launcher (1.8.2)\norg.my.app -\u003e project :app\norg.my.lib -\u003e project :lib\norg.opentest4j -\u003e org.opentest4j:opentest4j (1.2.0)\norg.slf4j -\u003e org.slf4j:slf4j-api (1.7.28)\norg.slf4j.simple -\u003e org.slf4j:slf4j-simple (1.7.28)\n\n[WARN] Components that are NOT Java Modules\n===========================================\ncommons-cli:commons-cli (1.5.0)\n\nNotes / Options:\n  - This may be ok if you use the Classpath (aka ALL-UNNAMED) in addition to the Module Path (automatic modules can see ALL-UNNAMED)\n  - Remove the dependencies or upgrade to higher versions\n  - Patch legacy Jars to Modules: https://github.com/gradlex-org/extra-java-module-info\n```\n\n## Migrate existing Java projects to Java Modules\n\nThe plugin provides a `generateAllModuleInfoFiles` task for each project that applies it.\nYou can use that to generate an initial `module-info.java` from the dependencies declared in Gradle.\nThis is not a sophisticated migration tool, but useful, in combination with `analyzeModulePath`, to explore what it would take to migrate an existing project to Modules.\n\n\n## Integration with the Extra Java Module Info plugin\n\nThis plugin integrates with the [Extra Java Module Info](https://github.com/gradlex-org/extra-java-module-info) plugin if both are applied.\nModule Name mappings for Jars that were patched with extra module info will be automatically registered.\n\n```\nplugins {\n  id(\"org.gradlex.extra-java-module-info\")\n  id(\"org.gradlex.java-module-dependencies\")\n}\n\nextraJavaModuleInfo {\n  automaticModule(\"org.apache.commons:commons-math3\", \"commons.math3\")\n  // Module Dependencies plugin automatically knows that \n  // 'commons.math3' now maps to 'org.apache.commons:commons-math3'\n}\n```\n\n## Using Gradle's configuration cache\n\nThis plugin reads all your `module-info.java` files during build configuration.\nThis is, because they provide the additional dependency information for setting up the build correctly.\nThe files are rather small and we do not extract all the information from them (only the dependencies).\nTherefore, it should not have much configuration time performance impact even on larger builds.\n\nHowever, if you enable (the currently experimental) [configuration cache](https://docs.gradle.org/current/userguide/configuration_cache.html)\nfeature of Gradle, the result of the configuration phase is cached, avoiding parsing `module-info.java` files again in a successive build run.\n\n```\norg.gradle.configuration-cache=true\n```\n\n# Disclaimer\n\nGradle and the Gradle logo are trademarks of Gradle, Inc.\nThe GradleX project is not endorsed by, affiliated with, or associated with Gradle or Gradle, Inc. in any way.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradlex-org%2Fjava-module-dependencies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgradlex-org%2Fjava-module-dependencies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradlex-org%2Fjava-module-dependencies/lists"}