NAF Nuts Application Framework
An à-la-carte toolkit of reusable Java components.
Take what you need. Leave the rest. No lock-in.
@NApp
public class MyApp {
public static void main(String[] args) {
NApp.builder(args).run();
}
@NAppInstall public void install() {
NOut.println(NMsg.ofC("installing the %s app",NApplication.of().id()));
}
@NAppRun public void run() {
NCmdLine cmdLine = NApplication.of().cmdLine();
NRef<String> name = NRef.ofNull();
cmdLine.matcher()
.with("-n", "--name").matchEntry((v) -> name.set(v.stringValue()))
.requireAllDefaults();
NOut.println(NMsg.ofC("name=%s", name.get()));
}
}
Add NAF to your project
Each NAF component is independently selectable.
You don't need to add everything — just what you use.
<dependency>
<groupId>net.thevpc.nuts</groupId>
<artifactId>nuts</artifactId>
<version>0.8.9</version>
</dependency>
<dependency>
<groupId>net.thevpc.nuts</groupId>
<artifactId>nuts</artifactId>
<version>1.0.0</version>
</dependency>
<repositories>
<repository>
<id>thevpc</id>
<url>https://maven.thevpc.net</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
Stable 0.8.9 on Maven Central · Latest 1.0.0 on maven.thevpc.net
Four ways to use NAF
Zero-dependency lifecycle
Make your app nuts-aware with zero extra dependencies. Just handle --nuts-exec-mode=install|uninstall|update|auto-complete as args[0] and add <nuts.application>true</nuts.application> to your pom. Nothing else required.
À-la-carte toolkit
Pick individual NAF components — NPath for unified IO, NMsg for console output, NLog for logging, NExpr for expressions. Each is self-contained. Integrates cleanly with Spring, SLF4J, and whatever you already use.
Browse modules ↓Embed Nuts as a library
Use Nuts programmatically inside your app to install, resolve and run Maven artifacts at runtime. Full workspace and session API available for advanced integration scenarios.
Embedding guide →Contribute to Nuts
Nuts itself is built on NAF. Understanding NAF is the entry point for contributing to the Nuts codebase — architecture, module structure, build process and conventions all documented.
Contributing guide →Everything in NAF
A coherent set of components built with the same philosophy and patterns. Learn one, understand all.