This document provides coding agents with essential information for working on this Eclipse plugin project.
Type: Eclipse Plugin (OSGi Bundle)
Language: Java 21
Build System: Maven with Eclipse Tycho 4.0.13
License: Eclipse Public License 2.0 (EPL-2.0)
# Build JGit dependency
cd ~/.eclipse/egit-master/git/jgit
mvn clean install
# Build EGit dependency
cd ~/.eclipse/egit-master/git/egit
mvn clean install# Full build with tests
mvn clean verify
# Build without tests
mvn clean verify -DskipTests
# Run all tests
mvn clean test
# Install to local Maven repository
mvn clean install
# Package only
mvn clean packagemvn clean testcd org.eclipse.egit.pullrequest.test
mvn test -Dtest=BitbucketClientTest
mvn test -Dtest=GitHubJsonParserTestcd org.eclipse.egit.pullrequest.test
mvn test -Dtest=GitHubJsonParserTest#testParseInlineCommentNote: Tests run headless (no UI harness required).
- Indentation: TABS (width 4), NOT spaces
- Line Length: 80 characters maximum
- File Encoding: UTF-8
- Imports: Explicit imports only - NO wildcards (e.g.,
import java.util.*) - Import Order: Standard Java import ordering, organize imports properly
- Classes: PascalCase (e.g.,
PullRequestListView) - Methods: camelCase (e.g.,
getPullRequests()) - Constants: UPPER_SNAKE_CASE (e.g.,
PLUGIN_ID) - Variables: camelCase (e.g.,
pullRequest) - Private fields: camelCase without prefix (no
m_or_)
- Javadoc Required: All public and protected members must have Javadoc
- Javadoc Format: Eclipse style with parameter descriptions aligned
/** * Brief description ending with period. * <p> * Detailed description if needed. * * @param paramName * description of parameter * @return description of return value */
ALL source files must include EPL-2.0 header:
/*******************************************************************************
* Copyright (C) 2026, [Author Name] and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/- Translatable Strings: Externalize all user-facing strings via
PRTextNLS class - Non-translatable Strings: Mark with
//$NON-NLS-1$commentpublic static final String PLUGIN_ID = "org.eclipse.egit.pullrequest"; //$NON-NLS-1$ String json = "{\"id\":123}"; //$NON-NLS-1$
- NEVER use
System.out.println()orprintStackTrace() - ALWAYS use
Activatorlogging methods:Activator.logError("Error message", exception); Activator.logWarning("Warning message"); Activator.logInfo("Info message");
- Framework: JUnit 4 (with JUnit 5 available)
- Assertions: Use Hamcrest matchers
- Static Imports: Use static imports for readability
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.notNullValue; @Test public void testSomething() { assertThat(result, equalTo(expected)); assertThat(list, hasSize(3)); assertThat(object, notNullValue()); }
eclipse-pullrequest-plugin/
├── pom.xml # Parent POM
├── org.eclipse.egit.pullrequest.target/ # Target platform
├── org.eclipse.egit.pullrequest/ # Main plugin (37 Java files)
│ ├── src/org/eclipse/egit/pullrequest/
│ │ ├── Activator.java # Bundle activator
│ │ └── internal/
│ │ ├── model/ # Data models (4 files)
│ │ ├── client/ # Abstraction layer (4 files)
│ │ ├── bitbucket/ # Bitbucket provider (2 files)
│ │ ├── github/ # GitHub provider (3 files)
│ │ └── ui/ # Eclipse UI (21 files)
│ ├── META-INF/MANIFEST.MF # OSGi bundle manifest
│ ├── plugin.xml # Extension points
│ └── plugin.properties # Externalized strings
└── org.eclipse.egit.pullrequest.test/ # Test fragment (2 test files)
└── src/org/eclipse/egit/pullrequest/internal/
├── bitbucket/BitbucketClientTest.java
└── github/GitHubJsonParserTest.java
model: Data model classes (PullRequest, PullRequestComment, etc.)client: Provider abstraction and factory patternbitbucket: Bitbucket Data Center API client implementationgithub: GitHub API client implementation with OAuth device flowui: Eclipse views, editors, perspectives, and UI components
- Declare all exported packages in
Export-Package - Use version ranges for dependencies:
[7.6.0,7.7.0) - Mark bundle as
Bundle-ActivationPolicy: lazy - Set
singleton:=truefor bundles with extension points
- Define views, perspectives, preferences using Eclipse extension points
- Use externalized strings from
plugin.properties - Follow Eclipse naming conventions for extension IDs
- Extend
AbstractUIPluginfor UI plugins - Implement singleton pattern with
getDefault() - Provide static logging methods (
logError,logWarning,logInfo)
- Add model classes in
internal.model/if needed - Update client interface and implementations if API changes needed
- Add UI components in
internal.ui/ - Add extension points to
plugin.xml - Externalize strings to
prtext.propertiesandPRText.java - Write tests in test fragment module
- Update MANIFEST.MF if new dependencies added
- Keep
IPullRequestClientinterface provider-agnostic - Implement provider-specific logic in
BitbucketClientorGitHubClient - Add JSON parsing to respective
*JsonParserclasses - Update tests to cover new API functionality
- Follow Eclipse RCP patterns (ViewPart, EditorPart, etc.)
- Use SWT for widgets, JFace for viewers
- Externalize all user-visible strings via NLS
- Register in
plugin.xmlwith appropriate extension point - Consider accessibility and keyboard navigation
- EGit Core [7.6.0,7.7.0)
- EGit UI [7.6.0,7.7.0)
- JGit packages [7.6.0,7.7.0)
- Eclipse Platform UI [3.x.0,4.0.0)
- Eclipse Compare Framework
- JUnit 4.13.2 (primary)
- JUnit 5.12.2 (available)
- Hamcrest 3.0.0
pom.xml(root): Parent POM with Tycho configurationorg.eclipse.egit.pullrequest/pom.xml: Main plugin buildorg.eclipse.egit.pullrequest.test/pom.xml: Test configurationMETA-INF/MANIFEST.MF: OSGi bundle manifest (in each module)build.properties: Eclipse PDE build configuration (in each module)plugin.xml: Eclipse extension point definitionsfragment.xml: Test fragment configuration
- Main code:
org.eclipse.egit.pullrequest/src/ - Test code:
org.eclipse.egit.pullrequest.test/src/ - Resources:
org.eclipse.egit.pullrequest/icons/ - Strings:
org.eclipse.egit.pullrequest/src/.../prtext.properties
- Always use TABS: This project uses tabs, not spaces. Verify indentation.
- String externalization: Never hardcode user-facing strings; use NLS.
- No wildcard imports: Always use explicit imports.
- EPL-2.0 headers: Required on all new source files.
- Logging: Use
Activator.logError()etc., never System.out. - 80-char lines: Keep lines under 80 characters.
- Test coverage: Add tests for all new functionality.
- Provider abstraction: Keep model classes provider-agnostic.
- OSGi dependencies: Update MANIFEST.MF when adding dependencies.
- Javadoc: Required for all public/protected members.
After successful build:
- Main plugin:
org.eclipse.egit.pullrequest/target/org.eclipse.egit.pullrequest-7.6.0-SNAPSHOT.jar - Test plugin:
org.eclipse.egit.pullrequest.test/target/org.eclipse.egit.pullrequest.test-7.6.0-SNAPSHOT.jar
- Ensure JGit and EGit are built in local repositories
- Check p2 repository paths in
pom.xmlmatch your setup
- Verify JUnit 4 is available in target platform
- Check test plugin fragment host configuration in MANIFEST.MF
- Run
mvn clean verifyto generate Eclipse project metadata - Import as "Existing Maven Projects"
- Target platform should be resolved automatically