Java Library

Needle

An ultra-lightweight dependency injection framework for Java, without the bloat.

Current version: v1.0.0

What is Needle?

Needle is our response to bloated dependency injection frameworks. It gives you exactly what you need for clean, modular Java applications, without the overhead.

Think of it as Spring, but lightweight and with a minimal learning curve - just simple annotations and automatic dependency resolution.

Simple to Use

Main.java

public class Main {
    public static void main(String[] args) {
        Needle init = Needle.init(Main.class);
    }
}
ExampleService.java

@Component
public class ExampleService {
    private String name;
}
SampleConfig.java

@Component
public class SampleConfig {
    @Component
    SampleComponent create() {
        return new SampleComponent();
    }
}
SampleService.java

@Getter
public class SampleService {
    
    private final SampleComponent sampleComponent;
    
    public SampleService(SampleComponent sampleComponent) {
        this.sampleComponent = sampleComponent;
    }
}

Key Features

LW
Lightweight

Minimal overhead, designed to be fast and efficient with no bloat.

AN
Annotation-based

Simple annotations to define components and dependencies.

AD
Auto-resolution

Automatically resolves and injects dependencies where needed.

IN
Integration

Seamlessly integrates with other frameworks and libraries.

Get Started

Add Needle to your Maven project:

<dependency>
    <groupId>dev.pixelib</groupId>
    <artifactId>needle</artifactId>
    <version>1.0.0</version>
</dependency>
For more details, check our documentation

Why We Built It

We built Needle because we wanted Spring-like dependency injection without the massive overhead and complexity. Java developers shouldn't need a heavyweight framework just for clean architecture.

Needle strips away everything unnecessary, leaving just what you need to create modular, testable, and maintainable Java applications.

D
M
Duco & Mats