Search in sources :

Example 31 with JReleaserException

use of org.jreleaser.util.JReleaserException in project jreleaser by jreleaser.

the class JReleaserTemplateTask method execute.

@Override
public void execute() throws BuildException {
    Banner.display(new PrintWriter(System.out, true));
    if (skip)
        return;
    try {
        initLogger();
        Path outputDirectory = getOutputDirectory().resolve("src").resolve("jreleaser");
        Path output = TemplateGenerator.builder().logger(logger).distributionName(distributionName).distributionType(distributionType).packagerName(packagerName).announcerName(announcerName).outputDirectory(outputDirectory).overwrite(overwrite).snapshot(snapshot).build().generate();
        if (null != output) {
            logger.info("Template generated at {}", output.toAbsolutePath());
        }
    } catch (TemplateGenerationException e) {
        logger.trace(e);
        throw new JReleaserException("Unexpected error", e);
    }
}
Also used : Path(java.nio.file.Path) TemplateGenerationException(org.jreleaser.templates.TemplateGenerationException) PrintWriter(java.io.PrintWriter) JReleaserException(org.jreleaser.util.JReleaserException)

Aggregations

JReleaserException (org.jreleaser.util.JReleaserException)31 IOException (java.io.IOException)23 Path (java.nio.file.Path)22 Reader (java.io.Reader)15 ArrayList (java.util.ArrayList)3 LinkedHashMap (java.util.LinkedHashMap)3 Artifact (org.jreleaser.model.Artifact)3 PrintWriter (java.io.PrintWriter)2 FileAlreadyExistsException (java.nio.file.FileAlreadyExistsException)2 FileSystem (java.nio.file.FileSystem)2 PathMatcher (java.nio.file.PathMatcher)2 Map (java.util.Map)2 Scanner (java.util.Scanner)2 JReleaserModel (org.jreleaser.model.JReleaserModel)2 ResolvedType (com.fasterxml.classmate.ResolvedType)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 SerializationFeature (com.fasterxml.jackson.databind.SerializationFeature)1 Option (com.github.victools.jsonschema.generator.Option)1 OptionPreset (com.github.victools.jsonschema.generator.OptionPreset)1 SchemaGenerationContext (com.github.victools.jsonschema.generator.SchemaGenerationContext)1