Configurate is a simple configuration library for Java applications that provides a node-based representation of data, able to handle a wide variety of configuration formats.
Want to talk to us about Configurate? Join us in the #dev
channel on our Discord or the #spongedev
channel on irc.esper.net
.
The current supported formats are:
The project is split into different modules.
configurate-core is the base of the library, containing the main APIs used to manipulate configurations. It is generic, and does not depend on any specific format of configuration.
Each distinct configuration format is implemented as a "configuration loader", in a separate module.
A number of loader implementations are provided as standard in this project, however it is possible to implement a custom loader for a new format separately.
The current supported loaders provided by the project are:
configurate-gson
- Implementation for the JSON format, using the Gson library for parsing and generationconfigurate-hocon
- Implementation for the HOCON format, using the lightbend config library for parsing and generationconfigurate-json
- Implementation for the JSON format, using the Jackson library for parsing and generationconfigurate-xml
- Implementation for the XML format, using the JAXP library for parsing and generationconfigurate-yaml
- Implementation for the YAML format, using the SnakeYAML library for parsing and generation
- To use configurate, your project must be configured to use Java 8 or higher.
- Release artifacts are hosted on Maven Central, and snapshots are on Sonatype OSS
The latest release is: 3.7
If your project uses Maven or Gradle, just add the following to your build scripts.
repositories {
// Only for releases
mavenCentral()
// Only for snapshots
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
name 'sonatypeOss'
}
}
dependencies {
// Modify this line to target the loader you wish to use.
implementation 'org.spongepowered:configurate-hocon:3.7.1'
}
<dependencies>
<dependency>
<groupId>org.spongepowered</groupId>
<!-- Modify this line to target the loader you wish to use. -->
<artifactId>configurate-hocon</artifactId>
<version>3.7.1</version>
</dependency>
</dependencies>
<repositories>
<!-- Only for snapshots -->
<repository>
<id>sonatype-oss</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
More detailed usage instructions can be found in the configurate wiki.
The following steps will ensure your project is cloned properly.
git clone https://github.com/SpongePowered/configurate.git
cd configurate
Note: If you do not have Gradle installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command.
In order to build configurate you simply need to run the gradle build
command. You can find the compiled JAR files in ./build/libs
(found in each subproject) labeled similarly to 'configurate-subproject-x.x-SNAPSHOT.jar'.
We love PRs! However, when contributing, here are some things to keep in mind:
- Take a look at open issues first before you get too far in -- someone might already be working on what you were planning on doing
- Please, please, please test PRs. It makes the process a lot easier for everybody :)