{"id":29709639,"url":"https://github.com/habedi/template-java-project","last_synced_at":"2025-10-14T13:06:28.995Z","repository":{"id":305571753,"uuid":"981739613","full_name":"habedi/template-java-project","owner":"habedi","description":"A template for Java projects :coffee:","archived":false,"fork":false,"pushed_at":"2025-07-20T20:17:48.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-20T22:11:44.227Z","etag":null,"topics":["java","java-application","java-library","jdk","jvm","quality-of-life","template","template-project","template-repository"],"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/habedi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2025-05-11T19:29:18.000Z","updated_at":"2025-07-01T06:43:59.000Z","dependencies_parsed_at":"2025-07-20T22:22:05.449Z","dependency_job_id":null,"html_url":"https://github.com/habedi/template-java-project","commit_stats":null,"previous_names":["habedi/template-java-project"],"tags_count":1,"template":true,"template_full_name":"habedi/template-rust-project","purl":"pkg:github/habedi/template-java-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-java-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-java-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-java-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-java-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/habedi","download_url":"https://codeload.github.com/habedi/template-java-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-java-project/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266738945,"owners_count":23976490,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["java","java-application","java-library","jdk","jvm","quality-of-life","template","template-project","template-repository"],"created_at":"2025-07-23T20:06:41.522Z","updated_at":"2025-10-14T13:06:23.956Z","avatar_url":"https://github.com/habedi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Project Template\n\n\u003cdiv align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003cimg alt=\"template-java-project logo\" src=\"logo.svg\" height=\"50%\" width=\"50%\"\u003e\n  \u003c/picture\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n[![Tests](https://img.shields.io/github/actions/workflow/status/habedi/template-java-project/tests.yml?label=tests\u0026style=flat\u0026labelColor=282c34\u0026color=4caf50\u0026logo=github)](https://github.com/habedi/template-java-project/actions/workflows/tests.yml)\n[![Code Coverage](https://img.shields.io/codecov/c/github/habedi/template-java-project?style=flat\u0026labelColor=282c34\u0026color=ffca28\u0026logo=codecov)](https://codecov.io/gh/habedi/template-java-project)\n[![Code Quality](https://img.shields.io/codefactor/grade/github/habedi/template-java-project?style=flat\u0026labelColor=282c34\u0026color=4caf50\u0026logo=codefactor)](https://www.codefactor.io/repository/github/habedi/template-java-project)\n[![Docs](https://img.shields.io/badge/docs-latest-007ec6?style=flat\u0026labelColor=282c34\u0026logo=readthedocs)](docs)\n[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-007ec6?style=flat\u0026labelColor=282c34\u0026logo=open-source-initiative)](https://github.com/habedi/template-java-project)\n[![Release](https://img.shields.io/github/release/habedi/template-java-project.svg?style=flat\u0026labelColor=282c34\u0026color=f46623\u0026logo=github)](https://github.com/habedi/template-java-project/releases/latest)\n\nThis is a template for Java projects.\nIt provides a minimalistic project structure with pre-configured GitHub Actions, Makefile, and a few useful\nconfiguration files.\nI share it here in case it might be useful to others.\n\n## Features\n\n- **Modern Java Development**: Built for Java 21 with Maven as the build system\n- **Well-organized Project Structure**: Standard Maven directory layout with separate source and test directories\n- **Pre-configured Tools**:\n    - **Code Quality**: Spotless (Google Java Style) and Checkstyle for consistent code style\n    - **Testing**: JUnit Jupiter for unit testing with JaCoCo for code coverage\n    - **Logging**: Log4j configured and ready to use\n    - **CLI Support**: Picocli for building command-line applications\n    - **Benchmarking**: JMH for performance testing\n- **CI/CD Integration**: Pre-configured GitHub Actions for running tests and making releases\n- **Development Workflow**: Makefile for managing common tasks (build, test, format, lint)\n- **Quality Assurance**: Pre-commit hooks to ensure code quality before commits\n- **Documentation**: Ready-to-use templates for project documentation\n- **Licensing**: Dual-licensed under MIT and Apache 2.0\n\n## Getting Started\n\n### Prerequisites\n\n- Java 21 or later\n- Maven 3.8+ (or use the included Maven wrapper)\n- Git\n- (Optional) Python 3.6+ for pre-commit hooks\n\n### Using This Template\n\n1. Click the \"Use this template\" button on GitHub or clone the repository:\n   ```bash\n   git clone https://github.com/habedi/template-java-project.git my-project\n   cd my-project\n   ```\n\n2. Update project information in `pom.xml`:\n    - Change `groupId`, `artifactId`, and `version`\n    - Update `name`, `description`, and `url`\n    - Modify the main class path in the Maven Shade Plugin configuration\n\n3. Build the project:\n   ```bash\n   make build\n   ```\n\n4. Run the application:\n   ```bash\n   java -jar target/project-name-0.1.0-SNAPSHOT.jar\n   ```\n\n## Project Structure\n\n```\n├── src/\n│   ├── main/java/         # Application source code\n│   ├── main/resources/    # Application resources\n│   ├── test/java/         # Test source code\n│   └── jmh/java/          # Benchmarking code\n├── docs/                  # Documentation\n├── examples/              # Example code\n├── scripts/               # Utility scripts\n├── pom.xml                # Maven configuration\n├── Makefile               # Common tasks\n└── README.md              # This file\n```\n\n## Development Workflow\n\nThis project uses `make` to manage common development tasks:\n\n```bash\nmake build        # Compile, test, and package the application\nmake test         # Run all tests\nmake format       # Format source code using Spotless\nmake lint         # Check code style with Checkstyle\nmake clean        # Remove build artifacts\nmake help         # Show all available commands\n```\n\n### Pre-commit Hooks\n\nThis project uses [pre-commit](https://pre-commit.com/) to run checks before each commit, ensuring code quality and\nconsistency. The hooks include:\n\n- Code formatting checks\n- Code style checks\n- Basic Git checks (trailing whitespace, merge conflicts, etc.)\n- Tests (on push)\n\nTo set up the pre-commit hooks:\n\n1. Install pre-commit:\n   ```bash\n   pip install pre-commit\n   ```\n\n2. Set up the hooks:\n   ```bash\n   make setup-hooks\n   ```\n\nOnce installed, the hooks will run automatically on `git commit` and `git push`.\n\nYou can also manually test the hooks on all files without committing:\n\n```bash\nmake test-hooks\n```\n\n## Dependencies\n\nThis template includes the following key dependencies:\n\n- **Logging**: [Log4j 2](https://logging.apache.org/log4j/2.x/) for application logging\n- **CLI**: [Picocli](https://picocli.info/) for command-line interface support\n- **Testing**: [JUnit 5](https://junit.org/junit5/) for unit testing\n- **Benchmarking**: [JMH](https://github.com/openjdk/jmh) for performance benchmarking\n\nAdditional development dependencies:\n\n- **Code Style**: [Spotless](https://github.com/diffplug/spotless) with Google Java Style\n- **Code Quality**: [Checkstyle](https://checkstyle.org/) for static code analysis\n- **Code Coverage**: [JaCoCo](https://www.jacoco.org/jacoco/) for test coverage reporting\n\n## Continuous Integration\n\nThis template includes GitHub Actions workflows for:\n\n- Running tests on multiple Java versions\n- Checking code style and quality\n- Building and publishing releases\n- Generating code coverage reports\n\n## Contributing\n\nContributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for details on:\n\n- How to report bugs or suggest features\n- Development workflow and code style guidelines\n- Pull request process\n\n## License\n\nThis project is available under either of the following licenses:\n\n* MIT License ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)\n* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)\n\nYou can choose which license you want to use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhabedi%2Ftemplate-java-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhabedi%2Ftemplate-java-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhabedi%2Ftemplate-java-project/lists"}