  A Bukkit/Spigot API to use the command UI introduced in Minecraft 1.13

![GitHub](https://img.shields.io/github/license/JorelAli/CommandAPI?style=flat-square)
![Maven Central](https://img.shields.io/maven-central/v/dev.jorel/commandapi?style=flat-square)
[![Join us on Discord](https://img.shields.io/discord/745416925924032523.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&style=flat-square)](https://discord.gg/G4SzSxZ)

[![CodeFactor](https://img.shields.io/codefactor/grade/github/JorelAli/CommandAPI/master?style=flat-square)](https://www.codefactor.io/repository/github/jorelali/commandapi)
![GitHub Workflow Status (master)](https://img.shields.io/github/actions/workflow/status/JorelAli/CommandAPI/build.yml?branch=master&style=flat-square)
![GitHub Workflow Status (dev/dev)](https://img.shields.io/github/actions/workflow/status/JorelAli/CommandAPI/build.yml?branch=dev/dev&label=dev%20build&style=flat-square)
![Spiget Download Size](https://img.shields.io/spiget/download-size/62353?style=flat-square)

![Spiget Downloads](https://img.shields.io/spiget/downloads/62353?label=Total%20Spigot%20Downloads&style=flat-square)
![GitHub all releases](https://img.shields.io/github/downloads/JorelAli/CommandAPI/total?label=Total%20GitHub%20Downloads&style=flat-square)
![Modrinth Downloads](https://img.shields.io/modrinth/dt/commandapi?label=Total%20Modrinth%20Downloads&style=flat-square)

**Support and Project Discussion**:

-  [Discord](https://discord.gg/G4SzSxZ)
-  [Spigot page](https://www.spigotmc.org/resources/commandapi.62353/)
-  [Modrinth page](https://modrinth.com/plugin/commandapi)
-  [Hangar page](https://hangar.papermc.io/Skepter/CommandAPI)

**Downloads & Documentation:**

-  [All downloads](https://github.com/JorelAli/CommandAPI/releases)
-  [Documentation (includes usage for server owners!)](https://www.jorel.dev/CommandAPI/)

**Other**

-  [Buy me a coffee](https://ko-fi.com/jorelali)

**Compatible Minecraft versions:**

The list of what version of the CommandAPI you'll need to run on a specific version of Minecraft is as follows:

| Minecraft version  | Compatible versions         | Latest compatible
version | Minimum Java
version required
to run latest version |
|--------------------|-----------------------------|------------------------------|-----------------------------------------------------------|
| **1.13.x**         | v1.0 - 5.12, 8.3.0  - 8.8.0 | 8.8.0                        | 16                                                        |
| **1.14.1, 1.14.2** | v2.0 - 5.12, 8.3.0  - 8.8.0 | 8.8.0                        | 16                                                        |
| **1.14.3, 1.14.4** | v2.1 - 5.12, 8.3.0  - 8.8.0 | 8.8.0                        | 16                                                        |
| **1.15.x**         | v2.3a - 5.12, 8.3.0 - 9.3.0 | 9.3.0                        | 16                                                        |
| **1.16.1**         | v3.0 - 5.12, 8.3.0  - 9.4.2 | 9.4.2                        | 16                                                        |
| **1.16.2**         | v4.0 - 5.12, 8.3.0  - 9.4.2 | 9.4.2                        | 16                                                        |
| **1.16.3**         | v4.2 - 5.12, 8.3.0  - 9.4.2 | 9.4.2                        | 16                                                        |
| **1.16.4**         | v5.2 - 5.12, 8.3.0  - 9.4.2 | 9.4.2                        | 16                                                        |
| **1.16.5**         | v5.7 - 7.0.0, 8.3.0 - 9.5.1 | 9.5.1                        | 16                                                        |
| **1.17**           | 6.0.x - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.17.1**         | 6.1.x - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.18, 1.18.1**   | 6.5.2 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.18.2**         | 6.5.4 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.19**           | 8.3.0 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.19.1**         | 8.5.0 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.19.2**         | 8.5.1 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.19.3**         | 8.7.0 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.19.4**         | 8.8.0 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.20**           | 9.0.2 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.20.1**         | 9.0.3 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.20.2**         | 9.2.0 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.20.3, 1.20.4** | 9.3.0 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.20.5, 1.20.6** | 9.4.0 - 9.5.1               | 9.5.1                        | 16                                                        |
| **1.21**           | 9.5.0 - 9.5.1               | 9.5.1                        | 16                                                        |

-----

## Purpose

This project provides an API to help Bukkit/Spigot developers use the Minecraft 1.13 command UI, which includes:

- **Better commands** - Prevent players from running invalid commands, making it easier for developers - you won't get dodgy input!

  ![better commands](./images/printnumber.gif)

- **Better arguments** - Choose from over 50 arguments including location arguments, raw JSON, enchantments, lists, particles... all fully supported with built-in error checking!

  ![better arguments](./images/explode.gif)

- **Support for proxied command senders** - Run your command as other entities using `/execute as ... run command`

  ![proxied senders](./images/selfdestruct.gif)

- **Argument tooltips** - Let your users know exactly what their command will do using argument tooltips

  ![argument tooltips](./docssrc/src/images/warps.gif)

- **Support for the `/execute` command** - Let your command to be executed by the built in `/execute` command, as well as command blocks!

- **Support for Minecraft's functions** - Allow your command to be executed from Minecraft's functions and tags

- **No plugin.yml registration** - Commands don't need to be registered in the `plugin.yml` file anymore

- **No need for Brigadier** - You don't need to import Brigadier in your projects to use the CommandAPI

- **No tracking** - The CommandAPI doesn't collect any stats about its plugin; what you see is what you get!

Still not convinced? In addition to all of the above, the CommandAPI also provides:

- **Built-in command converter** - Convert other plugin commands into `/execute`-compatible ones - no code required!
- **Tree-structure command registration** - Like Brigadier's code format? We've got you covered with `CommandTree`
- **Kotlin DSL** - Prefer writing plugins in Kotlin? The CommandAPI has an optional Kotlin DSL just for you
- **Powerful suggestion generation** - Generate new suggestions for each argument, or add to existing suggestions
- **Safe suggestion generation** - The CommandAPI offers compile-time type safety for specific arguments
- **Precise permission support** - Apply permissions to specific arguments - you need perms to even _see_ the argument
- **Fast updates** - Consistently supports new Minecraft versions within a week of their release
- [**Insanely detailed documentation**](https://www.jorel.dev/CommandAPI/) - Trust me, you've never seen a plugin documentation look so good.

-----

## Code examples

    Simple command registration

```java
new CommandAPICommand("enchantitem")
    .withArguments(new EnchantmentArgument("enchantment"))
    .withArguments(new IntegerArgument("level", 1, 5))
    .executesPlayer((player, args) -> {
        Enchantment enchantment = (Enchantment) args.get("enchantment");
        int level = (int) args.get("level");

        //Add the enchantment
        player.getInventory().getItemInMainHand().addEnchantment(enchantment, level);
    })
    .register();
```

    Potion removing, suggesting potions that a player has currently

```java
List<Argument<?>> arguments = new ArrayList<>();
arguments.add(new EntitySelectorArgument.OnePlayer("target"));
arguments.add(new PotionEffectArgument("potioneffect").replaceSafeSuggestions(SafeSuggestions.suggest(info -> {
    Player target = (Player) info.previousArgs().get("target");

    //Convert PotionEffect[] into PotionEffectType[]
    return target.getActivePotionEffects().stream()
            .map(PotionEffect::getType)
            .toList().toArray(new PotionEffectType[0]);
})));

new CommandAPICommand("removeeffect")
    .withArguments(arguments)
    .executesPlayer((sender, args) -> {
        Player player = (Player) args.get("target");
        PotionEffectType effect = (PotionEffectType) args.get("potioneffect");
        player.removePotionEffect(effect);
    })
    .register();
```

    Subcommands

```java
new CommandAPICommand("perm")
    .withSubcommand(new CommandAPICommand("group")
        .withSubcommand(new CommandAPICommand("add")
            .withArguments(new StringArgument("permission"))
            .withArguments(new StringArgument("groupName"))
            .executes((sender, args) -> {
                //perm group add code
            })
        )
        .withSubcommand(new CommandAPICommand("remove")
            .withArguments(new StringArgument("permission"))
            .withArguments(new StringArgument("groupName"))
            .executes((sender, args) -> {
                //perm group remove code
            })
        )
    )
    .withSubcommand(new CommandAPICommand("user")
        .withSubcommand(new CommandAPICommand("add")
            .withArguments(new StringArgument("permission"))
            .withArguments(new StringArgument("userName"))
            .executes((sender, args) -> {
                //perm user add code
            })
        )
        .withSubcommand(new CommandAPICommand("remove")
            .withArguments(new StringArgument("permission"))
            .withArguments(new StringArgument("userName"))
            .executes((sender, args) -> {
                //perm user remove code
            })
        )
    )
    .register();
```

    Command trees

```java
new CommandTree("perm")
    .then(new MultiLiteralArgument("group", "user")
        .then(new MultiLiteralArgument("add", "remove")
            .then(new StringArgument("permission")
                .then(new StringArgument("groupName")
                    .executes((sender, args) -> {
                        // args = ["group" or "user", "add" or "remove", permission, groupName]
                    })
                )
            )
        )
    )
    .register();
```

    Annotation-based commands

```java
@Command("warp")
public class WarpCommand {

    // List of warp names and their locations
    static Map<String, Location> warps = new HashMap<>();

    @Default
    public static void warp(CommandSender sender) {
        sender.sendMessage("--- Warp help ---");
        sender.sendMessage("/warp - Show this help");
        sender.sendMessage("/warp <warp> - Teleport to <warp>");
        sender.sendMessage("/warp create <warpname> - Creates a warp at your current location");
    }

    @Default
    public static void warp(Player player, @AStringArgument String warpName) {
        player.teleport(warps.get(warpName));
    }

    @Subcommand("create")
    @Permission("warps.create")
    public static void createWarp(Player player, @AStringArgument String warpName) {
        warps.put(warpName, player.getLocation());
    }

}
```

    Kotlin DSL

    CommandAPICommand

```kotlin
commandAPICommand("mute") {
    playerArgument("target")
    integerArgument("duration")
    playerExecutor { player, args ->
        val target: Player = args["target"]!!
        val duration: Int = args["duration"]!!
        // Implementation...
    }
}
```

    CommandTree

```kotlin
commandTree("mute") {
    playerArgument("target") {
        integerArgument("duration") {
            playerExecutor { player, args ->
                val target: Player = args["target"]!!
                val duration: Int = args["duration"]!!
            }
        }
        playerExecutor { player, args ->
            val target: Player = args["target"]!!
            // Some default duration
            // Implementation...
        }
    }
}
```

    Command conversion (no compilation required)

```yml
plugins-to-convert:
  - Essentials:
    - speed <speed>[0..10]
    - speed <target>[minecraft:game_profile]
    - speed (walk|fly) <speed>[0..10]
    - speed (walk|fly) <speed>[0..10] <target>[minecraft:game_profile]
```

-----

## Building the CommandAPI

The CommandAPI is built using the Maven build tool - if you don't have it, you can download it [here](https://maven.apache.org/download.cgi).

- Clone the repository using your preferred method, or with the command below:

  ```bash
  git clone https://github.com/JorelAli/CommandAPI.git
  ```

- Run `mvn clean install -P Platform.Bukkit`

The resulting plugin `.jar` is found in `commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin/target/CommandAPI-X.X.X_DATE.jar`

## Building the CommandAPI's documentation

The CommandAPI's documentation is built using a custom version of [mdBook](https://rust-lang.github.io/mdBook/), a command line tool to create "books" with Markdown. This custom version can be found [in my mdBook fork](https://github.com/JorelAli/mdBook/releases).

- (Optional): Build the CommandAPI first, using the instructions above. The documentation pulls information directly from tests in the source code, so it assumes that those tests compile correctly!

- Get a copy of mdbook fork executable.
  - On Windows, download `mdbook-fa5.exe` from the [mdBook FA5 support](https://github.com/JorelAli/mdBook/releases/tag/v0.4.9) release
  - On Linux:
    - Clone my [mdBook fork](https://github.com/JorelAli/mdBook) using your preferred method, or with the command below:

      ```bash
      git clone https://github.com/JorelAli/mdBook.git
      ```

    - Use git to checkout to the `fa5` branch, using the following command:

      ```bash
      git checkout fa5
      ```

    - Build the executable with `cargo` (can be installed using `sudo apt-get install cargo` on Ubuntu distros), using the following command:

      ```bash
      cargo build
      ```

    - Grab the executable `mdbook` from `mdBook/target/debug/`

- Navigate to the `docssrc` folder

- Run `mdbook-fa5.exe build` (or `mdbook build` on Linux)

The resulting compiled documentation is found in `docs/X.X.X`, where `X.X.X` is specified in the `book.toml` file's `build-dir` in the `docssrc` folder.

-----

## CommandAPI Project Timeline

This is the current roadmap for the CommandAPI (as of 30th April 2024):

- **10.0.0:**

  **Annotation improvements**

  The CommandAPI's annotation system has always been a bit limited and was primarily introduced as a proof-of-concept. In this update, the CommandAPI's annotation system will be improved to be (ideally) as powerful as the non-annotation system and have slightly better type safety, support for non-static methods and better checks to prevent invalid command generation. More information about annotations can be found in the [Annotation specification document ](./annotations_spec_doc.md).

- **Future:**

  **Velocity support**

  Velocity support has been greatly anticipated by a large number of developers and we're hoping to bring Velocity support to you at some point in the future!

  **Argument conflict detection**

  The CommandAPI simply uses the Brigadier system under the hood. This system is prone to _argument conflicts_, which is where certain arguments are given priority over other arguments. (For example "hello" and "123" are both valid string arguments, but if you have a command that has a string argument or an integer argument, Brigadier may ignore the integer argument). In this update, the CommandAPI will try to spot potential conflicts and add a warning in the console.

  **'True' custom arguments and server-side argument implementations**

  Through some brief testing of the [regex-mod branch](https://github.com/JorelAli/CommandAPI/tree/dev/regex-mod) and my [MinecraftRegexArgumentMod](https://github.com/JorelAli/MinecraftRegexArgumentMod) repository, it was discovered that 'true' custom arguments (arguments with a custom implementation of the returned type and parser) are possible with the aid of a client-sided mod. Additionally, this functionality also works _without_ a client-sided mod, assuming this is only used server-side. This can be useful for server-only datapacks, functions and tags, as well as command blocks. It is possible that this may lead into being ported to Fabric, but there are no concrete plans to do so as of now.

-----

## Changelog

            Version
            Date
            Features / Changes

            9.5.1
            June 2024

Fixes the CommandAPI not loading properly on Paper 1.21

            9.5.0
            June 2024

Adds support for Minecraft 1.21

Drops support for Minecraft 1.16.1, 1.16.2, 1.16.3 and 1.16.4

Fixes ResourceLocationArgument not working in 1.20.5 and 1.20.6

Fixes /minecraft:reload deleting commands on Paper 1.20.6 (build 65+)

            9.4.2
            May 2024

https://github.com/JorelAli/CommandAPI/pull/555 Hotfix CommandAPI not loading correctly on Paper 1.20.6 build 65+ servers

            9.4.1
            May 2024

                CommandAPI Changes:

https://github.com/JorelAli/CommandAPI/issues/551 Fixes mojang-mapped versions of the CommandAPI causing errors in certain Minecraft versions

https://github.com/JorelAli/CommandAPI/issues/552 Adds a configuration option to disable datapack reloading on server load

            9.4.0
            April 2024

                CommandAPI Changes:

https://github.com/JorelAli/CommandAPI/issues/495 Adds a parameter to EntitySelectorArgument to allow failure when no entity lists are empty

https://github.com/JorelAli/CommandAPI/issues/367, https://github.com/JorelAli/CommandAPI/pull/509 Adds the ability to register commands with a custom namespace

https://github.com/JorelAli/CommandAPI/pull/523 Exposed more details of the CommandPermission

https://github.com/JorelAli/CommandAPI/issues/536, https://github.com/JorelAli/CommandAPI/pull/537 Fixes MultiLiteralArgument help displaying the node name instead of the literal text

Fixed implementation issues with FunctionArgument

https://github.com/JorelAli/CommandAPI/issues/490 Adds (experimental) support for Mojang-mapped servers via the CommandAPI config

https://github.com/JorelAli/CommandAPI/issues/524 Fixes CommandAPIBukkit.get().getTags() erroring in 1.20.4

https://github.com/JorelAli/CommandAPI/pull/540 Add methods to "safe-cast" arguments to CommandArguments

https://github.com/JorelAli/CommandAPI/pull/541 Adds support for a NamespacedKey variant for the PotionEffectArgument

                Minecraft Version Changes:

Drops support for version 1.15.x

Adds support for version 1.20.5

Adds support for version 1.20.6

            9.3.0
            December 2023

                ⚠ This version has limited support for the FunctionArgument! (See documentation for more information)

Adds support for Minecraft 1.20.3 and 1.20.4

Fixed bug where calling SimpleFunctionWrapper.getTag() on 1.19+ would throw an error

https://github.com/JorelAli/CommandAPI/pull/499 Fix typo in Adventure methods for tooltips

Adds ExecutionInfo executors for the Kotlin DSL

https://github.com/JorelAli/CommandAPI/issues/497 Adds support for RemoteConsoleCommandSender

Fixed executesFeedbackForwarding() not checking for a FeedbackForwardingCommandSender correctly thus allowing every executor to execute the command

https://github.com/JorelAli/CommandAPI/issues/473 Fix RGB colors in CustomArgument.CustomArgumentException#fromString creating the wrong colors

            9.2.0
            September 2023

https://github.com/JorelAli/CommandAPI/issues/487 Added support for disabling integer centering for location arguments

https://github.com/JorelAli/CommandAPI/issues/488 Fixed calling CommandAPI commands with Bukkit.createCommandSender() not working on paper

https://github.com/JorelAli/CommandAPI/pull/482 Adds Kotlin DSL support for delegated properties

Fixed a bug where the CommandAPI would throw errors when unregistering commands when a command exists with a : at the end of its name

            9.1.0
            August 2023

Fixed the CommandAPI disabling datapacks on Paper 1.20.1 #40+ because it thought it was running on a Folia server

https://github.com/JorelAli/CommandAPI/pull/459 Added the ability to access raw arguments in the command executor

https://github.com/JorelAli/CommandAPI/issues/469 Adds AdventureChatColorArgument

https://github.com/JorelAli/CommandAPI/pull/417 Added the ability for commands to be registered and unregistered while the server is running

            9.0.3
            June 2023

                        https://github.com/JorelAli/CommandAPI/pull/455 Reworked the MapArgument with various features, including:

Optional quotes around keys and values

No restriction on the characters that are allowed in a key (previously only letters, digits, and underscore)

May define a String separator between key-value pairs (instead of just space)

Fixed use-latest-nms-version not pointing to 1.20

Adds support for Minecraft 1.20.1

            9.0.2
            June 2023

                CommandAPI changes:

Add the ability to retrieve LiteralArguments and MultiLiteralArguments by their node names

https://github.com/JorelAli/CommandAPI/issues/363 Adds withUsage() method to customise command usage info

https://github.com/JorelAli/CommandAPI/issues/371 Updates default short description to now mention the plugin creating the command

Fixed literal arguments in command conversion causing errors due to parsing problems

Adds support for Minecraft 1.20

                Other changes:

Update the look-and-feel of the CommandAPI website

Update the look-and-feel of the CommandAPI JavaDocs

Fix various classes in the CommandAPI JavaDocs not having their methods declared

            9.0.1
            May 2023

Fixed MapArgument not always allowing player names as keys

Fixed /execute as ... not working due to casting to a player instead of a proxied sender

https://github.com/JorelAli/CommandAPI/pull/441 Added CommandArguments#count() utility method

https://github.com/JorelAli/CommandAPI/issues/440 Added several CommandArguments#getOptional() methods

Fixed bug where IntegerArgument would fail to compile due to a missing Brigadier dependency

Added basic support for Folia

Added support for the CustomArgumentException to accept Adventure and Spigot text components

            9.0.0
            April 2023

                ⚠ This version is incompatible with any plugin that used the CommandAPI version 8.X.X or below! (See documentation for more information)

                New features:

https://github.com/JorelAli/CommandAPI/issues/360, https://github.com/JorelAli/CommandAPI/pull/369 Made executor methods now use CommandArguments to allow for accessing arguments by name instead of index

https://github.com/JorelAli/CommandAPI/issues/162, https://github.com/JorelAli/CommandAPI/issues/387, https://github.com/JorelAli/CommandAPI/pull/393 Added optional arguments

https://github.com/JorelAli/CommandAPI/pull/388 Added new hook-paper-reload config option to toggle whether the CommandAPI hooks into /minecraft:reload

https://github.com/JorelAli/CommandAPI/issues/399, https://github.com/JorelAli/CommandAPI/pull/418 Added a MapArgument

Reworked the implementation of ItemArgument, so the ItemStack count is correctly reflected and ItemMeta is properly assigned

Made the TeamArgument return a Team instead of a String

Made the ObjectiveArgument return a Objective instead of a String

https://github.com/JorelAli/CommandAPI/pull/391 Made the CommandAPI only complain about commands registered in a plugin.yml if this plugin.yml belongs to the plugin calling the CommandAPI

https://github.com/JorelAli/CommandAPI/issues/422 Added a way to access the raw command a player typed from the executor

https://github.com/JorelAli/CommandAPI/issues/431 Added a way to access more info to construct lists for the ListArgumentBuilder

Added support for sidebar team colors using an enum for ScoreboardSlot

                Kotlin DSL changes:

Implemented resulting executors

Implemented the FunctionArgument

Several improvements for the CommandAPICommand DSL

                Bug fixes:

Fixed commandapi-preprocessor appearing in the plugin and shaded jar file

https://github.com/JorelAli/CommandAPI/issues/390 Fixed .executesNative()'s CommandSender's getLocation() method returning the wrong pitch and yaw

Fixed tags showing up in the BiomeArgument when they shouldn't have been doing so

Fixed LocationArgument with BLOCK_POSITION not returning locations in unloaded chunks

                Testing and validation:

Created the testing matrix to perform multi-Minecraft-version testing

                    Bugs found (and fixed) as a result of the testing matrix:

Fixed IntegerRangeArgument and FloatRangeArgument not working on Minecraft 1.16.4 and 1.16.5

Fixed RecipeArgument not working on Minecraft 1.17

Fixed TeamArgument not working on Minecraft 1.17

Fixed AdventureChatArgument not working on Minecraft 1.17

Fixed commands with no executors not being caught by the CommandAPI

Fixed ParticleArgument producing "Invalid particle data type" warnings on Minecraft 1.16.5 and below

Fixed FunctionArgument not working on Minecraft 1.17.x and 1.18.x

Fixed NamespacedKeyArgument not working on Minecraft 1.18

Integrated the CommandAPI repository with SonarCloud to identify bugs and improve the internal code

                    Bugs found (and fixed) as a result of using SonarCloud:

Fixed the FunctionArgument not correctly retrieving datapack (function) tags in 1.17+

Added some code coverage reports to identify how well tested the CommandAPI is, and what code paths need attention to during development

                    Issues found (and fixed) as a result of using code coverage reports:

Removed some redundant vibration particle handling code that would never be run under any circumstances

                Documentation changes:

https://github.com/JorelAli/CommandAPI/issues/384 Fixed various particle data not being documented for the ParticleArgument documentation page

Fixed broken links in the documentation (using Michael-F-Bryan/mdbook-linkcheck)

Refactored documentation argument page names for consistency

Added Kotlin DSL examples

                Other changes:

Removed all previously deprecated constructors, classes and methods

Completely refactored the entire CommandAPI project to help support other platforms

Added a live dev build of the documentation at commandapi-live-docs.jorel.dev

Improved mobile support for the CommandAPI home page

Added the CommandAPI's Modrinth link to the CommandAPI home page

Dropped support for Minecraft 1.13 - 1.14.4. Please use an older version of the CommandAPI, or raise an issue on GitHub to bring back support for these versions

                GitHub Actions changes:

Fixed NodeJS 12 deprecation warnings

Added markdownlint to verify that the documentation adheres to suitable Markdown standards

Fixed building the CommandAPI example projects not failing if they failed to compile

Added the CommandAPI documentation to GitHub Actions

Added deployment of snapshot builds to GitHub Actions

            8.8.0
            March 2023

Adds support for Minecraft 1.19.4

            8.7.6
            February 2023

https://github.com/JorelAli/CommandAPI/issues/415 Fixed NullPointerException when the CommandAPI fixes permissions in its post-load step

            8.7.5
            February 2023

Fixed @AWorldArgument annotation not being handled by the annotation processor

            8.7.4
            January 2023

Fixed LootTableArgument (function, recipe, sound, advancement, biome and entities) in 1.17 - 1.19.3

            8.7.3
            January 2023

https://github.com/JorelAli/CommandAPI/issues/397 Fixed WorldArgument not working in 1.16.5

            8.7.2
            January 2023

Hotfixed issue where various arguments wouldn't work in 1.19.3 (function, recipe, sound, advancement, biome, entities, loot table)

Fixed issue where the WorldArgument wouldn't work in 1.19.3

            8.7.1
            December 2022

https://github.com/JorelAli/CommandAPI/issues/310 Hotfixed a null pointer exception with redirected commands

https://github.com/JorelAli/CommandAPI/issues/383 Fixed ParticleArgument not working in 1.19.3

Fixed EnchantmentArgument not working in 1.19.3

Fixed JavaDocs in IDEs not working when using commandapi-shade

Hotfixed permission check failing when permissions have been incorrectly initialized

            8.7.0
            December 2022

Note: This version is incompatible with any plugin that used the SoundArgument in version 8.6.0! (See documentation for more information)

Adds support for Minecraft 1.19.3

Deprecates Argument "type" constructors in favour of static inner classes

            8.6.0
            December 2022

https://github.com/JorelAli/CommandAPI/issues/307 Adds a CommandArgument to let users submit commands as an argument

https://github.com/JorelAli/CommandAPI/issues/330 Improve the documentation for disabling the CommandAPI gracefully with CommandAPI.onDisable()

https://github.com/JorelAli/CommandAPI/issues/334 Adds support for chat components in CommandAPI.fail()

https://github.com/JorelAli/CommandAPI/issues/338 Adds a way to clone a CommandAPICommand instance using instance.copy()

https://github.com/JorelAli/CommandAPI/issues/340 Adds Kotlin examples in the documentation

https://github.com/JorelAli/CommandAPI/issues/341 Fix incorrect code block in normal executors documentation page

https://github.com/JorelAli/CommandAPI/issues/351 Adds support for a ListArgument with the TextArgument backend, to allow inline lists

https://github.com/JorelAli/CommandAPI/issues/358 Adds a new WorldArgument argument that lets you get a list of Minecraft dimensions

Adds support for SoundArgument to return string-based sounds via the NamespacedKey

https://github.com/JorelAli/CommandAPI/pull/352 Adds some helper methods to the LiteralArgument to make it easier to use via a static import

https://github.com/JorelAli/CommandAPI/pull/357 Adds a Kotlin DSL to register commands in Kotlin!

            8.5.1
            August 2022

https://github.com/JorelAli/CommandAPI/issues/311 Fix packets with invalid signatures kicking the client when sending certain commands with a chat preview enabled argument

https://github.com/JorelAli/CommandAPI/issues/312 Safeguards against command paths with duplicate node names which could cause the client to crash

https://github.com/JorelAli/CommandAPI/issues/313 Fix subcommand information being overwritten after a command has been registered

https://github.com/JorelAli/CommandAPI/issues/314 Fix TimeArgument not working as intended

https://github.com/JorelAli/CommandAPI/issues/316 Fix server reloading on Spigot throwing asynchronous-related exceptions in the console

https://github.com/JorelAli/CommandAPI/issues/323 Fix NamespacedKeyArgument not working in 1.17

Fix various command issues with Minecraft versions before 1.19

Fix argument suggestions not working if a subcommand's node name is the same as the argument's node name

Improves the underlying implementation of chatcolor, enchantment and potion arguments in 1.17+

Improves NMS code sharing between 1.19, 1.19.1 and 1.19.2

Improves the implementation of the list argument to only display suggestions for the last item in the list and prevent unlisted items being entered

Adds support for Minecraft 1.19.2

            8.5.0
            July 2022

                Development improvements:

Improves the issue templates on GitHub for creating bug reports and feature requests

Adds a testing suite for the CommandAPI which can test for successful command registration and execution

Adds an example of shading the CommandAPI with Maven in examples/maven-shaded/

                Bug fixes:

Fixes suggestions not working in 1.16.5 and below due to Brigadier implementation versions

Fixes the CommandAPI allowing spaces in command names

Fixes datapack reloading on 1.17.1

                New features/improvements:

Adds support for Minecraft 1.19.1

Adds support for chat preview with ChatArgument and AdventureChatArgument

Adds a CommandAPI.onDisable() method to disable the CommandAPI gracefully

Adds Kotlin-DSL gradle to the documentation

Prevents the CommandAPI re-parsing previous arguments multiple times when running a command

Adds CommandAPI.isLoaded() to check if the CommandAPI is loaded

Shares NMS code for 1.13.x and 1.14.x, reducing the jar size

            8.4.1
            June 2022

Fix issue where converted commands would handle arguments incorrectly

Fix commandapi-annotations dependency depending on spigot instead of spigot-api

            8.4.0
            June 2022

                Jar minimization improvements:

Decouples CustomArgument from CommandAPIHandler

Decouples EntitySelector from EntitySelectorArgument

                NBT API Support:

Allow developers to shade their own copy of an NBT API framework (e.g. NBT API or PowerNBT)

Includes the NBT API built-in for plugin versions

                Other:

Implement base arguments for CustomArguments, allowing more powerful parsing

Implement common NMS code for 1.17+

Adds NamespacedKeyArgument

Adds support for shaded versions of the CommandAPI to create their own command_registration.json files for debugging

Fixes bug where WrapperCommandSyntaxException wouldn't work as intended

Adds support for /minecraft:reload on paper servers

Adds CommandAPI.getRegisteredCommands() to get a list of registered commands

            8.3.1
            June 2022

Fixes critical issue where non-Vanilla commands were not showing suggestions

            8.3.0
            June 2022

Change Java target version to Java 16 instead of Java 17

Adds support for old Minecraft versions (1.13 - 1.16.4) again

Adds support for Minecraft 1.19

            8.2.1
            June 2022

Adds a .withSubcommands() method to add multiple subcommands in one go

Exposed registeredCommands field in the CommandAPIHandler to get a list of registered commands

Fixed CommandAPI logging prefix twice in shaded versions of the CommandAPI

            8.2.0
            May 2022

Adds a list argument

Brings back support for Minecraft 1.16.5

Fixes documentation bug with multiple executor types

Fixes bug where suggestions wouldn't "filter" while being typed in chat

            8.1.0
            May 2022

Adds generic types to arguments to improve compile-time type checking

Fix particle data safe suggestions crashing the CommandAPI

Improves error logging of greedy string arguments

Fix bug with CommandPermission.OP throwing a null pointer exception

Prevent the CommandAPI crashing when shaded plugins don't call CommandAPI.onLoad()

Fix initialization of WrapperCommandSyntaxException bug

            8.0.0
            April 2022

Note: This version is incompatible with existing plugins that use the particle argument (See documentation for more information)

Improved support for particle arguments, now supporting particle data (e.g. color, size)

Dropped support for Minecraft 1.16.5

Adds an error message if the config.yml's plugins-to-convert option has an invalid type

Improve WrapperCommandSyntaxException to include passthrough methods to access the underlying exception

            7.0.0
            April 2022

                Development improvements:

Adds a GitHub action to build the CommandAPI (and share it's lovely artifacts)

Moves the Maven repo for 7.0.0 and future updates to Maven Central

                New features:

Adds support for using the same command executor for multiple command sender types

Makes the CommandAPI display a warning if it finds commands present in a plugin.yml file

Adds more helper methods to the Brigadier class

Adds a tree-like syntax for command declarations

Adds support for asynchronous suggestions

Rewrote how argument suggestions are declared, instead of lots of overloads, require a single object which encompasses the various different suggestion methods

                Other:

Fix transitive dependencies in the CommandAPI which caused various libraries to be exposed

Remove various deprecated safeOverrideSuggestions methods

Improve certain colors of elements in the CommandAPI's documentation so it's easier to read

Fix various broken links in the documentation

Changed CommandAPI.fail() so it doesn't automatically throw the exception it generates

            6.5.4
            March 2022

Support for Minecraft 1.18.2

Improve converted command support for /execute at and /execute positioned

            6.5.3
            December 2021

Support for Minecraft 1.18.1

            6.5.2
            December 2021

Fix Maven build script with 6.5.1, fixing broken CommandAPI annotation builds

            6.5.1
            December 2021

Fix Maven build script with 6.5.0, fixing broken CommandAPI shaded builds

            6.5.0
            December 2021

Adds support for Minecraft 1.18 (requires Java 17)

            6.4.0
            November 2021

Adds support for CommandAPI command help topics via /help

Improve CommandAPI initialization stability

(Hopefully) fix conflicting issues with duplicate Bukkit and CommandAPI command names

Code cleanup (fix a lot of minor warnings)

            6.3.1
            September 2021

Fixes issue with converted commands where executing as a player with lower permissions fails

Adds very limited support for plugin reloading by unregistering commands on disable

Fixes issue where converted commands with greedy string arguments would almost always fail

            6.3.0
            August 2021

Adds a new constructor to CustomArgument which takes in a record containing all inputs

Adds support for CustomArgument's parser to use previously declared arguments

            6.2.0
            July 2021

Adds config option to customize messages

Adds config option to use the latest NMS version

Update documentation instructions for shading with Maven

            6.1.0
            July 2021

Adds support for 1.17.1

            6.0.5
            June 2021

Fix issue where converted commands which didn't use entity selectors would always fail

            6.0.4
            June 2021

Fix issue where some multi literal arguments would be skipped, causing a crash

            6.0.3
            June 2021

Fix issue where custom CommandSender subclasses could not run CommandAPI commands

            6.0.2
            June 2021

Fix bug where multi literal arguments would crash due to poor array preservation

            6.0.1
            June 2021

Fix bug where the CommandAPI would crash if it tries to register duplicate permissions

            6.0.0
            June 2021

                Version support changes:

Adds support for Minecraft 1.17

Drops support for Minecraft 1.16.4 and below

Changes build version from Java 8 to Java 16

                Development improvements:

Switches version convention to use Semanic Versioning

Uses CodeFactor.io for code quality checking

                New features:

Adds OfflinePlayerArgument for offline players

Adds a way to add suggestions to existing vanilla suggestions

Adds a way to access the CommandSender for CustomArgument parsing

Adds support for Paper's console tab-completion

Adds a way to completely silence all CommandAPI logs

Adds access to the current input and current argument input for argument suggestions

Improve API for setting configuration for plugins that shade the CommandAPI

                Bug fixes:

Fixes bug with converted commands crashing due to poor interface proxying

Adds a way to access the CommandSender for CustomArgument parsing

Adds support for Paper's console tab-completion

Adds a way to completely silence all CommandAPI logs

Fix bugs where the NBTAPI wouldn't be hooked into properly

Fixes critical issue where converted commands with entity selectors may sometimes just not run

                Other:

Improves overall performance

Improves performance for the PotionArgument

Improves performance for the MathOperationArgument

Fixes spacing issues with code blocks in the documentation

Fixes invalid code examples in the documentation

Fixes typos in the documentation

Adds syntax highlighting for command code blocks in the documentation

            5.12
            May 2021

Moves the Maven repo for 5.12 and future updates to jitpack.io

Fixes issue with sound arguments on Minecraft 1.16.4 and 1.16.5

            5.11
            May 2021

Allows converted commands to use entity selectors in plugin commands

Allows arbitrary commands to be converted with the CommandAPI's converter system

            5.10
            May 2021

Adds support for Paper's Adventure API for ChatComponent and Chat arguments.

Deprecated a few methods in favour of some slightly better ones.

Update proxied sender for Spigot 1.16.5

            5.9
            February 2021

Fixed a critical bug where plugin conversion would run the caller methods instead of callee methods, which prevented command blocks from running commands.

            5.8
            January 2021

Removed a debug /test command which wasn't supposed to be released!

            5.7
            January 2021

Add support for Minecraft 1.16.5

            5.6
            January 2021

Fix bug where plugins that use Aikar's ACF were incompatible with the CommandAPI

Add a new configuration option skip-sender-proxy which prevents certain plugins from running properly

            5.5
            January 2021

Fix bug with annotations where @NeedsOp didn't work if placed on a class

Fix bug where entity selector arguments with @ selectors return empty values if the sender is not op

            5.4
            December 2020

Fix bug where the NBT-API wasn't compatible with the CommandAPI when both are shaded into a plugin

            5.3
            November 2020

Fix bug where permissions weren't being applied for subcommands and multi literal arguments

Adds detection system for command graph conflicts

Adds a way to "negate" permissions using .withoutPermission

Adds an annotation-based command framework

Fix minor documentation inaccuracies

Fix bug where converted commands didn't apply multiple parameters

The fields in CommandAPICommand can now be accessed via getters and setters

            5.2
            November 2020

Adds CommandAPI.reloadDatapacks() method to reload datapacks in the same way the CommandAPI does

Adds support for Minecraft 1.16.4

            5.1
            October 2020

Fixes bug where converted commands could not be executed by players ingame

Adds withPermission(String) to arguments and CommandAPICommands

Adds SimpleFunctionWrapper with helper methods to get functions and tags from ingame, as well as run them without needing to parse them via commands

Greatly improve the type-safety of the internal CommandAPI code

Move the Brigadier class outside of the CommandAPIHandler class

            5.0
            October 2020

Note: This version is incompatible with any plugin that used the CommandAPI version 4.3c or below! (See documentation for more information)

API improvements:

The .withArguments method can now take varargs

String tooltips are now much easier to implement for custom objects using IStringTooltip

Removes LinkedHashMap for argument registration in favour of List

Adds subcommands

Adds AngleArgument

Arguments can now be omitted from the Object[] args using the method .setListed(). This means Literal arguments can now be "present" in the arguments if desired.

Remove lots of reflection calls, so start up should be a little faster

Bug fixes:

Fixes bug where verbose logging of permission linking was inaccurate

Fixes bug where overriding suggestions can break when generating suggestions

Fixes bug where null could appear in the suggestions list of arguments

CommandAPI's non-verbose logging is now actually quiet

Fixes bug where converted commands couldn't be run from the console

Fixes bug where LongArgument wouldn't let you use long values as minimum or maximum

Command conversion improvements:

The Converter.convert() method can now take varargs for arguments

Command conversion code that was specific to the CommandAPI plugin is no longer included in the shaded version of the CommandAPI

Command conversion in the configuration for server owners can now let server owners apply their own command argument implementations!

Documentation improvements:

Documentation code examples are now guaranteed to compile

The list of CommandAPI arguments to Minecraft argument IDs is now in the documentation

CommandAPI-Brigadier improvements:

Adds toSuggestions() to the CommandAPI-Brigadier library to convert CommandAPI suggestions into Brigadier's SuggestionProvider

CommandAPI-Brigadier library methods got renamed

Changed the way literal arguments are constructed in the CommandAPI-Brigadier library - they are no longer unnecessarily registered into the command graph

            4.3c
            October 2020

Fixes bug where function loading would break because permissions could not be properly computed

            4.3b
            September 2020

Fixes minor command sender related bugs from 4.3a. Fixes permissions with /execute ... as ... from converted commands

            4.3a
            September 2020

Fixes a bug where running converted commands via /execute ... as ... wouldn't apply the command sender correctly

            4.3
            September 2020

Fix bug where resulting command executors with command block senders would not work

Improves the power of command conversion by letting you declare CommandAPICommand arguments for conversion

Adds support for YAML's "null" for command conversion via the config.yml file, which should be way more comprehensible rather than trailing colons

            4.2
            September 2020

Adds support for Minecraft 1.16.3

Fixes a bug where shading the CommandAPI and the NBT-API together causes the CommandAPI to incorrectly think that the NBT-API isn't present

Fixes a bug where commands with redirects (4.0+ aliases and redirects from /execute) that have two consecutive arguments with suggestions would spam the console and not provide suggestions

Adds NativeProxyCommandSender which lets you access the location and world of a command sender via /execute in|positioned|at|facing|rotated

            4.1
            September 2020

Allows the CommandAPI to be shaded into plugins

Adds a way to set hover tooltips for suggestions

Adds multi-literal arguments

Adds a logo!

Adds a new method to the CommandAPI/Brigadier system to easily create Brigadier arguments from CommandAPI arguments

Rename maven modules You can view more information about this on the public maven repository

            4.0
            August 2020

Suggestion overriding can now be populated by Bukkit objects instead of strings

Fixes a bug with the FloatRangeArgument where it caused a casting error

Adds support for 1.16.2

ChatArgument now works on Minecraft 1.16.2 (still doesn't work on 1.16.1)

Adds new arguments:

UUIDArgument

ItemStackPredicateArgument

BlockPredicateArgument

Fix bug where CustomArguments break when using the namespaced key flag

Adds a list of commands that FunctionWrapper executes which is now accessible

Command aliases are now much more efficient

Documentation changes (briefly):

BlockStateArgument is now documented properly

Documentation now has pictures to show you what arguments look like

Documentation now has a page dedicated to what doesn't work on what Minecraft version

Adds Brigadier support for developers (lets you use the CommandAPI and Brigadier code side by side!)

Fixes a bug where Java 12+ had incompatibility issues

Adds support for setting arbitrary requirements to arguments and commands

            3.4
            July 2020

Fix bug with custom recipes not registering in Minecraft 1.16+

Fix bug where command conversion didn't actually register commands

Adds command conversion as a built-in feature via the CommandAPI's config.yml

            3.3
            July 2020

Fixes a bug where functions didn't work in Minecraft 1.16+

Fixes a bug where spigot produces a warning about api-versions

            3.2
            July 2020

Fixes a bug with .overrideSuggestions() from version 3.1

            3.1
            July 2020

Fixes bug where command senders didn't work properly, causing commands to not work properly

Adds the ability to override suggestions with the information of previously declared argument

            3.0
            June 2020

Note: This version is incompatible with pre 3.0 versions CommandAPI plugins (See documentation for more information)

Complete code refactor to make command syntax slightly more intuitive and consistent

Removes lots of reflection to improve performance

Adds better documentation

Adds JavaDocs

Adds support for 1.16.1

Adds new command executors (These let you filter commands based on what type of command executor runs the command):

Player command executors

Command block command executors

Console command executors

Entity command executors

Proxied command executors

Adds new arguments:

Axis Argument

Biome Argument

ChatColor Argument

Chat Argument

FloatRange Argument

IntegerRange Argument

Location2D Argument

MathOperation Argument

NBT Argument (NBTAPI required)

Scoreboard arguments:

Objective Argument

ObjectiveCriteria Argument

ScoreboardSlot Argument

ScoreHolder Argument

Team Argument

Time Argument

Rotation Argument

Environment Argument

Removes old arguments:

SuggestedStringArgument

DynamicSuggestedStringArgument

DefinedCustomArguments

            2.3a
            December 2019

Adds support for Minecraft 1.15, 1.15.1 and 1.15.2

            2.3
            August 2019

Fixes bug where permissions didn't work

Fixes bug where functions weren't working on 1.14.3 and 1.14.4

            2.2
            July 2019

Adds support for Minecraft 1.13 and 1.13.1 (Funny isn't it? It's called the 1.13 CommandAPI but never supported Minecraft 1.13 until now)

Improves support for different versions

Adds pointless witty comments into changelog notes

Adds 1.13-Command-API-SafeReflection library to greatly improve reliability of reflection calls

            2.1
            July 2019

Adds RecipeArgument

Adds SoundArgument

Adds AdvancementArgument

Adds LootTableArgument

Adds support for 1.14.3 and 1.14.4

Fixes bug where aliases weren't registering properly (#43)

Fix documentation for tooltips

Improve documentation for dependencies and repositories

            2.0.1
            May 2019

Fix a bug where Brigadier was required as a dependency to build plugins

            2.0
            May 2019

Compatibility for 1.14

Major overhaul of the CommandAPI's internals - greatly improves performance

Deprecates SuggestedStringArgument, adding overrideSuggestions as an alternative for any argument type

Adds CustomArguments, allowing you to create your own ... custom arguments

Excludes dependencies from final jar (#40)

Adds DefinedCustomArguments - CustomArguments that have been created by yours truly

DynamicSuggestedArguments now have access to the CommandSender (#41)

Adds Loot Table support

            1.8.2
            January 2019

Fix bug with PlayerArgument when player cannot be found

Adds LocationArgument options for block precision or exact precision

            1.8.1
            December 2018

Fix permissions for argument from 1.8

Neaten up logging with verbose outputs

            1.8
            December 2018

Fix bugs where DynamicSuggestedArguments don't work as the last argument

Fix support for latest spigot version

Adds permissions for arguments

Adds support to override suggestions for arguments

            1.7.2
            December 2018

Fix a bug where default return value was 0 instead of 1, causing issues with commandblocks

            1.7.1
            December 2018

Fix a bug with permission checks. Other than that, it's the same as 1.7 (in terms of documentation)

            1.7
            December 2018

Adds DynamicSuggestedStringArguments for dynamically updating suggestions

Adds support for success and result values for /execute store

Overhaul permissions system so it works properly

Note: This version is incompatible with pre-1.7 version CommandAPI plugins

            1.6
            November 2018

Adds FunctionArguments to handle Minecraft functions

Remove useless test code

Fix bug with ProxiedCommandSender callee and caller

Adds Converter for legacy plugin support

Improved performance by caching NMS better than in version 1.5

            1.5
            October 2018

Adds ChatComponentArgument to handle raw JSON

Adds SuggestedStringArgument to suggest strings

Adds config file

Fix bug where command errors weren't being thrown

Improved performance by caching NMS

            1.4
            October 2018

Fix critical bug where arguments weren't being handled properly

Adds GreedyStringArgument

Adds various Exception classes

            1.3
            October 2018

Migrate to Maven

Remove unnecessary reflection

Adds EntitySelectorArgument

Adds LiteralArgument

Adds support for ProxiedCommandSender

            1.2
            August 2018

Adds TextArgument

            1.1
            August 2018

Adds PlayerArgument

Adds ParticleArgument

Adds ChatColorArgument

Adds EnchantmentArgument

Adds LocationArgument

Adds EntityTypeArgument

Adds permissions support

Adds alias support

            1.0
            August 2018

Initial release


GeckoLib is a powerful animation library for Minecraft Java Edition available for all major modloaders. Includes out-of-the-box support for easings, math-based animations, resource pack overloading, and animation stacking.

You can view installation instructions for modders here.

GeckoLib provides detailed documentation in the form of a wiki.
We spent many hours writing the wiki, so please read it!

If you have questions or need help getting up and running with questions, join our discord!

Pull requests are welcome. For significant changes, please open an issue first to discuss what you would like to change. If you would like to support GeckoLib, feel free to donate on Ko-fi.

Sponsored by BisectHosting

Need a server to play with friends? Don't know how to one up? Just rent an already configured server from BisectHosting!

Click on the picture above, select plan (at least 4GB), and use my code gecko to get 25% off your first month and enjoy playing with your friends!

Acknowledgements

YourKit supports open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of YourKit Java Profiler and YourKit .NET Profiler, innovative and intelligent tools for profiling Java and .NET applications.

Package repository hosting is graciously provided by Cloudsmith

Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that
enables your organization to create, store and share packages in any format, to any place, with total
confidence.


# Mystical Agriculture

Adds Resource Crops, Armor, Tools, and other cool things!

## Download

The official release builds can be downloaded from the following websites.

- [Blake's Mods](https://blakesmods.com/mystical-agriculture/download)
- [CurseForge](https://www.curseforge.com/minecraft/mc-mods/mystical-agriculture)
- [Modrinth](https://modrinth.com/mod/mystical-agriculture)

## Development

To use this mod in a development environment, you will need to add the following to your `build.gradle`.

```groovy
repositories {
    maven {
        url 'https://maven.blakesmods.com'
    }
}

dependencies {
    implementation fg.deobf('com.blakebr0.cucumber:Cucumber:<minecraft_version>-<mod_version>')
    implementation fg.deobf('com.blakebr0.mysticalagriculture:MysticalAgriculture:<minecraft_version>-<mod_version>')
}
```

## License

[MIT License](./LICENSE)


# Micronaut AWS

[![Maven Central](https://img.shields.io/maven-central/v/io.micronaut.aws/micronaut-aws-common.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.micronaut.aws%22%20AND%20a:%22micronaut-aws-common%22)
[![Build Status](https://github.com/micronaut-projects/micronaut-aws/workflows/Java%20CI/badge.svg)](https://github.com/micronaut-projects/micronaut-aws/actions)
[![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.micronaut.io/scans)

This project includes integration between [Micronaut](https://micronaut.io) and AWS.

## Examples

You can generate example applications at https://launch.micronaut.io:

* Lambda API Gateway - Select Application Type `Application` and the `aws-lambda` feature and generate!
* Alexa - Select Application Type `Application` and the `aws-alexa` feature and generate!
* Request Handler - Select Application Type  `Serverless Function` and the `aws-lambda` feature and generate!
* AWS Lambda Custom Runtime - Select Application Type `Application` and the `aws-custom-runtime` feature and generate!
* AWS Lambda GraalVM Native Custom Runtime - Select Application Type `Application` and the `aws-custom-runtime` and `graalvm` features and generate!

## Documentation

See the [Documentation](https://micronaut-projects.github.io/micronaut-aws/latest/guide) for more information.

See the [Snapshot Documentation](https://micronaut-projects.github.io/micronaut-aws/snapshot/guide) for the current development docs.

## Snapshots and Releases

Snaphots are automatically published to [JFrog OSS](https://oss.jfrog.org/artifactory/oss-snapshot-local/) using [Github Actions](https://github.com/micronaut-projects/micronaut-aws/actions).

See the documentation in the [Micronaut Docs](https://docs.micronaut.io/latest/guide/index.html#usingsnapshots) for how to configure your build to use snapshots.

Releases are published to JCenter and Maven Central via [Github Actions](https://github.com/micronaut-projects/micronaut-aws/actions).

A release is performed with the following steps:

- [Publish the draft release](https://github.com/micronaut-projects/micronaut-aws/releases). There should be already a draft release created, edit and publish it. The Git Tag should start with `v`. For example `v1.0.0`.
- [Monitor the Workflow](https://github.com/micronaut-projects/micronaut-aws/actions?query=workflow%3ARelease) to check it passed successfully.
- Celebrate!


[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)

# NO LONGER MAINTAINED

Since the launch of Kaia Blockchain this repository has been parked in favour of the new open-source projects in [Kaia's Github](https://github.com/kaiachain). Contributors have now moved there continuing with massive open-source contributions to our blockchain ecosystem. A big thank you to everyone who has contributed to this repository. For more information about Klaytn's chain merge with Finschia blockchain please refer to the launching of Kaia blockchain - [kaia.io](https://kaia.io/).

---

[![CircleCI](https://circleci.com/gh/klaytn/caver-java/tree/dev.svg?style=svg)](https://circleci.com/gh/klaytn/caver-java/tree/dev)
[![Gitter](https://badges.gitter.im/klaytn/Caver-java.svg)](https://gitter.im/klaytn/Caver-java?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

# caver-java: Caver Java Klaytn Dapp API

caver-java is a lightweight, high modular, convenient Java and Android library to interact with clients (nodes) on the Klaytn network:
This library is an interface which allows Java applications to easily communicate with [Klaytn](https://www.klaytn.com) network.

## Features
- Complete implementation of Klaytn’s JSON-RPC client API over HTTP and IPC
- Support of Klaytn transaction, account, and account key types
- Auto-generation of Java smart contract wrapper to deploy and execute a smart contract from native Java code
- Creation of a new wallet and managing Klaytn wallets
- Command line tools
- Android compatible

## Getting started

### Installation

#### add a Repository

To install caver-java, you should add a jitpack repository for IPFS feature.

**maven**
```groovy
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
```

**gradle**
```groovy
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
```
#### add a dependency

**maven**
```groovy
<dependency>
    <groupId>com.klaytn.caver</groupId>
    <artifactId>core</artifactId>
    <version>X.X.X</version>
</dependency>
```

**gradle**
```groovy
compile 'com.klaytn.caver:core:X.X.X'
```
If you want to use Android dependency, just append -android at the end of version. (e.g. 1.5.4-android)

You can find latest caver-java version at [release page](https://github.com/klaytn/caver-java/releases).

## Start a Client
If you want to run your own EN (Endpoint Node), see [EN Operation Guide](https://docs.klaytn.com/node/en) to set up.

```java
Caver caver = new Caver(Caver.DEFAULT_URL);
```

## Transactions
When you send transactions, `caver-java` provides easy-to-use wrapper classes.

Here's an example of transferring KLAY using keystore.json and `ValueTransfer` class:
```java
Caver caver = new Caver(Caver.DEFAULT_URL);

//Read keystore json file.
File file = new File("./keystore.json");

//Decrypt keystore.
ObjectMapper objectMapper = ObjectMapperFactory.getObjectMapper();
KeyStore keyStore = objectMapper.readValue(file, KeyStore.class);
AbstractKeyring keyring = KeyringFactory.decrypt(keyStore, "password");

//Add to caver wallet.
caver.wallet.add(keyring);

BigInteger value = new BigInteger(Utils.convertToPeb(BigDecimal.ONE, "KLAY"));

//Create a value transfer transaction
ValueTransfer valueTransfer = new ValueTransfer.Builder()
        .setKlaytnCall(caver.rpc.getKlay())
        .setFrom(keyring.getAddress())
        .setTo("0x8084fed6b1847448c24692470fc3b2ed87f9eb47")
        .setValue(value)
        .setGas(BigInteger.valueOf(25000))
        .build();

//Sign to the transaction
valueTransfer.sign(keyring);

//Send a transaction to the klaytn blockchain platform (Klaytn)
Bytes32 result = caver.rpc.klay.sendRawTransaction(valueTransfer.getRawTransaction()).send();
if(result.hasError()) {
    throw new RuntimeException(result.getError().getMessage());
}

//Check transaction receipt.
TransactionReceiptProcessor transactionReceiptProcessor = new PollingTransactionReceiptProcessor(caver, 1000, 15);
TransactionReceipt.TransactionReceiptData transactionReceipt = transactionReceiptProcessor.waitForTransactionReceipt(result.getResult());
```

If you have address and private key(s) of keyring, you can make keyring directly through [KeyringFactory.create](https://docs.klaytn.com/bapp/sdk/caver-java/getting-started#creating-a-keyring).

`<valueUnit>` means a unit of value that is used in Klaytn. It is defined as an enum type. Examples of possible values are as below.

```
PEB, KPEB, MPEB, GPEB, STON, UKLAY, MKLAY, KLAY, KKLAY, MKLAY, GKLAY
```

If `<valueUnit>` is not given as a parameter, default unit of `<value>` is `PEB`. You can use `Utils.convertToPeb` or `Utils.convertFromPeb` to easily convert a value to another unit like below.

```java
Utils.convertToPeb("1", KLAY).toBigInteger();  // 1000000000000000000
Utils.convertFromPeb("1000000000000000000", KLAY).toBigInteger();  // 1
```

### Fee Delegation
Klaytn provides [Fee Delegation](https://docs.klaytn.com/klaytn/design/transactions#fee-delegation) feature. Here's an example code.
When you are a sender:

```java
Caver caver = new Caver(Caver.DEFAULT_URL);
SingleKeyring senderKeyring = KeyringFactory.createFromPrivateKey("0x{privateKey}");
caver.wallet.add(senderKeyring);

FeeDelegatedValueTransfer feeDelegatedValueTransfer = new FeeDelegatedValueTransfer.Builder()
        .setKlaytnCall(caver.rpc.klay)
        .setFrom(senderKeyring.getAddress())
        .setTo("0x176ff0344de49c04be577a3512b6991507647f72")
        .setValue(BigInteger.valueOf(1))
        .setGas(BigInteger.valueOf(30000))
        .build();

caver.wallet.sign(senderKeyring.getAddress(), feeDelegatedValueTransfer);
String rlpEncoded = feeDelegatedValueTransfer.getRLPEncoding();
System.out.println(rlpEncoded);
```
After signing a transaction, the sender can get the RLP-encoded string through `feeDelegatedValueTransfer.getRLPEncoding()`.
Then, the sender sends the transaction to the fee payer who will pay for the transaction fee instead.

When you are a fee payer:

```java
Caver caver = new Caver(Caver.DEFAULT_URL);

SingleKeyring feePayerKeyring = KeyringFactory.createFromPrivateKey("0x{privateKey}");
caver.wallet.add(feePayerKeyring);

String rlpEncoded = "0x{RLP-encoded string}"; // The result of feeDelegatedValueTransfer.getRLPEncoding() in above example
FeeDelegatedValueTransfer feeDelegatedValueTransfer = FeeDelegatedValueTransfer.decode(rlpEncoded);
feeDelegatedValueTransfer.setFeePayer(feePayerKeyring.getAddress());

caver.wallet.signAsFeePayer(feePayerKeyring.getAddress(), feeDelegatedValueTransfer);

TransactionReceiptProcessor receiptProcessor = new PollingTransactionReceiptProcessor(caver, 1000, 15);

String rlpEncoded = feeDelegatedValueTransfer.getRLPEncoding();

try {
  // Send the transaction using `caver.rpc.klay.sendRawTransaction`.
  Bytes32 sendResult = caver.rpc.klay.sendRawTransaction(rlpEncoding).send();
  if(sendResult.hasError()) {
    //do something to handle error

  }

  String txHash = sendResult.getResult();
  TransactionReceipt.TransactionReceiptData receiptData = receiptProcessor.waitForTransactionReceipt(txHash);
} catch (IOException | TransactionException e) {
  // do something to handle exception.
}
```
After the fee payer gets the transaction from the sender, the fee payer can sign with `signAsFeePayer`.
For more information about Klaytn transaction types, visit [Transactions](https://docs.klaytn.com/klaytn/design/transactions).

## Klaytn Accounts
An account in Klaytn is a data structure containing information about a person's balance or a smart contract. If you require further information about Klaytn accounts, you can refer to the [Accounts](https://docs.klaytn.com/klaytn/design/account).

### Account Key
An account key represents the key structure associated with an account.  Each account key has its own unique role. To get more details about the Klaytn account key, please read [Account Key](https://docs.klaytn.com/klaytn/design/account#account-key). These are 6 types of Account Keys in Klaytn:
- AccountKeyNil
- AccountKeyLegacy
- AccountKeyPublic
- AccountKeyFail
- AccountKeyWeightedMultiSig
- AccountKeyRoleBased

If you want to update the key of the given account, follow below steps :

1. Create new private key(s) to use
2. Create a keyring instance using the new private key(s) and the account address to update.
After the AccountKey has been successfully updated in Klaytn, you can use the Keyring instance created here.
3. To update the AccountKey of Klaytn Account, create an Account instance using the toAccount function.
4. Create an AccountUpdate transaction (AccountUpdate/FeeDelegatedAccountUpdate/FeeDelegatedAccountUpdateWithRatio).
5. Sign the AccountUpdate transaction
6. Send signed transaction through `caver.rpc.klay.sendRawTransaction`

```java
Caver caver = new Caver(Caver.BAOBAB_URL);
SingleKeyring senderKeyring = KeyringFactory.createFromPrivateKey("0x{privateKey}");
caver.wallet.add(senderKeyring);

String newPrivateKey = KeyringFactory.generateSingleKey();
SingleKeyring newKeyring = KeyringFactory.createFromPrivateKey(newPrivateKey);

Account account = newKeyring.toAccount();

AccountUpdate accountUpdate = new AccountUpdate.Builder()
        .setKlaytnCall(caver.rpc.klay)
        .setFrom(senderKeyring.getAddress())
        .setAccount(account)
        .setGas(BigInteger.valueOf(50000))
        .build();

try {
    caver.wallet.sign(senderKeyring.getAddress(), accountUpdate);
    String rlpEncoded = accountUpdate.getRLPEncoding();

    Bytes32 sendResult = caver.rpc.klay.sendRawTransaction(rlpEncoded).send();
    if(sendResult.hasError()) {
        //do something to handle error
    }

    String txHash = sendResult.getResult();

    TransactionReceiptProcessor receiptProcessor = new PollingTransactionReceiptProcessor(caver, 1000, 15);
    TransactionReceipt.TransactionReceiptData receiptData = receiptProcessor.waitForTransactionReceipt(txHash);
} catch (IOException | TransactionException e) {
    // do something to handle exception.
}

senderKeyring = caver.wallet.updateKeyring(newKeyring);
```

## Manage Contracts using Java Smart Contract Wrappers

Caver supports `Contract` class to make it easy to interact with smart contract in Klaytn.
Before generating a wrapper code, you need to compile the smart contract first (Note: This will only work if solidity compiler is installed in your computer).

```shell
$ solc --abi --bin ./test.sol
```

You can create a contract instance as below using the result of compiling the smart contract:

```java
Caver caver = new Caver(Caver.DEFAULT_URL);
try {
    Contract contract = new Contract(caver, ABI);
    contract.getMethods().forEach((methodName, contractMethod) -> {
        System.out.println("methodName : " + methodName + ", ContractMethod : " + contractMethod);
    });
    System.out.println("ContractAddress : " + contract.getContractAddress());
} catch (IOException e) {
    //handle exception..
}
```

If you want to deploy the smart contract at Baobab testnet, you could do like this:

```java
Caver caver = new Caver(Caver.DEFAULT_URL);
SingleKeyring deployer = KeyringFactory.createFromPrivateKey("0x{private key}");
caver.wallet.add(deployer);
try {
    Contract contract = new Contract(caver, ABI);
    ContractDeployParams params = new ContractDeployParams(byteCode, null);
    SendOptions sendOptions = new SendOptions();
    sendOptions.setFrom(deployer.getAddress());
    sendOptions.setGas(BigInteger.valueOf(40000))

    Contract newContract = contract.deploy(params, sendOptions);
    System.out.println("Contract address : " + newContract.getContractAddress());
} catch (IOException | TransactionException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException e) {
    //handle exception..
}
```

After the smart contract has been deployed, you can load the smart contract as below:

```java
Caver caver = new Caver(Caver.DEFAULT_URL);
String contractAddress = "0x3466D49256b0982E1f240b64e097FF04f99Ed4b9";
try {
    Contract contract = new Contract(caver, ABI, contractAddress);
    contract.getMethods().forEach((methodName, contractMethod) -> {
        System.out.println("methodName : " + methodName + ", ContractMethod : " + contractMethod);
    });
    System.out.println("ContractAddress : " + contract.getContractAddress());
} catch (IOException e) {
    //handle exception..
}
```

To transact with a smart contract:
```java
Caver caver = new Caver(Caver.DEFAULT_URL);
SingleKeyring executor = KeyringFactory.createFromPrivateKey("0x{private key}");
caver.wallet.add(executor);
try {
    Contract contract = new Contract(caver, ABI, '0x{address in hex}');

    SendOptions sendOptions = new SendOptions();
    sendOptions.setFrom(executor.getAddress());
    sendOptions.setGas(BigInteger.valueOf(40000))
    TransactionReceipt.TransactionReceiptData receipt = contract.getMethod("set").send(Arrays.asList("testValue"), sendOptions);
    } catch (IOException | TransactionException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException e) {
    //handle exception..
}
```

## Filters
TBD

## Web3j Similarity
We made caver-java as similar as possible to web3j for easy usability.
```java
/* start a client */
Web3j web3 = Web3j.build(new HttpService(<endpoint>)); // Web3j
Caver caver = Caver.build(new HttpService(<endpoint>)); // caver-java

/* get nonce */
BigInteger nonce = web3j.ethGetTransactionCount(<address>, <blockParam>).send().getTransactionCount(); // Web3j
Quantity nonce = caver.klay().getTransactionCount(<address>, <blockParam>).send().getValue(); // caver-java

/* convert unit */
Convert.toWei("1.0", Convert.Unit.ETHER).toBigInteger(); // Web3j
Convert.toPeb("1.0", Convert.Unit.KLAY).toBigInteger(); // caver-java

/* generate wallet file */
WalletUtils.generateNewWalletFile(<password>, <filepath>); // Web3j
KlayWalletUtils.generateNewWalletFile(<address>, <password>, <filepath>); // caver-java

/* load credentials */
Credentials credentials = WalletUtils.loadCrendetials(<password>, <filepath>"); // Web3j
KlayCredentials credentials = KlayWalletUtils.loadCredentials(<password>, <filepath>); // caver-java

/* Value Transfer */
TransactionReceipt transactionReceipt = Transfer.sendFunds(...),send(); // Web3j
KlayTransactionReceipt.TransactionReceipt transactionReceipt = ValueTransfer.create(...).sendFunds(...).send(); // caver-java
```

## Command-line Tool
A caver-java fat jar is distributed with open repository. The 'caver-java' allows you to generate Solidity smart contract function wrappers from the command line:
- Generate Solidity smart contract function wrappers
Installation
```shell
$ brew tap klaytn/klaytn
$ brew install caver-java
```
After installation you can run command 'caver-java'
```shell
$ caver-java solidity generate -b <smart-contract>.bin -a <smart-contract>.abi -o <outputPath> -p <packagePath>
```

## Related projects
**caver-js** for a javascript

## Build instructions
TBD

## Snapshot dependencies
TBD

## Thanks to
- The [web3j](https://github.com/web3j/web3j) project for the inspiration.  🙂


TASKANA - The open source task management library
=================================================

[![Contributors](https://img.shields.io/github/contributors/taskana/taskana.svg)](https://github.com/Taskana/taskana/graphs/contributors)
[![Styling](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)
[![CI](https://github.com/Taskana/taskana/workflows/CI/badge.svg)](https://github.com/Taskana/taskana/actions?query=workflow%3ACI)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Taskana_taskana&metric=alert_status)](https://sonarcloud.io/dashboard?id=Taskana_taskana)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/pro.taskana/taskana-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/pro.taskana/taskana-core)
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)

TASKANA is a task management component open source library. It can be embedded into your application
or be operated standalone if appropriate. Beside the basic task management functionalities,
TASKANA adds workbaskets and classifications to control and monitor a large amount of Tasks within
a larger organization.

* Web Site: http://taskana.pro/
* Demo Environment: https://taskana.azurewebsites.net/taskana
* Getting Started: https://taskana.atlassian.net/wiki/spaces/TAS/pages/228655109/Getting+started
* Issue Tracker: https://github.com/Taskana/taskana/issues
* Contribution Guildelines: https://taskana.atlassian.net/wiki/spaces/TAS/pages/274202625/Contribution+Guide
* License: Apache License, Version 2.0  https://www.apache.org/licenses/LICENSE-2.0

---
_We're not aware of all installations of our Open Source project. However, we love_
* _listening to your feedback,_
* _discussing possible use cases with you,_
* _aligning the roadmap to your needs!_

📨 _Please [contact](#contact) us if you need consulting support._

---

# Table of Contents

* ✨ [Overview](#Overview)
    * [Tasks](#Tasks)
    * [Workbasket](#workbasket)
    * [Classification](#classification)
    * [Routing](#routing)
    * [Prioritization](#prioritization)
* [Components](#components)
    * [TASKANA Lib](#Taskana-lib)
    * [TASKANA REST API](#Taskana-rest-api)
    * [TASKANA workplace](#Taskana-workplace)
    * [TASKANA admin](#Taskana-admin)
    * [TASKANA monitor](#Taskana-monitor)
* 🚀 [Getting Started](#getting-started)
    * [Requirements](#requirements)
    * [Wrapper Application](#wrapper-application)
        * [Spring Boot Example](#spring-boot-example)
        * [EJB Example](#ejb-example)
* [Customize Behaviour](#customize-behaviour)
* 📚 [Releases](#releases)
* 📨 [Contact](#contact)

# ✨Overview

## TASKS

Tasks are the main entity of TASKANA. Each Task has its describing attributes like priority and due
date.

Furthermore each Task has a state.

And a Task holds a reference to the system and business object, it is associated with. This is
important since  is meant to be a standalone component.

All Tasks are placed in a Workbasket to control and direct the handling of the Tasks.

![Tasklifecycle](docs/images/tasklifecycle.png)

## WORKBASKETS

Workbaskets are the main structure to distribute the Tasks to the available users. There are
personal, group/team and topic Workbaskets.

Workbaskets indicate the responsibility for a Task. The concepts of Workbaskets allow to
differentiate between the permissions or the skills required to complete a Tasks and the
determination who should complete the Tasks. This can diverge a lot in a larger organization.

![Workbaskets](docs/images/workbaskets.png)

## CLASSIFICATIONS

Classifications allow to identify the type of a Task. The Task derives some major attributes from
the Classification, such as the service level and the priority.

Classifications can be configured by a responsible business administrator to control the handling
of the Tasks.

## Routing

It offers various routing and distribution functions to assign incoming Tasks to the correct
Workbaskets, or to redistribute them between Workbaskets.

![Routing](docs/images/routing.png)

## Prioritization

The dynamic prioritization functions in  allow you to control the processing sequence of
Tasks at any time. This ensures that the most important Tasks are always addressed first.

![Prioritization](docs/images/prio.png)

# Components

![Components](docs/images/components.png)

It splits up into five components:

* TASKANA Lib
  * The Java library providing the Task management functions
* TASKANA REST API
  * REST API to allow remote access to the TASKANA system.
* TASKANA workplace
  * Angular based web application to work on the Tasks
  * Sample Tasklist application you can use if appropriate
* TASKANA admin
  * Angular based web application to configure the system
  * Supports Workbaskets and Classifications
* TASKANA monitor
  * Angular based web application to monitor the status of the entire Task pool
  * Provides views and statistics about the conformance with defined services levels
  * Shows the workload of your organization and the individual teams

## Demo App Components Diagram

![Demo App Components](docs/images/componets_demo_app.png)

# 🚀Getting Started

As TASKANA is meant to be integrated in the development environment and process of your organisation, you have to create your own small integration project as a wrapper and starting point for your customisations.

We currently provide examples how to run TASKANA as a Spring Boot Application or as a an Enterprise Application on Wildfly Application Server.

If you are only interested in how TASKANA looks and feel, you can try our Demo Environment instead.

## Requirements

Runtime Environment at least Java 17

Supported Databases:

* H2 (We test with 2.1.214*)
* Postgres (We test with 14.7*)
* DB2 (We test with 11.5.6*)
* Oracle (We test with 18c*)

_* other versions of the named databases should work also, but haven't been tested_

## Wrapper Application

### Spring Boot Example

We use the h2 database in this example.

See `rest/taskana-rest-spring-example-boot` and it dependencies

### EJB Example

We use a Wildfly Application Server in this example.

See `lib/taskana-cdi`.

# Customize Behaviour

TASKANA allows to customize and modify it’s behaviour through the use of dedicated Service
Provider Interfaces (SPI). Each SPI defines an interface that can be implemented by custom code.
This is a common approach for Java developers to extend their applications. You can find out more
about the background and the details in the Java documentation:
https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html

In order to use an SPI within TASKANA, you must

* create a class that implements the relevant interface.
* place that class into the classpath of your application
* provide a control file with full name of the SPI
  (e. g. pro.taskana.spi.task.api.CreateTaskPreprocessor) in the subdirectory META-INF/services of
  the classpath. This control file must contain the fully qualified classname (including the
  package) of the class that implements the relevant interface. This control file is used by the
  ServiceLoader to load the custom class at runtime. The control file may contain multiple classes
  has implement the interface. Each implementation should be declared in a new line.

  All implementations will be used consecutively in the declaration order of the control file.

If you provide one or multiple implementations according to the description above, TASKANA will invoke the implementations at a specific point. The Javadoc of each SPI describes the conditions for the implementation to be executed.

Currently, TASKANA provides the following SPIs:

* [`pro.taskana.spi.history.api.TaskanaHistory`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/history/api/TaskanaHistory.java)
* [`pro.taskana.spi.priority.api.PriorityServiceProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/priority/api/PriorityServiceProvider.java)
* [`pro.taskana.spi.routing.api.TaskRoutingProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/routing/api/TaskRoutingProvider.java)
* [`pro.taskana.spi.task.api.AfterRequestChangesProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/AfterRequestChangesProvider.java)
* [`pro.taskana.spi.task.api.AfterRequestReviewProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/AfterRequestReviewProvider.java)
* [`pro.taskana.spi.task.api.BeforeRequestChangesProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/BeforeRequestChangesProvider.java)
* [`pro.taskana.spi.task.api.BeforeRequestReviewProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/BeforeRequestReviewProvider.java)
* [`pro.taskana.spi.task.api.CreateTaskPreprocessor`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/CreateTaskPreprocessor.java)
* [`pro.taskana.spi.task.api.ReviewRequiredProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/ReviewRequiredProvider.java)
* [`pro.taskana.spi.user.api.RefreshUserPostprocessor`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/user/api/RefreshUserPostprocessor.java)

# 📚Releases

The list of [releases](https://github.com/Taskana/taskana/releases) contains a detailed changelog.

We use [Semantic Versioning](https://semver.org/).

The following compatibility matrix shows the officially supported Spring version for each release.
Other combinations might also work but have not been tested.

| Release | SpringBoot |
|---------|------------|
| 7.0.0   | 2.7.16     |
| 6.3.2   | 2.7.14     |
| 6.2.2   | 2.7.12     |
| 6.1.1   | 2.7.10     |

# 📨Contact

If you have any questions or ideas feel free to create an [issue](https://github.com/Taskana/taskana/issues) or contact us via [GitHub Discussions](https://github.com/orgs/Taskana/discussions).

We love listening to your feedback, and of course also discussing the project roadmap and possible use cases with you!

This open source project is being developed by [Novatec Consulting GmbH](https://www.novatec-gmbh.de/en/) and [envite consulting GmbH](https://envite.de/) with the support of the open source community.

---
[![Novatec Consulting GmbH](docs/images/novatec.jpeg)](https://www.novatec-gmbh.de)
---
[![envite consulting GmbH](docs/images/envite-black.png)](https://envite.de/)
---


<!--ts-->
   * [What is it?](#what-is-it)
   * [Two main versions: 1.x and 2.x](#two-main-versions-1x-and-2x)
   * [Availability: Maven and Gradle](#availability-maven-and-gradle)
       * [Maven Plugin](#maven-plugin)
       * [Gradle Plugin](#gradle-plugin)
   * [The plugin goals/tasks](#the-plugin-goalstasks)
   * [The Documentation](#the-documentation)
   * [Compatibility with GraphQL](#compatibility-with-graphql)
   * [Change log](#change-log)
   * [Note for contributors](#note-for-contributors)
   * [License](#license)
<!--te-->

# What is it?

The GraphQL Java Generator makes it easy to work in Java with graphQL in a schema first approach.

This project is a code generator, that allows to quickly develop __GraphQL clients__ and __GraphQL servers__ in java, based on a GraphQL schema.

That is: graphql-java-generator generates the boilerplate code, and lets you concentrate on what's specific to your use case.

* In __client mode__ : graphql-java-generator generates an executor class for each query, mutation type and/or subscription type. These classes contain the methods to call the queries, mutations and subscriptions. That is: __to call the GraphQL server, you just call the relevant method__. In client mode, the plugin generates:
    * The __POJOs__ from the GraphQL schema. That is: one class, interface or enum for each item in the provided GraphQL schema file(s)
    * The __utility classes__ that allows you to execute queries, mutations and subscriptions, and to retrieve their result (including the GraphQL response's _extensions field)
    * Support blocking and (since 2.3) reactive (Mono, Flux) queries
    * The support for the full GraphQL specification (relay cursors, subscription, custom scalars, fragment, directive, GraphQL variables, GraphQL alias...).
    * The capability to use __bind parameters__ within your queries, mutations and subscriptions, in an easier way than the GraphQL variables
    * It is based on Spring framework, and since 2.0 on __spring-graphql__. It still can be used with non-spring apps, as explained in the project's wiki.
    * When used in a spring boot app, each Spring component can be overridden. This allows fine tuning, like connecting to __OAuth__ server, changing the _WebClient_, and much more
    * Since 1.17, it is possible to execute GraphQL request by just creating a Java interface, no code at all: __GraphQL Repositories__ work almost like Spring Data Repositories. More information [in the wiki](https://github.com/graphql-java-generator/graphql-maven-plugin-project/wiki/client_graphql_repository)
* In __server mode__ : graphql-java-generator generates an almost ready to start GraphQL server. The developer has only to develop the access to the data. That is :
    * The generated code can be packaged either in a __jar__ (starting as a Java application) or a __war__ (starting in a Java container like tomcat or jetty).
    * graphql-java-generator generates the __main method__ (in a jar project) or the __main servlet__ class (in a war project),
    * It generates the __POJOs__ for the provided GraphQL schema file(s).
    * It supports the full GraphQL specification (relay cursors, query/mutation/subscription, custom scalars, fragment, directive, aliases...)
    * The generated code is a __Spring boot app (or servlet)__. You can __override every default component__, to personalize your server: GraphQL components (add instrumentation, type wiring, field wiring...), HTTP stuff (Spring Security, OAuth, OpenID Connect...) and much more. See the [server FAQ](../../wiki/server_faq) for more information on this.
    * Various options allows to personalize the generated code (standard JPA annotations, Java type for ID fields, custom scalars, specific annotations...). See the [plugin parameters page](https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/plugin-info.html) for all the goal/tasks and their plugin parameters
    * The developer just has to __implement each DataFetchersDelegate__, based on the provided interfaces, to provide the access to the data

Other points that are worth to point out:
* The project is __extensively tested__:
    * Through unit tests (for the runtime),
    * Through unit and integration tests (for the plugin logic)
    * Through full integration tests: three samples contain both the client and the server parts. Integration tests are run on client side, against "its" server side. More than 250 integration tests are run on client side against the server part.
* A big effort is done to __avoid any impact on your code, when the plugin evolves__.
* A maven/gradle goal/task allows to __merge several schemas in one__, adding (for instance) relay capability in the generated schema

# Two main versions: 1.x and 2.x

The 1.x version:
* Allows non-spring application either by using the `javax.ws.rs.client.Client` client, which is deprecated and has been removed in Spring Boot 3
* Is based directly on [graphql-java](https://www.graphql-java.com/), and a clone of [graphql-java-spring](https://github.com/graphql-java/graphql-java-spring).
* Is not compatible with Spring Boot 3 and Spring Framework 5

The 2.x version:
* Is based on [spring-graphql](https://spring.io/projects/spring-graphql)
* Is compatible with Spring Boot 3 and Spring Framework 6
    * Another version of the Gradle plugin had been created to achieve this (see below)
* (since 2.3) Allows also reactive queries (that returns reactive Mono or Flux)
* Please check the [Client migration from 1.x to 2.x](../../wiki/client_migrate_1-x_to_2-x) or [Server migration from 1.x to 2.x](../../wiki/server_migrate_1-x_to_2-x) if you're using the 1.x version.

# Availability: Maven and Gradle

The generator is currently available both as a Maven plugin and as a Gradle plugins.

The plugin documentation is available [on this page](https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/plugin-info.html). It lists all the plugin goals and their parameters. It is valid for both Maven and Gradle.

## Maven plugin

The __Maven plugin__ is available in the project ([graphql-maven-plugin-project](https://github.com/graphql-java-generator/graphql-maven-plugin-project)).

The last published version can be found in the [Maven Central Repository](https://mvnrepository.com/artifact/com.graphql-java-generator/graphql-maven-plugin)

## Gradle Plugin

Two __Gradle plugins__ are available from the project [graphql-gradle-plugin-project](https://github.com/graphql-java-generator/graphql-gradle-plugin-project).

They offer the exact same functionalities:
* __[graphql-gradle-plugin](https://plugins.gradle.org/plugin/com.graphql-java-generator.graphql-gradle-plugin)__ is compiled against Spring Boot 2 and Spring Framework 5
* __[graphql-gradle-plugin3](https://plugins.gradle.org/plugin/com.graphql-java-generator.graphql-gradle-plugin3)__ is compiled against Spring Boot 3 and Spring Framework 6

# The plugin goals/tasks

All maven goals and gradle tasks are described on [this page](https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/plugin-info.html)

This plugin contains these goals (Maven) / tasks (Gradle):
* __`generateClientCode`__ : this goal generates the client code from the Graphql schema file(s)
    * You'll find all the details [on this page](https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/generateClientCode-mojo.html)
* __`generateServerCode`__ : this goal generates the server code from the Graphql schema file(s)
    * You'll find all the details [on this page](https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/generateServerCode-mojo.html)
* __`generatePojo`__ : this goal generates only the java objects that match the provided GraphQL schema. It allows to work in Java with graphQL, in a schema first approach.
    * You'll find all the details [on this page](https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/generatePojo-mojo.html)
* (deprecated) __`graphql`__ was the previous main goal. It can generate both the client and the server code, thanks to its _mode_ parameter.
    * You'll find all the details [on this page](https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/graphql-mojo.html)
* __`merge`__ allows to generate a GraphQL schema file, based on the source GraphQL schemas. It can be used to merge several GraphQL schema files into one file, or to reformat the schema files.
    * You'll find all the details [on this page](https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/merge-mojo.html)

# The Documentation

The full documentation is available on the [github wiki](../../wiki).

You can also:
* Take a look at the tutorials :
    * For Maven
        *[GraphQL-Forum-Maven-Tutorial-client](https://github.com/graphql-java-generator/GraphQL-Forum-Maven-Tutorial-client)
        * [GraphQL-Forum-Maven-Tutorial-server](https://github.com/graphql-java-generator/GraphQL-Forum-Maven-Tutorial-server)
    * For Gradle
        * [GraphQL-Forum-Gradle-Tutorial-client](https://github.com/graphql-java-generator/GraphQL-Forum-Gradle-Tutorial-client)
        * [GraphQL-Forum-Gradle-Tutorial-server](https://github.com/graphql-java-generator/GraphQL-Forum-Gradle-Tutorial-server)
* Study the samples available in the project
* Directly go to the client or server documentation on the [github wiki](../../wiki)

# Compatibility with GraphQL

This plugin respects all the GraphQL specifications:
- queries, mutations and subscriptions
- introspection
- custom scalars
- input types
- interfaces and unions (that are both implemented in Java interfaces into the generated code)
- directives
- fragments (global and inline)
- input parameters (for fields and directives)
- Use of Bind Parameters to map Java variables with input parameters
- easy execution of just a query/mutation/subscription (one field of the query, mutation or subscription type) as a standard method call
- execution of a full GraphQL request, which allows to execute several queries or several mutations at once
- Management of the GraphQL response's _extensions_ field
- Comments and description coming from the GraphQL schema are reported in the generated code

# Change log

The Change Log is available [here](CHANGELOG.md)

# Note for contributors

## Branches

Since 01 may 2023, the default branch is the `master_2.x` branch. It contains all the changes done for the 2.0 version.
This branch

The historical branch has been renamed from `master` to `master_1.x` branch. This branch is used only for the 1.x maintenance, that is: only major and security issues.

## Project organization

All the plugin logic is stored in the [graphql-maven-plugin-project](https://github.com/graphql-java-generator/graphql-maven-plugin-project) project.

The [Maven plugin](https://github.com/graphql-java-generator/graphql-maven-plugin-project) and the [Gradle plugin](https://github.com/graphql-java-generator/graphql-gradle-plugin-project) are just wrapper for the plugin logic, available in the __graphql-maven-plugin-logic__ module of the maven project.

If you want to compile the maven project, you'll have to add the lombok.jar file in your IDE. Please see the relevant section, in the Install menu of the [https://projectlombok.org/](https://projectlombok.org/) home page. This very nice tools generates all java boiler plate code, like setters, getters, constructors from fields...

If you use eclipse, please use the __code formatter__ given with the project (file _graphql-java-generator (eclipse code formatter).xml_ at the root of the project). This allows to have the sample code formatting: the code is then homogeneous, and the comparison between versions is simpler. To do this, go to the eclipse preferences, select Java/Code Style/Formatter, and import this file. Then, in the Java/Editor/Save Actions, check the "Perform the selected action on save", "Format source code", "Format all lines", "Organize imports" and "Additional actions" which its default content

# License

`graphql-java-generator` is licensed under the MIT License. See [LICENSE](LICENSE.md) for details.


# ReportPortal. Main API Module

[![Docker Pulls](https://img.shields.io/docker/pulls/reportportal/service-api.svg?maxAge=159200)](https://hub.docker.com/r/reportportal/service-api/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Freportportal%2Fservice-api.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Freportportal%2Fservice-api?ref=badge_shield)

[![Build](https://github.com/reportportal/service-api/actions/workflows/build.yml/badge.svg)](https://github.com/reportportal/service-api/actions/workflows/build.yml)
[![Code Coverage](https://codecov.io/gh/reportportal/service-api/graphs/badge.svg)](https://codecov.io/gh/reportportal/service-api)
[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/service-api.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22service-api%22)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/reportportal/service-api.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/reportportal/service-api/alerts/)

## Copyright Notice

Licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
license (see the LICENSE file).