This document provides comprehensive development guidelines for contributing to this Polarion extension project. It complements other documentation files and focuses specifically on technical setup and development workflows.
- Development Environment Setup
- Project Structure
- Building the Project
- Testing
- Debugging
- Development Workflow
- Common Development Tasks
- Java JDK 21
- Maven 3.9
- IDE of your choice (IntelliJ IDEA, Eclipse, VS Code with Java extensions)
- Git
- Active Polarion license (as mentioned in CONTRIBUTING.md, all contributors must have an active Polarion license)
-
Clone the repository:
git clone https://github.com/SchweizerischeBundesbahnen/<repository-name>.git cd <repository-name>
-
Set up Polarion dependencies:
- Extract dependencies from your Polarion installer using polarion-artifacts-deployer
- This step is required for building and testing the extension
-
Set environment variables:
export POLARION_HOME=/path/to/your/polarion/installation -
Import the project into your IDE:
- For Eclipse: Import as "Existing Maven Project"
- For IntelliJ IDEA: Import as Maven project
- For VS Code: Open folder and ensure Java extensions are installed
The project follows a standard Maven directory structure:
├── src/
│ ├── main/
│ │ ├── java/ # Java source files
│ │ │ └── ch/sbb/polarion/extension/
│ │ └── resources/ # Resources like configuration files
│ │ ├── META-INF/
│ │ └── webapp/ # Web resources
│ └── test/ # Test sources
├── docs/ # Documentation
├── LICENSE # Apache License 2.0
├── NOTICE # Copyright attribution
├── DCO # Developer Certificate of Origin
├── pom.xml # Maven configuration
├── README.md # Project overview
└── various .md files # Additional documentation
mvn clean packagemvn clean install -P install-to-local-polarionNote: This requires POLARION_HOME environment variable to be set correctly.
mvn clean verifyThe project uses JUnit for testing. Run tests with:
mvn testCode coverage reports can be generated with:
mvn verifyThe reports will be available in target/site/jacoco.
For debugging the extension in a running Polarion instance:
-
Add debug parameters to the
config.shfile in your Polarion installation:# Add this line to config.sh JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
-
Start Polarion as a service:
service polarion start
-
Connect your IDE to the remote JVM on port 5005
- Use the Polarion logging system for extension logs
- Logs are available in
<polarion_home>/polarion/logs/main.log
mainbranch is protected and represents the production-ready state- Create feature branches from
mainfor new work - Follow the pattern:
feature/<feature-name>orfix/<bug-name>
- Ensure your branch is up to date with
main - Make sure all tests pass
- Create a pull request targeting
main - Follow the commit message guidelines in CONTRIBUTING.md
- Ensure the PR description clearly describes the changes
- Wait for code review and approval
This project uses GitHub Actions for CI/CD, and SonarCloud for code quality analysis.
- Create a new branch from
main - Implement your feature
- Write tests
- Update documentation
- Submit a pull request
- Create a new branch from
main - Fix the bug
- Add a test that verifies the fix
- Submit a pull request
- README.md - Project overview and installation instructions
- CONTRIBUTING.md - Guidelines for contributing to the project
- CODING_STANDARDS.md - Detailed coding standards
- RELEASE.md - Information about the release process