A file writer for yaml configuration with provided comments.
- Implement
CommentedYAML
for writer to get original config contents and comments. - Use
CommentedYAMLWriter#writeWithComments(commentedYAML, file)
to write config file.
Maven dependency
<project>
<repositories>
<repository>
<!--Using central repository-->
<id>maven</id>
<name>Maven Central</name>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<!--Using github packages-->
<id>YAMLCommentWriter</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/CarmJos/YAMLCommentWriter</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>YAMLCommentWriter</artifactId>
<version>[LATEST RELEASE]</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Gradle dependency
repositories {
mavenCentral() // Using central repository.
// Using github packages.
maven { url 'https://maven.pkg.github.com/CarmJos/YAMLCommentWriter' }
}
dependencies {
api "cc.carm.lib:YAMLCommentWriter:[LATEST RELEASE]"
}
The project using The MIT License .
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.