Thank you for your interest in contributing to HDFView! This document provides guidelines and instructions for contributing to the project.
- Getting Started
- Development Environment Setup
- Development Workflow
- Testing
- Code Quality
- Pull Request Process
- Coding Standards
- Reporting Issues
HDFView is a Java-based GUI application for viewing and editing HDF files. The project uses Maven for build management and Eclipse SWT for the user interface.
- Java 21 or later
- Maven 3.6+
- HDF4 and HDF5 native libraries
- Git
-
Clone the repository
git clone https://github.com/HDFGroup/hdfview.git cd hdfview -
Configure native libraries
# Edit build.properties to point to your HDF4/HDF5 installations vi build.properties -
Build the project
# Quick development build (skips tests and quality checks) ./scripts/build-dev.sh # Or full build with tests mvn clean install
-
Run HDFView
./run-hdfview.sh
Modify the build.properties file in the project root:
# HDF4 library path
hdf.lib.dir=/path/to/hdf4/lib
# HDF5 library path
hdf5.lib.dir=/path/to/hdf5/lib
# HDF5 plugin directory
hdf5.plugin.dir=/path/to/hdf5/plugin
# Runtime library path (LD_LIBRARY_PATH on Linux)
platform.hdf.lib=${hdf5.lib.dir}:${hdf.lib.dir}The project can be imported into any IDE that supports Maven:
- Eclipse: Import as Maven project
- IntelliJ IDEA: Open the project directory
- VS Code: Open the project directory with Java extensions installed
# Quick development build
./scripts/build-dev.sh
# Clean everything and build from scratch
./scripts/clean-all.sh
./scripts/build-dev.sh
# Full build with tests
mvn clean install
# Package without tests
mvn clean package -DskipTestsThe scripts/ directory contains useful development tools:
clean-all.sh- Deep clean to pristine statebuild-dev.sh- Quick development buildset-debug-logging.sh- Toggle debug logging levelscheck-quality.sh- Run quality analysis locallyanalyze-coverage.sh- Generate code coverage reports
Use the launcher scripts for easy execution:
# Launch with direct JAR (recommended)
./run-hdfview.sh
# Launch with debug logging
./run-hdfview.sh --debug
# Interactive mode
./run-hdfview.sh --choose# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=TestClassName
# Run specific test method
mvn test -Dtest=TestClassName#methodName
# Run only unit tests (fast)
mvn test -Dgroups="unit & fast"
# Run integration tests
mvn test -Dgroups="integration"Tests are organized using JUnit 5 tags:
@Tag("unit")- Fast unit tests@Tag("integration")- Integration tests@Tag("ui")- UI tests (require display)@Tag("fast")- Quick tests
- Use JUnit 5 for all new tests
- Follow existing test patterns in the codebase
- Use descriptive test names
- Include test documentation for complex scenarios
- Ensure tests are deterministic and not flaky
See docs/Testing-Guide.md for detailed testing documentation.
The project enforces quality standards through automated checks:
- Code Coverage: 60% line coverage, 50% branch coverage target
- PMD: Static analysis for code quality
- Checkstyle: Code style enforcement
- Security: OWASP dependency checking
# Quick validation (recommended before commit)
./scripts/validate-quality.sh
# Comprehensive analysis
./scripts/check-quality.sh
# Generate coverage report
./scripts/analyze-coverage.shAll pull requests trigger automated builds and quality checks:
- Linux, macOS, and Windows builds
- Test execution (object module)
- Code quality analysis
- Security scanning
See docs/guides/CI-CD-Pipeline-Guide.md for complete CI/CD documentation.
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write clean, documented code
- Add or update tests as needed
- Run quality checks locally
-
Test your changes
mvn clean install ./scripts/validate-quality.sh
-
Commit your changes
git add . git commit -m "Brief description of changes"
-
Push your branch
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub with:
- Clear title describing the change
- Detailed description of what and why
- Reference to related issues (if any)
- Test results or evidence of testing
-
Address review feedback
- Respond to reviewer comments
- Make requested changes
- Push additional commits as needed
- All CI checks must pass
- Code review approval from at least one maintainer
- No merge conflicts with target branch
- Documentation updated if needed
The project follows adapted Google Java Style:
- Use spaces for indentation (2 spaces)
- Maximum line length: 100 characters
- Use meaningful variable and method names
- Add JavaDoc for public APIs
- Avoid over-engineering: Keep changes focused and minimal
- No premature optimization: Write clear code first
- Security conscious: Watch for injection vulnerabilities
- Error handling: Validate at system boundaries (user input, external APIs)
- Logging: Use SLF4J for logging
- Null safety: Check for null appropriately
- Update JavaDoc for public API changes
- Update README.md or docs/ for user-facing changes
- Add inline comments for complex logic
- Keep CHANGELOG.md updated for significant changes
When reporting a bug, include:
- HDFView version
- Operating system and version
- Java version (
java -version) - HDF4/HDF5 library versions
- Steps to reproduce
- Expected vs actual behavior
- Sample HDF file if relevant (and not too large)
When requesting a feature, describe:
- Use case and motivation
- Proposed solution or behavior
- Any alternatives considered
- Willingness to contribute implementation
Do not report security vulnerabilities in public issues. Contact The HDF Group security team directly at security@hdfgroup.org.
The project follows a phased modernization approach:
- Phase 1: Maven migration (✅ Complete)
- Phase 2A: JUnit 5 migration (✅ Complete)
- Phase 2B: CI/CD pipeline (✅ Complete)
- Phase 2C: Quality analysis (✅ Complete)
- Phase 2D: UI framework research (Deferred)
- Build Guide:
docs/Build_HDFView.txt - Testing Guide:
docs/Testing-Guide.md - CI/CD Documentation:
docs/guides/CI-CD-Pipeline-Guide.md - Cross-Platform Builds:
docs/guides/Cross-Platform-Build-Quick-Reference.md - Troubleshooting:
docs/guides/CI-CD-Troubleshooting.md
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and community discussion
- HDF Forum: https://forum.hdfgroup.org/ for general HDF-related questions
By contributing to HDFView, you agree that your contributions will be licensed under the project's existing license.
Thank you for contributing to HDFView!