com.github.sdorra.buildfrontend.PackageJsonReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of buildfrontend-maven-plugin Show documentation
Show all versions of buildfrontend-maven-plugin Show documentation
Installs and run node, npm or yarn as part of your maven build
package com.github.sdorra.buildfrontend;
import com.google.common.base.Throwables;
import javax.json.Json;
import javax.json.JsonReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
public class PackageJsonReader {
public PackageJson read(File packageJsonFile) {
try (JsonReader reader = Json.createReader(new FileReader(packageJsonFile))) {
return new PackageJson(reader.readObject());
} catch (FileNotFoundException e) {
throw Throwables.propagate(e);
}
}
}