Thank you for your interest in contributing! We welcome pull requests that improve the plugin.
- Keep changes focused - One feature/fix per PR
- Fork the repository - Work on your own fork
-
Fork and clone the repository
git fork https://github.com/dotCMS/google-analytics.git cd google-analytics -
Create a feature branch
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-description -
Set up your development environment
- JDK 11 or higher
- Gradle (included via wrapper)
- A running dotCMS instance for testing (local or Docker)
-
Build the plugin
./gradlew clean jar
The JAR will be in
build/libs/google-analytics-X.X.X.jar
-
Write clean, readable code
- Follow existing code style and patterns
- Add comments for complex logic
- Keep methods focused and concise
-
Test your changes
- Build the plugin:
./gradlew jar - Upload to a dotCMS instance
- Test with real Google Analytics data
- Verify OSGi bundle loads without errors
- Test Velocity viewtool functionality
- Build the plugin:
-
Update documentation
- Update README.md if you changed functionality
- Add/update code comments
- Document new viewtool methods or parameters
-
Commit your changes
git add . git commit -m "Brief description of changes Longer explanation of what changed and why. Include any breaking changes or migration notes."
Commit message guidelines:
- Use present tense ("Add feature" not "Added feature")
- Be concise but descriptive
- Reference issues when applicable (
Fixes #123)
-
Push to your fork
git push origin feature/your-feature-name
-
Create a Pull Request
- Go to the repository
- Click "New Pull Request"
- Select your fork and branch
- Fill out the PR template with:
- What changed - Clear description of changes
- Why - The problem this solves
- Testing - How you tested the changes
- Breaking changes - Any compatibility issues
- Related issues - Link to related issues
-
Address review feedback
- Be responsive to comments
- Make requested changes in new commits
- Ask questions if feedback is unclear
- Java: Follow standard Java conventions
- Indentation: 4 spaces (no tabs)
- Braces: Opening brace on same line
- Naming:
- Classes:
PascalCase - Methods/variables:
camelCase - Constants:
UPPER_SNAKE_CASE
- Classes:
When adding dependencies:
- Check if dotCMS already provides it - Use
compileOnlyif yes - Bundle third-party libraries - Add to
osgiLibsconfiguration - Update Import-Package - Exclude bundled packages from imports
- Test OSGi wiring - Verify bundle loads in clean dotCMS instance
Example from build.gradle:
dependencies {
compileOnly('com.dotcms:dotcms:23.01.10') { transitive = true }
implementation (group: 'your.library', name: 'artifact', version: '1.0.0')
osgiLibs (group: 'your.library', name: 'artifact', version: '1.0.0')
}
'Import-Package': '''
!your.library.*,
javax.*,
com.dotcms.*,
...
'''Before submitting a PR, verify:
- Plugin builds without errors:
./gradlew clean jar - JAR uploads successfully to dotCMS
- OSGi bundle starts without errors (check logs for "Starting Google Analytics OSGI plugin")
- Viewtool is available in Velocity (
$googleanalytics) - Can create analytics request and query GA4 data
- No breaking changes to existing Velocity code (or documented if necessary)
- Works with dotCMS 23.01.10 and newer
This plugin follows Semantic Versioning:
- Major (X.0.0): Breaking changes
- Minor (0.X.0): New features, backward compatible
- Patch (0.0.X): Bug fixes, backward compatible
IMPORTANT: Bump the version in build.gradle for each PR that should trigger a new release:
version = '0.4.2' // Increment for your changesWhen merged to main, GitHub Actions will:
- Check if release
v0.4.2exists - If not, build the JAR and create the release
- If yes, skip release creation (no duplicates)
Always bump the version to ensure your changes are trackable in releases.
Releases are automated via GitHub Actions:
- PR is merged to
main - GitHub Actions builds the plugin
- Creates a GitHub release with the JAR attached
- Tags the release with version from
build.gradle
Only maintainers can merge to main and trigger releases.
- General questions: dotCMS Community Forums
- dotCMS development: dotCMS Developer Docs
By contributing, you agree that your contributions will be licensed under the same terms as the project.
Thank you for contributing to make dotCMS better! 🎉