Documentation Index Fetch the complete documentation index at: https://docs.xreatlabs.space/llms.txt
Use this file to discover all available pages before exploring further.
Building from Source
Complete guide to building NexAuth from source code for development and contribution.
Prerequisites
Repository Setup
Clone Repository
Clone the NexAuth repository from GitHub. git clone https://github.com/XreatLabs/NexAuth.git
cd NexAuth
Choose Branch
Select the branch you want to build. # Development branch (latest features)
git checkout develop
# Stable release branch
git checkout main
# Specific version
git checkout tags/v1.0.0
Configure Build
Configure build properties if needed. # Edit build.gradle.kts or pom.xml
# Customize version, dependencies, etc.
Building with Gradle
Basic Build
# Build all modules
./gradlew build
# Build without tests
./gradlew build -x test
# Build specific module
./gradlew :Plugin:build
# Clean and build
./gradlew clean build
Build Outputs
Build artifacts are located in:
# Universal plugin (works on both Velocity and Paper/Purpur)
Plugin/build/libs/NexAuth.jar
# API jar
API/build/libs/NexAuth-API-x.x.x.jar
NexAuth produces a single universal JAR that works on both Velocity proxies and Paper/Purpur servers - no platform-specific builds needed.
Development Build
# Build with dependencies and sources
./gradlew build shadowJar
# Output includes:
# - Standard jar
# - Shadow jar (with dependencies)
# - Sources jar
# - Javadoc jar
Building with Maven
Basic Build
# Build all modules
mvn clean install
# Build without tests
mvn clean install -DskipTests
# Build specific module
mvn clean install -pl Plugin
# Package only
mvn clean package
Build Outputs
# Universal plugin (works on both Velocity and Paper/Purpur)
Plugin/target/NexAuth.jar
# API jar
API/target/NexAuth-API-x.x.x.jar
NexAuth produces a single universal JAR that works on both Velocity proxies and Paper/Purpur servers - no platform-specific builds needed.
IDE Setup
IntelliJ IDEA
Import Project
Open IntelliJ and select “Import Project” Choose the NexAuth directory
Select Build System
Choose Gradle or Maven as the build system Let IntelliJ auto-import dependencies
Configure SDK
Set Project SDK to Java 17+ Set Language Level to 17
Enable Annotation Processing
Settings → Build, Execution, Deployment → Compiler → Annotation Processors Enable “Enable annotation processing”
Run Configuration
Create run configurations for testing:
Velocity: Run Velocity proxy
Paper: Run Paper server
Tests: Run unit tests
VS Code
Install Extensions
Install these VS Code extensions:
Extension Pack for Java
Gradle for Java
Maven for Java
Code Spell Checker
Open Project
Open the NexAuth directory in VS Code
Import Build
VS Code will automatically detect Gradle/Maven and import dependencies
Configure Settings
Ensure Java 17+ is configured in settings.json
Testing
Unit Tests
# Run all tests
./gradlew test
# Run specific test class
./gradlew test --tests "com.nexauth.AuthTest"
# Run with coverage
./gradlew test jacocoTestReport
Integration Tests
# Run integration tests
./gradlew integrationTest
# Run specific integration test
./gradlew integrationTest --tests "com.nexauth.DatabaseIntegrationTest"
Test Database Setup
Configure test database in src/test/resources/test-config.conf:
database {
type="h2" # Use H2 for testing
path="mem:testdb"
}
Development Workflow
Making Changes
Create Feature Branch
git checkout -b feature/your-feature-name
Make Changes
Edit source files in your IDE Make sure to follow code style guidelines
Build and Test
# Build changes
./gradlew build
# Run tests
./gradlew test
Commit Changes
git add .
git commit -m "feat: add your feature description"
Push and PR
git push origin feature/your-feature-name
# Create Pull Request on GitHub
Debugging
Debug Server Startup
# Build with debug enabled
./gradlew build -Pdebug
# Run with debug logging
# Add -Dnexauth.debug=3 to server startup
Debug in IDE
Set breakpoints in your code
Start server in debug mode
Attach debugger to server process
Debug code execution
Continuous Integration
GitHub Actions
NexAuth uses GitHub Actions for CI/CD:
# .github/workflows/build.yml
name : Build
on : [ push , pull_request ]
jobs :
build :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v3
- name : Set up JDK 17
uses : actions/setup-java@v3
with :
java-version : '17'
- name : Build with Gradle
run : ./gradlew build
- name : Run tests
run : ./gradlew test
Local CI Testing
# Run CI pipeline locally
act push # Using act for local GitHub Actions
# Or run build script
./scripts/ci-build.sh
Release Building
Build Release Artifacts
# Build release version
./gradlew clean build release
# Generate release notes
./scripts/generate-release-notes.sh
# Create GitHub release
gh release create v1.0.0 \
Plugin/build/libs/ * .jar \
--notes-file RELEASE_NOTES.md
Version Management
# Update version in build files
./gradlew setVersion -PnewVersion=1.0.0
# Commit version change
git commit -am "chore: bump version to 1.0.0"
# Create version tag
git tag v1.0.0
git push origin v1.0.0
Troubleshooting
Build fails with dependency errors?
Solution: # Clean and rebuild
./gradlew clean build --refresh-dependencies
# Clear Gradle cache
rm -rf ~/.gradle/caches/
./gradlew build
Possible causes:
Database not configured
Port conflicts
Missing test resources
Solutions: # Use H2 for testing
# Configure in test-config.yml
# Run tests in order
./gradlew test --tests "*Test*"
# Check test logs
cat build/reports/tests/test/index.html
IDE can't find dependencies?
Solution: # Refresh Gradle project
./gradlew --refresh-dependencies
# Reimport project in IDE
# IntelliJ: File → Invalidate Caches → Invalidate and Restart
Best Practices
Next Steps
Contributing Guidelines Learn how to contribute to NexAuth development.