Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ProjectUnified/CraftCommand/llms.txt

Use this file to discover all available pages before exploring further.

CraftCommand is split into focused modules that follow a consistent pattern: one annotations artifact that your source code compiles against, one runtime artifact that ships with your application, and one processor artifact that the Java compiler consumes during annotation processing to generate the platform-native wrapper classes. Because each module is versioned independently on Maven Central, the craftcommand-bom (Bill of Materials) is the recommended way to pin all modules to a single coherent release without repeating version numbers everywhere.

Using the BOM

Add the BOM as an import-scoped dependency in your project’s <dependencyManagement> block. After this, every craftcommand-* dependency you declare in <dependencies> can omit the <version> tag — Maven resolves it automatically from the BOM.
pom.xml
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.github.projectunified</groupId>
            <artifactId>craftcommand-bom</artifactId>
            <version>0.5.1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
All individual CraftCommand module versions are managed by the BOM. Do not specify <version> on modules like craftcommand-annotations or craftcommand-standalone-runtime once the BOM is imported — doing so overrides the BOM and may lead to version mismatches across modules.

Platform dependencies

Use these modules for any plain Java application (CLI tool, bot, service, etc.) with no Minecraft dependency.

Runtime dependencies

Add both artifacts to your <dependencies>. No version is needed when the BOM is imported.
pom.xml
<dependencies>
    <!-- Core annotations: @Command, @Subcommand, @Default, @Optional, etc. -->
    <dependency>
        <groupId>io.github.projectunified</groupId>
        <artifactId>craftcommand-annotations</artifactId>
    </dependency>

    <!-- Standalone runtime: StandaloneCommandManager, StandaloneCommand -->
    <dependency>
        <groupId>io.github.projectunified</groupId>
        <artifactId>craftcommand-standalone-runtime</artifactId>
    </dependency>
</dependencies>

Annotation processor

Register craftcommand-standalone-processor inside <annotationProcessorPaths> of the maven-compiler-plugin. The processor generates YourCommand_Standalone wrapper classes during compilation.
pom.xml
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <annotationProcessorPaths>
                    <path>
                        <groupId>io.github.projectunified</groupId>
                        <artifactId>craftcommand-standalone-processor</artifactId>
                        <version>0.5.1</version>
                    </path>
                </annotationProcessorPaths>
            </configuration>
        </plugin>
    </plugins>
</build>

Validation module (optional)

The validation module is a platform-independent add-on that works with any of the platforms above. It provides parameter-level annotations (@Min, @Max, @ValidateWith, etc.) that are woven into the generated wrapper classes at compile time, so violations are caught before your method body runs.

Dependency

pom.xml
<dependencies>
    <!-- Validation annotations: @Min, @Max, @ValidateWith, etc. -->
    <dependency>
        <groupId>io.github.projectunified</groupId>
        <artifactId>craftcommand-validation-annotations</artifactId>
    </dependency>
</dependencies>

Annotation processor path

Add craftcommand-validation-processor alongside your platform processor inside <annotationProcessorPaths>:
pom.xml
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <annotationProcessorPaths>
                    <!-- Your platform processor (standalone shown here) -->
                    <path>
                        <groupId>io.github.projectunified</groupId>
                        <artifactId>craftcommand-standalone-processor</artifactId>
                        <version>0.5.1</version>
                    </path>
                    <!-- Validation processor -->
                    <path>
                        <groupId>io.github.projectunified</groupId>
                        <artifactId>craftcommand-validation-processor</artifactId>
                        <version>0.5.1</version>
                    </path>
                </annotationProcessorPaths>
            </configuration>
        </plugin>
    </plugins>
</build>
Annotation processors must be declared inside <annotationProcessorPaths> in the maven-compiler-plugin configuration — not as regular <dependencies>. Adding a processor to <dependencies> alone will not cause it to run during compilation, and no wrapper classes will be generated.

Build docs developers (and LLMs) love