{"id":13414244,"url":"https://github.com/TNG/ArchUnit","last_synced_at":"2025-03-14T21:32:26.155Z","repository":{"id":37405834,"uuid":"88962042","full_name":"TNG/ArchUnit","owner":"TNG","description":"A Java architecture test library, to specify and assert architecture rules in plain Java","archived":false,"fork":false,"pushed_at":"2024-10-15T06:57:20.000Z","size":16848,"stargazers_count":3202,"open_issues_count":143,"forks_count":290,"subscribers_count":51,"default_branch":"main","last_synced_at":"2024-10-19T17:44:25.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://archunit.org","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/TNG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2017-04-21T08:39:20.000Z","updated_at":"2024-10-19T08:40:33.000Z","dependencies_parsed_at":"2023-10-21T00:31:52.398Z","dependency_job_id":"15d93340-7814-48bb-8715-6a38d81322ea","html_url":"https://github.com/TNG/ArchUnit","commit_stats":{"total_commits":1958,"total_committers":90,"mean_commits":"21.755555555555556","dds":0.3176710929519918,"last_synced_commit":"f8f80de626125db852dc1349188e68669a8b2acc"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TNG%2FArchUnit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TNG%2FArchUnit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TNG%2FArchUnit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TNG%2FArchUnit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TNG","download_url":"https://codeload.github.com/TNG/ArchUnit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221437821,"owners_count":16821115,"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":[],"created_at":"2024-07-30T21:00:17.061Z","updated_at":"2025-03-14T21:32:26.145Z","avatar_url":"https://github.com/TNG.png","language":"Java","readme":"[![CI](https://github.com/TNG/ArchUnit/actions/workflows/build.yml/badge.svg)](https://github.com/TNG/ArchUnit/actions/workflows/build.yml?query=branch%3Amain++)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.tngtech.archunit/archunit/badge.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.tngtech.archunit%22%20)\n[![License](https://img.shields.io/github/license/TNG/ArchUnit.svg)](https://github.com/TNG/ArchUnit/blob/main/LICENSE)\n\n\u003cimg src=\"logo/ArchUnit-Logo.png\" height=\"64\" alt=\"ArchUnit\"\u003e\n\nArchUnit is a free, simple and extensible library for checking the architecture of your Java code. That is, ArchUnit can check\ndependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by\nanalyzing given Java bytecode, importing all classes into a Java code structure.\nArchUnit's main focus is to automatically test architecture and coding rules, using any plain Java unit testing\nframework.\n\n## An Example\n\n#### Add the Maven Central dependency to your project\n\n###### Gradle\n\n```\ntestImplementation 'com.tngtech.archunit:archunit:1.4.0'\n```\n\n###### Maven\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.tngtech.archunit\u003c/groupId\u003e\n    \u003cartifactId\u003earchunit\u003c/artifactId\u003e\n    \u003cversion\u003e1.4.0\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n#### Create a test\n\n```java\nimport com.tngtech.archunit.core.domain.JavaClasses;\nimport com.tngtech.archunit.core.importer.ClassFileImporter;\nimport com.tngtech.archunit.lang.ArchRule;\n\nimport static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;\n\npublic class MyArchitectureTest {\n    @Test\n    public void some_architecture_rule() {\n        JavaClasses importedClasses = new ClassFileImporter().importPackages(\"com.myapp\");\n    \n        ArchRule rule = classes()... // see next section\n    \n        rule.check(importedClasses);\n    }\n}\n```\n#### Let the API guide you\n![ArchUnit Fluent API](ArchUnit-API.gif)\n\n## Where to look next\n\nFor further information, check out the user guide at [http://archunit.org](http://archunit.org) \nor test examples for the current release at\n[ArchUnit Examples](https://github.com/TNG/ArchUnit-Examples).\n\n## License\n\nArchUnit is published under the Apache License 2.0, see http://www.apache.org/licenses/LICENSE-2.0 for details.\n\nIt redistributes some third party libraries:\n\n* ASM (http://asm.ow2.org), under BSD Licence\n* Google Guava (https://github.com/google/guava), under Apache License 2.0\n\nAll licenses for ArchUnit and redistributed libraries can be found within the [licenses](licenses) folder.\n","funding_links":[],"categories":["Java","项目","三、架构与框架（支撑大型应用）","测试","IV. Testing","Projects","Architecture test"],"sub_categories":["测试","1. 架构验证与设计","1. Testing","Architecture","Testing","Datbase to Struct"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTNG%2FArchUnit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTNG%2FArchUnit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTNG%2FArchUnit/lists"}