{"id":18745261,"url":"https://github.com/pantsbuild/example-jvm","last_synced_at":"2025-04-12T21:32:48.175Z","repository":{"id":39760112,"uuid":"440646155","full_name":"pantsbuild/example-jvm","owner":"pantsbuild","description":"An example repo to demonstrate Java and Scala support in Pants","archived":false,"fork":false,"pushed_at":"2025-02-12T19:28:09.000Z","size":62,"stargazers_count":4,"open_issues_count":2,"forks_count":16,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-03-26T15:54:34.528Z","etag":null,"topics":["java","pants","pantsbuild","scala"],"latest_commit_sha":null,"homepage":"https://www.pantsbuild.org/2.20/docs/jvm/java-and-scala","language":"Shell","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/pantsbuild.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-21T20:46:39.000Z","updated_at":"2025-02-12T19:28:14.000Z","dependencies_parsed_at":"2024-05-29T16:00:38.344Z","dependency_job_id":"ba9fb04d-12f4-4a06-ba61-adb5e124204e","html_url":"https://github.com/pantsbuild/example-jvm","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantsbuild%2Fexample-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantsbuild%2Fexample-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantsbuild%2Fexample-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantsbuild%2Fexample-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pantsbuild","download_url":"https://codeload.github.com/pantsbuild/example-jvm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248636307,"owners_count":21137420,"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":["java","pants","pantsbuild","scala"],"created_at":"2024-11-07T16:17:25.797Z","updated_at":"2025-04-12T21:32:47.460Z","avatar_url":"https://github.com/pantsbuild.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# example-jvm\n\nAn example repository to demonstrate Pants's experimental Java and Scala support.\n\nSee the first\n[JVM blog post](https://blog.pantsbuild.org/automatically-unlocking-concurrent-builds-and-fine-grained-caching-on-the-jvm-with-dependency-inference/)\nfor some unique\nbenefits Pants brings to Java and Scala projects.\n\nThis repository demonstrates a mix of Java and Scala, which is a common use case. But the Java\nand Scala backends can be independently enabled, so there is no need to expose Scala BUILD file\nsymbols if you have a pure-Java repository (or vice versa). See comments in the `backends` section\nof [`pants.toml`](./pants.toml).\n\nThis is only one possible way of laying out your project with Pants. See \n[pantsbuild.org/docs/source-roots#examples](https://www.pantsbuild.org/docs/source-roots#examples) \nfor some other example layouts.\n\n# Running Pants\n\nYou run Pants goals using the `pants` launcher binary, which will bootstrap the\nversion of Pants configured for this repo if necessary.\n\nSee [here](https://www.pantsbuild.org/docs/installation) for how to install the `pants` binary.\n\n# Goals\n\nPants commands are called _goals_. You can get a list of goals with\n\n```\npants help goals\n```\n\nMost goals take arguments to run on. To run on a single directory, use the directory name with \n`:` at the end. To recursively run on a directory and all its subdirectories, add `::` to the \nend.\n\nFor example:\n\n```\npants lint src: 3rdparty::\n```\n\nYou can run on all changed files:\n\n```\npants --changed-since=HEAD lint\n```\n\nYou can run on all changed files, and any of their \"dependees\":\n\n```\npants --changed-since=HEAD --changed-dependees=transitive test\n```\n\n# Example Goals\n\nTry these out in this repo!\n\n## Run `scalafmt` and `google_java_format`\n\n```\npants fmt ::  # Format all files.\npants fmt src/jvm:  # Format only files in this directory (non-recursively).\npants lint src/jvm::  # Check that all files under `src/jvm` are formatted (recursively).\n```\n\n## Check compilation\n\n```\npants check ::  # Compile everything.\npants check src/jvm/org/pantsbuild/example/lib/ExampleLib.java  # Compile a file and its deps.\n```\n\n## Run and debug tests\n\n```\npants test ::  # Run all tests in the repository.\npants test tests/jvm/org/pantsbuild/example/lib:  # Run all the tests in this directory.\npants test tests/jvm/org/pantsbuild/example/lib/ExampleLibSpec.scala -- -z hello  # Run one test method.\npants test --debug tests/jvm/org/pantsbuild/example/lib/ExampleLibSpec.scala  # Debug one file.\n```\n\n## Create a binary file\n\nWrites the result to the `dist/` folder.\n\n```\npants package src/jvm/org/pantsbuild/example/app:  # Build one binary.\npants package ::  # Create all binaries.\n```\n\n## Determine dependencies\n\n```\npants dependencies tests/jvm::\npants dependencies --transitive tests/jvm::\n```\n\n## Determine dependees\n\nThat is, find what code depends on a particular files.\n\n```\npants dependees src/jvm/org/pantsbuild/example/lib::\npants dependees --transitive src/jvm/org/pantsbuild/example/lib/ExampleLib.java\n```\n\n## Count lines of code\n\n```\npants count-loc '**/*'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpantsbuild%2Fexample-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpantsbuild%2Fexample-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpantsbuild%2Fexample-jvm/lists"}