This guide helps you set up a development environment for the GOSS (GridOPTICS Software System) platform using either Eclipse IDE or Visual Studio Code.
- Java 21 (OpenJDK recommended)
- Git for version control
- Gradle 8.10+ (included via Gradle wrapper)
# Install SDKMAN
curl -s "https://get.sdkman.io" | bash
source ~/.sdkman/bin/sdkman-init.sh
# Install Java 21
sdk install java 21.0.5-tem
sdk use java 21.0.5-temsudo apt update
sudo apt install openjdk-21-jdkbrew install openjdk@21
# Add to your shell profile:
export PATH="/opt/homebrew/opt/openjdk@21/bin:$PATH"- Download OpenJDK 21 from Eclipse Adoptium
- Install and set
JAVA_HOMEenvironment variable - Add
%JAVA_HOME%\binto yourPATH
java -version # Should show Java 21.x.x
./gradlew --version # Should work without errorsGOSS is a modern OSGi-based messaging framework with the following structure:
GOSS/
├── pnnl.goss.core/ # Core GOSS framework
│ ├── src/pnnl/goss/core/ # Core API and interfaces
│ ├── client/ # Client implementations
│ ├── server/ # Server implementations
│ └── security/ # Security realms and handlers
├── pnnl.goss.core.runner/ # Executable runners
├── pnnl.goss.core.itests/ # Integration tests
├── pnnl.goss.core.testutil/ # Testing utilities
└── cnf/ # BND workspace configuration
- OSGi Declarative Services (modern dependency injection)
- Apache ActiveMQ (message broker)
- Apache Shiro (security framework)
- BND Tools (OSGi bundle management)
- JDK 21 (modern Java features)
Download Eclipse IDE for Enterprise Java and Web Developers (2023-12 or later) from eclipse.org.
- Go to Help → Eclipse Marketplace
- Search for "BND Tools"
- Install Bnd OSGi Tools by Neil Bartlett
- Restart Eclipse
- Go to Help → Eclipse Marketplace
- Search for "Buildship Gradle Integration"
- Install if not already present
-
Clone the Repository
git clone <your-goss-repository-url> cd GOSS
-
Import as Gradle Project
- File → Import → Gradle → Existing Gradle Project
- Browse to your GOSS directory
- Click Next and Finish
- Eclipse will automatically download dependencies and configure the project
-
Configure Java Build Path
- Right-click project → Properties → Java Build Path
- Verify Modulepath shows Java 21
- If not, remove old JRE and add Java 21 JRE
- Window → Perspective → Open Perspective → Other → Plug-in Development
- This enables OSGi bundle editors and tools
- The
cnf/directory contains BND workspace configuration - Eclipse should automatically recognize this as a BND workspace
- You'll see
.bndfiles with syntax highlighting
-
Right-click on
pnnl.goss.core.runner→ Run As → Java Application -
Choose
GossSimpleRunneras the main class -
Set VM arguments if needed:
-Djava.util.logging.config.file=conf/logging.properties
- Gradle → Refresh Gradle Project (right-click on project)
- Project → Build All for incremental builds
- Run → External Tools → External Tools Configurations to set up Gradle tasks
- Navigate to
pnnl.goss.core.itests/src/ - Right-click test classes → Run As → JUnit Test
- Or use Gradle: Gradle Tasks → verification → check
- Set breakpoints in your code
- Right-click
GossSimpleRunner→ Debug As → Java Application - Use Eclipse's debugging perspective for step-through debugging
# Install VS Code first, then add these extensions:
code --install-extension vscjava.vscode-java-pack
code --install-extension vscjava.vscode-gradle
code --install-extension ms-vscode.vscode-json
code --install-extension redhat.vscode-yaml- Language Support for Java by Red Hat
- Debugger for Java
- Test Runner for Java
- Maven for Java
- Project Manager for Java
- Visual Studio IntelliCode
-
Clone and Open
git clone <your-goss-repository-url> cd GOSS code .
-
Configure Java
- Press
Ctrl+Shift+P(Cmd+Shift+P on macOS) - Type: Java: Configure Java Runtime
- Set Java 21 as the project JDK
- Press
{
"java.home": "/path/to/java-21",
"java.configuration.updateBuildConfiguration": "automatic",
"java.gradle.buildServer.enabled": "on",
"files.exclude": {
"**/.gradle": true,
"**/build": true,
"**/bin": true
},
"java.compile.nullAnalysis.mode": "automatic"
}{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Launch GOSS Simple Runner",
"request": "launch",
"mainClass": "pnnl.goss.core.runner.GossSimpleRunner",
"projectName": "pnnl.goss.core.runner",
"console": "integratedTerminal",
"args": [],
"vmArgs": "-Djava.util.logging.config.file=conf/logging.properties"
}
]
}{
"version": "2.0.0",
"tasks": [
{
"label": "Build GOSS",
"type": "shell",
"command": "./gradlew",
"args": ["build", "-x", "check"],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always"
}
},
{
"label": "Run Tests",
"type": "shell",
"command": "./gradlew",
"args": ["check"],
"group": "test",
"presentation": {
"echo": true,
"reveal": "always"
}
},
{
"label": "Create Executable JARs",
"type": "shell",
"command": "./gradlew",
"args": [":pnnl.goss.core.runner:createSimpleRunner"],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always"
}
}
]
}- Open Command Palette:
Ctrl+Shift+P(Cmd+Shift+P) - Tasks: Run Task → Select "Build GOSS"
- Run → Start Debugging (F5) to run with debugger
- Set breakpoints by clicking left margin of code lines
- Press F5 to start debugging
- Use Debug Console for runtime inspection
- Command Palette → Java: Run Tests
- Or use Tasks: Run Task → "Run Tests"
- View results in Test Explorer panel
-
Create Handler Class
@Component public class MyRequestHandler implements RequestHandler { @Override public Response handle(Request request) { // Handle your request type return new MyResponse(); } @Override public Class<? extends Request> getHandledRequestType() { return MyRequest.class; } }
-
Register with OSGi
- The
@Componentannotation automatically registers the service - No additional configuration needed with OSGi DS
- The
-
Create Authorization Handler
@Component public class MyAuthorizationHandler implements AuthorizationHandler { @Override public boolean isAuthorized(Request request, String username) { // Your authorization logic return true; } }
-
Creating a Client
ClientFactory clientFactory = // injected via OSGi Client client = clientFactory.create("tcp://localhost:61617", "username", "password"); // Send request Response response = client.getResponse(new MyRequest());
# Check current Java version
java -version
# Set JAVA_HOME (Linux/macOS)
export JAVA_HOME=/path/to/java-21
# Set JAVA_HOME (Windows)
set JAVA_HOME=C:\path\to\java-21# Clean build
./gradlew clean build
# Refresh dependencies
./gradlew --refresh-dependencies build- Check
.bndfiles for correct package exports - Verify OSGi annotations are present (
@Component,@Reference) - Look at
generated/directories for built bundles
- Verify IDE is using Java 21 for compilation
- Check project compiler compliance level
- Refresh/reimport the project
- Check Logs: Look in
logs/directory for error messages - Enable Debug Logging: Add
-Djava.util.logging.level=FINEto VM args - OSGi Console: Use Felix Gogo shell commands when running OSGi version
After setting up your development environment:
- Run the Integration Tests:
./gradlew check - Start the Simple Runner: Run
GossSimpleRunnermain class - Explore the Core API: Look at classes in
pnnl.goss.corepackage - Create Your First Handler: Follow the handler creation examples above
For production deployment, see PRODUCTION-DEPLOYMENT.md.