Installation
Get Sproogy up and running in your Java project.
Prerequisites
Before installing Sproogy, ensure you have:
- Java 11 or higher (Sproogy is built on modern Java)
- Gradle or Maven (for dependency management)
- IDE (IntelliJ IDEA, Eclipse, or VS Code recommended)
Check your Java version:
java -version
# Should show 11.0 or higher
Installation Methods
Method 1: Maven Local (Current)
Currently, Sproogy is published to Maven Local. This is the recommended method for development.
Step 1: Clone and Publish Sproogy
# Clone the Sproogy repository
git clone https://gitlab.pikudev.cloud/sproogy/sproogy.git
cd sproogy
# Publish to Maven Local
./gradlew publishToMavenLocal
This installs Sproogy modules to your local Maven repository (~/.m2/repository).
Step 2: Add Dependencies to Your Project
For Gradle (build.gradle):
plugins {
id 'java'
}
group = 'com.example'
version = '1.0.0'
sourceCompatibility = '11'
targetCompatibility = '11'
repositories {
mavenCentral()
mavenLocal() // Important: Enable Maven Local
}
dependencies {
// Sproogy Core (Required)
implementation 'com.sproogy:core:1.0.0'
// Sproogy Socket Server (Optional)
implementation 'com.sproogy:socket-server:1.0.0'
// Sproogy Socket Client (Optional)
implementation 'com.sproogy:socket-client:1.0.0'
// Sproogy Socket Common (Required if using socket modules)
implementation 'com.sproogy:socket-common:1.0.0'
// Sproogy JPA (Optional)
implementation 'com.sproogy:jpa:1.0.0'
// Additional dependencies
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation 'io.github.cdimascio:dotenv-java:3.0.0'
// JPA dependencies (if using Sproogy JPA)
implementation 'org.hibernate:hibernate-core:5.6.15.Final'
implementation 'mysql:mysql-connector-java:8.0.33' // Or your DB driver
// Logging
implementation 'org.slf4j:slf4j-simple:2.0.7'
}
For Maven (pom.xml):
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-sproogy-app</artifactId>
<version>1.0.0</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<sproogy.version>1.0.0</sproogy.version>
</properties>
<dependencies>
<!-- Sproogy Core (Required) -->
<dependency>
<groupId>com.sproogy</groupId>
<artifactId>core</artifactId>
<version>${sproogy.version}</version>
</dependency>
<!-- Sproogy Socket Server (Optional) -->
<dependency>
<groupId>com.sproogy</groupId>
<artifactId>socket-server</artifactId>
<version>${sproogy.version}</version>
</dependency>
<!-- Sproogy Socket Client (Optional) -->
<dependency>
<groupId>com.sproogy</groupId>
<artifactId>socket-client</artifactId>
<version>${sproogy.version}</version>
</dependency>
<!-- Sproogy Socket Common (Required if using socket modules) -->
<dependency>
<groupId>com.sproogy</groupId>
<artifactId>socket-common</artifactId>
<version>${sproogy.version}</version>
</dependency>
<!-- Sproogy JPA (Optional) -->
<dependency>
<groupId>com.sproogy</groupId>
<artifactId>jpa</artifactId>
<version>${sproogy.version}</version>
</dependency>
<!-- Additional dependencies -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>dotenv-java</artifactId>
<version>3.0.0</version>
</dependency>
<!-- JPA dependencies (if using Sproogy JPA) -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.6.15.Final</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.7</version>
</dependency>
</dependencies>
</project>
Method 2: Maven Central (Future)
Sproogy will be published to Maven Central in a future release, making installation simpler.
Module Overview
Sproogy is modular. Choose only the modules you need:
| Module | Artifact ID | Purpose | When to Use |
|---|---|---|---|
| Core | core | IoC/DI container, lifecycle management | Always (required) |
| Socket Common | socket-common | Request/Response models | If using socket server or client |
| Socket Server | socket-server | SSL socket server, routing, filters | If building a socket server |
| Socket Client | socket-client | SSL socket client, SocketTemplate | If building a socket client |
| JPA | jpa | JPA repository support, Hibernate integration | If using database access |
Minimal setup (no sockets, no JPA):
dependencies {
implementation 'com.sproogy:core:1.0.0'
}
Socket server setup:
dependencies {
implementation 'com.sproogy:core:1.0.0'
implementation 'com.sproogy:socket-common:1.0.0'
implementation 'com.sproogy:socket-server:1.0.0'
}
Full-stack setup (server + JPA):
dependencies {
implementation 'com.sproogy:core:1.0.0'
implementation 'com.sproogy:socket-common:1.0.0'
implementation 'com.sproogy:socket-server:1.0.0'
implementation 'com.sproogy:jpa:1.0.0'
implementation 'org.hibernate:hibernate-core:5.6.15.Final'
implementation 'mysql:mysql-connector-java:8.0.33'
}
Project Structure
Create the following directory structure:
my-sproogy-app/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── example/
│ │ │ ├── Main.java
│ │ │ ├── controller/
│ │ │ ├── service/
│ │ │ └── repository/
│ │ └── resources/
│ │ ├── application.yml
│ │ └── keystore.jks (if using SSL)
│ └── test/
│ └── java/
├── .env
├── build.gradle (or pom.xml)
└── README.md
Verify Installation
Create a minimal Sproogy application to verify installation:
Main.java:
package com.example;
import com.sproogy.SproogyApp;
import com.sproogy.annotations.SproogyApplication;
@SproogyApplication(basePackage = "com.example")
public class Main {
public static void main(String[] args) {
SproogyApp.run(Main.class, args);
System.out.println("Sproogy application started successfully!");
}
}
Run the application:
./gradlew run
# Or: mvn exec:java
Expected output:
Sproogy application started successfully!
If you see this message, Sproogy is correctly installed! 🎉
Troubleshooting Installation
Issue: "Could not find com.sproogy:core:1.0.0"
Cause: Sproogy not published to Maven Local.
Solution:
cd /path/to/sproogy
./gradlew publishToMavenLocal
Ensure mavenLocal() is in your repositories block.
Issue: "Package com.sproogy does not exist"
Cause: Dependencies not downloaded or IDE not synced.
Solution:
- Gradle:
./gradlew build --refresh-dependencies - Maven:
mvn clean install - IntelliJ IDEA: File → Invalidate Caches / Restart
- Eclipse: Right-click project → Maven → Update Project
Issue: Java version incompatibility
Cause: Using Java 8 or older.
Solution:
# Check your Java version
java -version
# Install Java 11 or higher
# On Ubuntu/Debian:
sudo apt install openjdk-11-jdk
# On macOS (Homebrew):
brew install openjdk@11
# On Windows:
# Download from https://adoptium.net/
Update your IDE's JDK settings to use Java 11+.
Issue: "SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder"
Cause: Missing SLF4J implementation.
Solution: Add SLF4J Simple to your dependencies:
implementation 'org.slf4j:slf4j-simple:2.0.7'
Next Steps
Now that Sproogy is installed, create your first application:
Or jump straight to building a socket server:
Additional Resources
- Sproogy Source Code: https://gitlab.pikudev.cloud/sproogy/sproogy
- Gradle Documentation: https://docs.gradle.org/
- Maven Documentation: https://maven.apache.org/guides/
- Java Downloads: https://adoptium.net/