Thank you for your interest in contributing to ApplicationClassLoader!
- Check existing issues - Your bug may already be reported
- Use the bug report template - Provide all requested information
- Include details:
- classloader-java version
- Java version (output of
java -version) - Operating system
- Full stack trace
- Minimal reproducible example
- Open a GitHub Issue with the enhancement label
- Describe the use case - Why is this feature needed?
- Propose a solution - How should it work?
- Consider alternatives - What other approaches could solve this?
-
Fork the repository
git clone https://github.com/YOUR-USERNAME/classloader-java.git cd classloader-java -
Create a feature branch
git checkout -b feature/my-feature
-
Make your changes
- Write clean, readable code
- Follow existing code style
- Add JavaDoc for public APIs
- No wildcard imports (
import java.util.*- use specific imports)
-
Add tests
- All new features require unit tests
- Bug fixes should include regression tests
- Aim for high test coverage (target: 80%+)
- Run tests:
mvn clean test
-
Update documentation
- Update README.md if adding new features
- Update JavaDoc for API changes
- Add examples if appropriate
-
Commit your changes
git add . git commit -m "Brief description of changes Detailed explanation of what changed and why. Fixes #123"
-
Push and create Pull Request
git push origin feature/my-feature
Then open a PR on GitHub
- No wildcard imports - Use specific imports (
import java.util.List;notimport java.util.*;) - Prefer specific exceptions - Don't throw or catch generic
Exception - Implement AutoCloseable - For classes that hold resources (connections, files, etc.)
- Immutable value objects - Make value objects
finalwithequals/hashCode/toString
- All public classes must have class-level JavaDoc
- All public methods must have JavaDoc with:
- Description of what the method does
@paramfor each parameter@returnfor return values@throwsfor checked exceptions
- Include examples in JavaDoc when helpful
Example:
/**
* Loads class data from a remote HTTP/HTTPS source.
* Supports optional authentication via Basic or Bearer token.
*
* @param className The fully qualified class name (e.g., "com.example.MyClass")
* @return The class bytecode as a byte array
* @throws IOException if the class cannot be loaded or network error occurs
*/
@Override
public byte[] loadClassData(String className) throws IOException {
// Implementation
}- Use JUnit 5 -
@Test, not JUnit 4 - Mock external dependencies - Use Mockito for mocking HTTP clients, databases, etc.
- Test edge cases - Null inputs, empty strings, invalid data
- No integration tests in unit tests - Mock external services (S3, databases, Kafka)
Example test:
@Test
void testLoadClassDataThrowsIOExceptionOnNetworkError() throws IOException {
HttpURLConnection mockConnection = mock(HttpURLConnection.class);
when(mockConnection.getResponseCode()).thenReturn(500);
RemoteClassSource source = new RemoteClassSource("https://example.com");
assertThrows(IOException.class, () -> source.loadClassData("com.example.MyClass"));
}# Run all tests
mvn clean test
# Run tests with coverage
mvn clean test jacoco:report
# View coverage report
open target/site/jacoco/index.html
# Run checkstyle (if configured)
mvn checkstyle:check
# Full verification
mvn clean verify# Build without tests
mvn clean install -DskipTests
# Build with tests
mvn clean install
# Generate JavaDoc
mvn javadoc:javadoc
# View JavaDoc
open target/site/apidocs/index.html-
Automated checks run on all PRs:
- Tests must pass (493+ tests)
- Code must compile
- No wildcard imports
-
Maintainer review:
- Code quality and style
- Test coverage
- Documentation
- Breaking changes
-
Feedback and iteration:
- Address review comments
- Update PR as needed
- Maintainer will merge when ready
By contributing to ApplicationClassLoader, you agree that:
- Your contributions will be licensed under the GNU General Public License v3.0
- You have the right to contribute the code (you own it or have permission)
- You understand that contributions may be modified or rejected
- GitHub Issues - Ask questions with the "question" label
- GitHub Discussions - For general discussions and design questions
- Documentation - Check README.md, JavaDoc, and code examples
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainer.
Contributors are recognized in:
- Git commit history
- GitHub contributors page
- Release notes (for significant contributions)
Note: Only project maintainers can create releases.
Releases are created through the GitHub Actions workflow:
- Navigate to Actions → "Release" workflow
- Click "Run workflow"
- Enter version (e.g.,
2.1,3.0)- Must follow
X.Yformat (semantic versioning: major.minor) - No
-SNAPSHOTsuffix for releases
- Must follow
The workflow automatically:
- ✅ Validates version format
- ✅ Updates
pom.xmlto release version - ✅ Runs full test suite
- ✅ Builds and signs artifacts (requires GPG key)
- ✅ Deploys to Maven Central via OSSRH
- ✅ Creates Git tag (
vX.Y) - ✅ Generates changelog from commit history
- ✅ Creates GitHub Release with installation instructions
- ✅ Bumps
pom.xmlto next development version (X.(Y+1)-SNAPSHOT)
Maintainers must configure these GitHub secrets:
OSSRH_USERNAME- Sonatype OSSRH usernameOSSRH_TOKEN- Sonatype OSSRH tokenGPG_PRIVATE_KEY- GPG private key for signing artifactsGPG_PASSPHRASE- GPG key passphrase
After release:
- Artifacts appear on Maven Central within 30 minutes to 2 hours
- Users can then add the dependency:
<dependency>
<groupId>org.flossware</groupId>
<artifactId>classloader-java</artifactId>
<version>X.Y</version>
</dependency>Before creating a release:
- All tests passing on
mainbranch - CHANGELOG.md updated with release notes
- Version number decided (follows semantic versioning)
- Breaking changes documented
- Security issues addressed
- Quality gate passing (46% instruction coverage)
For critical bug fixes:
- Create hotfix branch from release tag
- Apply fix and increment minor version
- Follow normal release process
- Merge back to main
This project follows Semantic Versioning 2.0.0:
- Major version (X.0): Breaking changes, incompatible API changes
- Minor version (X.Y): New features, backwards-compatible enhancements
- Patch version: Not used (we only release X.Y versions)
Examples:
2.0→3.0: Breaking change (extracted protocols to separate libraries)2.0→2.1: New features, backwards-compatible2.1→3.0: Another breaking change
Thank you for contributing to ApplicationClassLoader!