
com.github.iarellano.j2y2j.Yaml2JsonConverterMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iad-j2y2j-converter-maven-plugin Show documentation
Show all versions of iad-j2y2j-converter-maven-plugin Show documentation
This plugin allows to convert files from json to yaml and vice versa. It makes use of the Apache Maven Filtering
component therefore filtering can also be performed.
The newest version!
package com.github.iarellano.j2y2j;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
/**
* Goal which touches a timestamp file.
*/
@Mojo(name = "yaml-2-json", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
public class Yaml2JsonConverterMojo
extends AbstractConverterMojo {
@Parameter(defaultValue = "json", property = "convert.json.outputExtension")
private String outputExtension;
public void execute()
throws MojoExecutionException {
super.execute();
}
@Override
protected ObjectMapper getReader() {
return new ObjectMapper(new YAMLFactory());
}
@Override
protected ObjectMapper getWriter() {
return getJsonWriter();
}
@Override
protected String getFileExtension() {
return outputExtension;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy