[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7519":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},7519,"dependency-analysis-gradle-plugin","autonomousapps\u002Fdependency-analysis-gradle-plugin","autonomousapps","Gradle plugin for JVM projects written in Java, Kotlin, Groovy, or Scala; and Android projects written in Java or Kotlin. Provides advice for managing dependencies and other applied plugins","",null,"Kotlin",2143,150,14,159,0,1,11,3,62.14,"Apache License 2.0",false,"main",true,[26,27,28,29,30,31,32],"android","gradle-plugin","groovy","java","jvm","kotlin","scala","2026-06-12 04:00:34","= Dependency Analysis Gradle Plugin\n\nimage::https:\u002F\u002Fimg.shields.io\u002Fmaven-metadata\u002Fv.svg?label=release&metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Fautonomousapps%2Fdependency-analysis%2Fcom.autonomousapps.dependency-analysis.gradle.plugin%2Fmaven-metadata.xml[Latest version,link=\"https:\u002F\u002Fmvnrepository.com\u002Fartifact\u002Fcom.autonomousapps.dependency-analysis\u002Fcom.autonomousapps.dependency-analysis.gradle.plugin\"]\nimage::https:\u002F\u002Fimg.shields.io\u002Fmaven-metadata\u002Fv?metadataUrl=https%3A%2F%2Fcentral.sonatype.com%2Frepository%2Fmaven-snapshots%2Fcom%2Fautonomousapps%2Fdependency-analysis-gradle-plugin%2Fmaven-metadata.xml[Latest snapshot,link=\"https:\u002F\u002Fcentral.sonatype.com\u002Fservice\u002Frest\u002Frepository\u002Fbrowse\u002Fmaven-snapshots\u002Fcom\u002Fautonomousapps\u002Fdependency-analysis-gradle-plugin\u002F\"]\nimage::https:\u002F\u002Fgithub.com\u002Fautonomousapps\u002Fdependency-analysis-gradle-plugin\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg[Build status,link=\"https:\u002F\u002Fgithub.com\u002Fautonomousapps\u002Fdependency-analysis-android-gradle-plugin\u002Factions\u002Fworkflows\u002Ftest.yml\"]\n\n== Features [[features]]\n\nThe Dependency Analysis Gradle Plugin has the following features:\n\nIt reports on dependency-related issues such as:\n\n1. … unused dependencies.\n2. … used transitive dependencies, which it is advisable you declare directly.\n3. … dependencies declared on the wrong configuration (`api` vs `implementation` vs `compileOnly`, etc.).\n4. … unused annotation processors.\n\nFor these types of issues, the plugin has auto-remediation capabilities.\n\nIt can also report on plugin-related issues such as when:\n\n1. … the `org.jetbrains.kotlin.jvm` plugin is applied but isn't used.\n2. … the `com.android.library` plugin is applied but the module could be JVM.\n\nAdditionally, the plugin:\n\n1. … will warn when a classpath has duplicate class files.\n2. … can trigger downloading of external dependencies, which can help with containerized builds.\n3. … print the dominator tree for a project, which can help with discovering \"fat\" dependencies that are bloating the\n   size of your deployables.\n4. … generate a project graph to help visualize the shape of your project.\n\n== Compatibilities\n\n*Supported languages:* Java and Kotlin on Android; and Groovy, Java, Kotlin, and Scala on the JVM.\n\nThe plugin *only analyzes* modules with *these specific plugins* applied:\n\n.Android modules\n* `com.android.application`\n* `com.android.library`\n* `com.android.test`\n* `com.android.kotlin.multiplatform.library`\n\nIn the case of Android modules, the plugin also takes into account whether `org.jetbrains.kotlin.android` has been\napplied.\n\n.JVM modules\n* `java-library`\n* `org.jetbrains.kotlin.jvm`\n\n.KMP (Kotlin Multiplatform) modules for `jvm` and `androidLibrary` targets\n* `org.jetbrains.kotlin.multiplatform`\n* `com.android.kotlin.multiplatform.library`\n\n.Other JVM plugins\n\nThis plugin supports these three plugins, but _only_ in the that they also have an \"application\" plugin applied (see\nbelow), or `java-library` in the case of `groovy` and `scala`.\n\n* `java`\n* `groovy`\n* `scala`\n\nIn addition, the plugin distinguishes between \"libraries\" and \"applications.\" The former have an API, while the latter\ndo not. In practical terms, this means that \"application\" modules should not have any `api`-like dependencies.\n\n.JVM application modules\nModules with the following plugins (in addition to those above) are considered to be applications.\n\n* `application`\n* `org.gretty`\n* `com.google.cloud.tools.jib`\n* `org.springframework.boot`\n\n== Add to your project and use\n\nFor detailed instructions, see\nhttps:\u002F\u002Fgithub.com\u002Fautonomousapps\u002Fdependency-analysis-android-gradle-plugin\u002Fwiki\u002FAdding-to-your-project[the wiki].\n\nThe simplest approach is to add the following:\n\n.settings.gradle.kts\n[source,kotlin]\n----\nplugins {\n  id(\"com.autonomousapps.build-health\") version \"\u003C\u003Clatest_version>>\"\n}\n----\n\nand then in the root build script:\n\n.build.gradle.kts\n[source,kotlin]\n----\ndependencyAnalysis {\n  issues {\n    all {\n      onAny {\n        severity(\"fail\")\n      }\n    }\n  }\n}\n----\n\nIMPORTANT: If your project uses Kotlin or Android (or both), then those plugins must also be loaded in the settings\nscript classloader (or a parent). See\nhttps:\u002F\u002Fgithub.com\u002Fautonomousapps\u002Fdependency-analysis-gradle-plugin\u002Fwiki\u002FAdding-to-your-project[the wiki] for more information\n\nFor a quick start, just run the following:\n\n----\n.\u002Fgradlew buildHealth\n----\n\nYou will probably see output like the following:\n\n----\n> Task :buildHealth FAILED\n\nFAILURE: Build failed with an exception.\n\n* What went wrong:\nExecution failed for task ':buildHealth'.\n> There were dependency violations. See report at file:\u002F\u002F\u002Fpath\u002Fto\u002Fproject\u002Fbuild\u002Freports\u002Fdependency-analysis\u002Fbuild-health-report.txt\n----\n\nIf you wish to have this (potentially very long) report printed to console, add this to the `dependencyAnalysis` DSL:\n\n.build.gradle.kts\n[source,kotlin]\n----\ndependencyAnalysis {\n  reporting {\n    printBuildHealth(true)\n  }\n}\n----\n\n=== Partial analysis\n\nThe instructions above will configure the plugin to do a global analysis of the entire multi-project project. There are\ncases where it may be desirable to do partial analysis, or analysis of just one or a set of projects, or conversely to\nexclude specific projects. There are various ways to achieve this.\n\nOne such approach is to use the `projectHealth` task, which is discussed in more detail \u003C\u003Cproject_health,below>>.\n\nAnother common approach, especially for very large projects, is to \u003C\u003Cadvanced_usage,selectively apply>> the\n`com.autonomousapps.dependency-analysis` plugin, rather than the `com.autonomousapps.build-health` plugin as discussed\nabove.\n\nFinally, one may use a Gradle property to specify which projects to include:\n\n.gradle.properties\n[source,properties]\n----\n# Include all projects except those whose path begins with `:prefix`\ndependency.analysis.project.includes=^((?!:prefix)).*$\n----\n\nThe value provided is evaluated as a regex. The example above uses a negative lookahead to exclude any project whose\npath (`project.path`) begins with `:prefix`, and include everything else.\n\n== Repositories\n\nFrom 2.19.0 for releases, and 2.18.1-SNAPSHOT for snapshots, this plugin uses https:\u002F\u002Fcentral.sonatype.com. To add this\nplugin to your project, use the following repositories.\n\n.settings.gradle.kts\n[source,kotlin]\n----\npluginManagement {\n  repositories {\n    \u002F\u002F releases\n    mavenCentral()\n    \u002F\u002F snapshots\n    maven(url = \"https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002F\")\n    \u002F\u002F Once you start using pluginManagement, you should explicitly add this,\n    \u002F\u002F unless you NEVER want to use this repository\n    gradlePluginPortal()\n  }\n}\n----\n\n== More advanced usage [[advanced_usage]]\n\nYou do not have to apply this plugin to all projects via the settings script. It can also be applied to only specific\nsubprojects. In this case, it must also be applied to the root build script.\n\n.root build.gradle.kts\n[source,kotlin]\n----\nplugins {\n  id(\"com.autonomousapps.dependency-analysis\") version \"\u003C\u003Clatest_version>>\"\n}\n----\n\n.sub\u002Fproject\u002Fbuild.gradle.kts\n[source,kotlin]\n----\nplugins {\n  id(\"com.autonomousapps.dependency-analysis\")\n}\n----\n\nIMPORTANT: If your project uses Kotlin or Android (or both), then those plugins must also be loaded in the root build\nscript classloader (or a parent). See\nhttps:\u002F\u002Fgithub.com\u002Fautonomousapps\u002Fdependency-analysis-gradle-plugin\u002Fwiki\u002FAdding-to-your-project[the wiki] for more information\n\n== Project Health [[project_health]]\n\nThe analysis can be run against individual modules with the `projectHealth` task. For example:\n\n----\n.\u002Fgradlew app:projectHealth\n----\n\n== Fix dependency issues automatically\n\nIt is common for the plugin to report many issues with your project's dependency declarations. Since fixing manually can\nbe tedious, the plugin also provides a task to auto-remediate all issues.\n\n----\n.\u002Fgradlew fixDependencies\n----\n\nThe `fixDependencies` task is registered on each project where the plugin is applied. Running it as above will run the\ntask in each subproject. See also\nhttps:\u002F\u002Fdev.to\u002Fautonomousapps\u002Fone-click-dependencies-fix-191p[_One click dependencies fix_].\n\n=== Fix only some dependency issues automatically\n\nIn some circumstances, it may be considered infeasible to resolve all issues in one pass. Maybe you have a very large\nproject, or you publish libraries and you know that changing your dependency declarations will also change your\nlibraries' metadata, which might break consumers. To support this use-case, the the `fixDependencies` task takes an\noptional flag to tell it to, essentially, make only \"safe\" changes.\n\n----\n.\u002Fgradlew fixDependencies --upgrade\n----\n\nWith this flag in place, the `fixDependencies` task will not remove or \"downgrade\" any dependency declarations. It will\nonly add or \"upgrade\" declarations (e.g., from `implementation` to `api`).\n\nIn an incremental rollout scenario, one could imagine using the `--upgrade` flag, then updating all consumers, then\nfinally removing the flag and removing all unused dependencies.\n\n=== Caveats\n\nIf the analysis has any bugs, then fixing the dependency declarations make break your build (but this is also the case\nwith manual fixes). If you encounter this, please\nhttps:\u002F\u002Fgithub.com\u002Fautonomousapps\u002Fdependency-analysis-gradle-plugin\u002Fissues\u002Fnew\u002Fchoose[file an issue].\n\nAdditionally, the rewriting functionality is based on a simplified Gradle Groovy DSL grammar, which will fail in the\npresence of complex Groovy build scripts. The Kotlin DSL grammar has full support for the entire Kotlin language, which\nmakes the rewriting functionality work much better for Gradle Kotlin DSL scripts. There are no plans to do the same for\nGradle Groovy DSL.\n\n== Reason\n\nYou may be curious why the plugin is emitting (or not emitting) advice regarding some dependency. You can ask it why:\n\n----\n.\u002Fgradlew lib:reason --id com.squareup.okio:okio:2.2.2 \u003C1>\n> Task :lib:reason\n\n----------------------------------------\nYou asked about the dependency 'com.squareup.okio:okio:2.2.2'.\nThere is no advice regarding this dependency.\n----------------------------------------\n\nShortest path from :lib to com.squareup.okio:okio:2.2.2:\n:lib\n\\--- com.squareup.okio:okio:2.2.2\n\nSource: main\n------------\n* Exposes class okio.BufferedSource (implies api).\n----\n\u003C1> The version string is optional.\n\n== Basic configuration\n\nFor detailed information on how to configure the plugin, see\nhttps:\u002F\u002Fgithub.com\u002Fautonomousapps\u002Fdependency-analysis-android-gradle-plugin\u002Fwiki\u002FCustomizing-plugin-behavior[the wiki].\n\nTo configure the plugin, use the\nhttps:\u002F\u002Fgithub.com\u002Fautonomousapps\u002Fdependency-analysis-android-gradle-plugin\u002Fblob\u002Fmain\u002Fsrc\u002Fmain\u002Fkotlin\u002Fcom\u002Fautonomousapps\u002FDependencyAnalysisExtension.kt[`dependencyAnalysis`] extension.\n\nBelow is a summary of the top-level DSL options:\n\n.build.gradle.kts\n[source,kotlin]\n----\ndependencyAnalysis {\n  \u002F\u002F Declare that the plugin should use typesafe project accessors. False by default.\n  useTypesafeProjectAccessors(true)\n\n  \u002F\u002F Configure ABI exclusion rules.\n  abi { ... }\n\n  \u002F\u002F Configure the severity of issues, and exclusion rules, for potentially the entire project.\n  issues { ... }\n\n  \u002F\u002F Configure issue reports.\n  reporting { ... }\n\n  \u002F\u002F Configure dependency structure rules (bundles, mapping, etc).\n  structure { ... }\n\n  \u002F\u002F Configure usage rules.\n  usage { ... }\n}\n----\n\n== Ancillary tasks\n\nAs mentioned \u003C\u003Cfeatures,above>>, the plugin has a variety of features not strictly related to maintaining a correct\ndependency graph.\n\n=== Trigger downloading of external dependencies\n\nThis task will resolve all the external dependencies for a given source set's compile and runtime classpaths.\n\"Resolving\" a dependency will also result in downloading that dependency. A common case where this is useful is when\nyou want to create an image for a containerized build.\n\n----\n.\u002Fgradlew :\u003Cmodule>:resolveExternalDependenciesMain\n----\n\nwhere \"Main\" refers to the name of the source set or Android variant (capitalized).\n\n=== Print the dominator tree\n\nThis will print the https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDominator_(graph_theory)[dominator tree] for the given project. This\nis useful when looking for \"fat\" dependencies that contribute significantly to final binary size (such as with a fatjar\nor when building an image), and in cases where it's desirable to shrink that binary.\n\n----\n.\u002Fgradlew :\u003Cmodule>:printDominatorTreeCompileMain\n----\n\nwhere \"Main\" refers to the name of the source set or Android variant (capitalized).\n\n=== Generate a project graph\n\nThis will generate various views of the project graph in your multi-project build, for both compile and runtime\nclasspaths. In addition to the graphviz output, there is also a topological sort, which might be useful for debugging\nissues with evaluation order.\n\n----\n.\u002Fgradlew :\u003Cmodule>:projectGraphMain\n----\n\nwhere \"Main\" refers to the name of the source set or Android variant (capitalized).\n\n== Programmatic usage and API guarantees\n\nFrom version 3.0.0, the plugin includes an api definition in `api\u002Fapi.txt`. Any backwards-incompatible change from then\non will result in a major version release. Note that some code is public only due to tooling limitations; most of this\ncode is in an `internal` package, but `com.autonomousapps.tasks` is also considered \"internal.\" Usage of any API in\nthese internal packages is at your own risk.\n\nFor typical users who only apply the plugin and run the primary tasks (`buildHealth`, `projectHealth`, `reason`, etc.),\nmajor releases should be treated as non-events. For these users, the \"API\" is just those primary tasks.\n\n== Publications\n\nThe following is a list of articles \u002F blog posts that have been published discussing this plugin:\n\n1. https:\u002F\u002Fblog.gradle.org\u002Fdetect-maven-hijack-risks-in-gradle-with-plugin[Detecting Maven-Hijack-style risks in Gradle builds with the Dependency Analysis Gradle Plugin\n]\n2. https:\u002F\u002Fdev.to\u002Fautonomousapps\u002Fthe-proper-care-and-feeding-of-your-gradle-build-d8g[The proper care and feeding of your Gradle build]\n3. https:\u002F\u002Fdev.to\u002Fautonomousapps\u002Fdependency-analysis-gradle-plugin-using-bytecode-analysis-to-find-unused-dependencies-509n[Dependency Analysis Gradle Plugin: Using bytecode analysis to find unused dependencies]\n4. https:\u002F\u002Fdev.to\u002Fautonomousapps\u002Fdependency-analysis-gradle-plugin-what-s-an-abi-3l2h[Dependency Analysis Gradle Plugin: What's an ABI?]\n5. https:\u002F\u002Fdev.to\u002Fautonomousapps\u002Freducing-my-gradle-plugin-s-impact-on-configuration-time-a-journey-32h2[Reducing my Gradle plugin's impact on configuration time: A journey]\n6. https:\u002F\u002Fdev.to\u002Fautonomousapps\u002Fone-click-dependencies-fix-191p[One-click dependencies fix]\n\nThis plugin has also been featured in these newsletters:\n\n1. https:\u002F\u002Fnewsletter.gradle.org\u002F2024\u002F10[Gradle, Oct 2024]\n2. https:\u002F\u002Fnewsletter.gradle.com\u002F2022\u002F05[Gradle, May 2022]\n3. https:\u002F\u002Fnewsletter.gradle.com\u002F2020\u002F09[Gradle, September 2020]\n4. https:\u002F\u002Fnewsletter.gradle.com\u002F2020\u002F08[Gradle, August 2020]\n5. https:\u002F\u002Fandroidweekly.net\u002Fissues\u002Fissue-423[Android Weekly, Issue #423]\n6. https:\u002F\u002Fnewsletter.gradle.com\u002F2020\u002F07[Gradle, July 2020]\n7. https:\u002F\u002Fnewsletter.gradle.com\u002F2020\u002F06[Gradle, June 2020]\n\nPodcast episodes about this plugin could be found here:\n\n1. https:\u002F\u002Fthebakery.dev\u002F31\u002F[The Developers' Bakery, Episode #31]\n\nYoutube videos about this plugin:\n\n1. https:\u002F\u002Fyoutu.be\u002FLipf5piizZc[Understanding Gradle #28 – Clean Compile Classpaths with the Dependency Analysis Plugin]\n","这是一个为JVM和Android项目提供依赖管理和插件应用建议的Gradle插件。它能够检测未使用的依赖、错误声明的依赖配置以及未使用的注解处理器，并具备自动修复这些问题的能力。此外，该插件还能识别未充分利用或不恰当使用的插件，警告重复类文件的存在，并生成项目的支配树以帮助发现膨胀的依赖项。使用Kotlin编写，适用于Java、Kotlin、Groovy或Scala编写的JVM项目及Java或Kotlin编写的Android项目，特别适合需要优化构建过程、减少最终包大小的开发场景。",2,"2026-06-11 03:12:52","top_language"]