{"id":20877452,"url":"https://github.com/t1/pdap","last_synced_at":"2026-05-15T16:06:01.553Z","repository":{"id":142921365,"uuid":"162377833","full_name":"t1/pdap","owner":"t1","description":"Package-Dependencies-Annotation-Processor","archived":false,"fork":false,"pushed_at":"2019-10-04T13:03:35.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T02:59:09.711Z","etag":null,"topics":["annotation-processor","dependency","dependency-analysis","dependency-tree","jdk"],"latest_commit_sha":null,"homepage":null,"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/t1.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2018-12-19T03:28:11.000Z","updated_at":"2019-10-04T13:03:37.000Z","dependencies_parsed_at":"2023-04-27T17:54:56.890Z","dependency_job_id":null,"html_url":"https://github.com/t1/pdap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/t1/pdap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fpdap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fpdap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fpdap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fpdap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t1","download_url":"https://codeload.github.com/t1/pdap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fpdap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33071609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["annotation-processor","dependency","dependency-analysis","dependency-tree","jdk"],"created_at":"2024-11-18T06:57:04.625Z","updated_at":"2026-05-15T16:06:01.533Z","avatar_url":"https://github.com/t1.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PDAP = Package Dependencies Annotation Processor\n\nThe dependencies between packages are important to keep an eye on, so your architecture stays a Clean Architecture.\nE.g., a `boundary` package with your REST bindings is allowed to access the `controller` package\nwith you application and business logic, but not the other way around,\nor you will find it difficult to refactor, or even think clearly about your layers.\n\nYet I've hardly seen any larger code base, where these rules are *not* violated!\nIt's just way to easy to accidentally import a class from the wrong package.\nThere are tools to check your dependencies, but when exactly do you use them?\nAnd do you really check the dependencies of a project with more than, e.g., 30 packages?\n\nThis little annotation processor comes to your rescue:\nJust add a dependency to `com.github.t1:package.dependencies.annotation.processor`\nand annotate your packages (i.e. in the `package-info.java` files introduced in Java 1.6) with `@AllowDependenciesOn`, e.g.:\n\n```java\n@AllowDependenciesOn(\"controller\")\npackage boundary;\n\nimport com.github.t1.pdap.AllowDependenciesOn;\n```\n\n... for you `boundary` package, and:\n\n```java\n@AllowDependenciesOn()\npackage controller;\n\nimport com.github.t1.pdap.AllowDependenciesOn;\n```\n\n... for your `controller` package.\n\nThe Java compiler detects the annotation processor in the dependency and executes it along with the compile process.\nIf you have a dependency that is not allowed, it will report it as a compilation error;\nand if you have allowed a dependency that is not used, it will report it as a warning.\n\nYou will be warned about packages without a `@AllowDependenciesOn` annotation, but they won't be checked at all,\nwhich allows for a step-by-step introduction of dependency checking (and you *will* find violations ;)\n\nYou can also add `@AllowDependenciesOn` annotations to super packages: they will be merged with sub package annotations.\nThis allows you to declare generally allowed dependencies only once.\n\nPlease note that using an annotation does not create a strong dependency:\nA class can run perfectly fine without the annotations it uses on the classpath.\nOnly when you access annotations via reflection, etc., they create a strong dependency.\n\n\n# Warnings and more\n\nThe `maven-compiler-plugin` normally doesn't show warnings. To see them, configure the plugin like this:\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n    \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e3.8.0\u003c/version\u003e\n    \u003cconfiguration\u003e\n        \u003cshowWarnings\u003etrue\u003c/showWarnings\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n``` \n\nThis also enables `INFO` and `OTHER` messages, but to see debug output, set a system property, e.g.:\n\n```\nmvn clean install -Dcom.github.t1.pdap.PackageDependenciesAnnotationProcessor#DEBUG\n```\n\n\n# Eclipse\n\nI haven't been using Eclipse for several years now, but it probably won't work with the Eclipse compiler,\nas we access the Abstract Syntax Tree from the Java compiler, and Eclipse is not compatible with that.\n\n\n# Status: Beta\n\n##### Dependencies Not Recognized\n\nSome dependencies in the AST *may* not yet be recognized.\n\n\n# Ideas\n\nSome things that would be really cool to add:\n\n* Report dependency cycles.\n* Wildcards: `AllowDependenciesOn(\"**.controller\")` allows dependencies on all packages ending with `.controller`,\n  and `@AllowDependenciesOn(\"javax.ws.rs+\")` allows dependencies on `javax.ws.rs` and all subpackages.\n* `parent`-Variable: `AllowDependenciesOn(\"${parent}.controller\")` allows dependencies on a sibling `controller` package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1%2Fpdap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft1%2Fpdap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1%2Fpdap/lists"}