From: Gary Wu Date: Fri, 1 Sep 2017 20:14:36 +0000 (-0700) Subject: Change to read manifest from classpath X-Git-Tag: 1.0.0-Amsterdam~381 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=4ccabfb4a41f5b2e81dc6e3a44b0cdc7cb375cda;p=integration.git Change to read manifest from classpath Change-Id: Iba9f66cae0b018efdfd7c0827d3287866eb0b092 Issue-ID: INT-124 Signed-off-by: Gary Wu --- diff --git a/.gitignore b/.gitignore index 75d41254c..f3b07b8d9 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ env.properties *.log .vagrant *~ +.checkstyle diff --git a/version-manifest/pom.xml b/version-manifest/pom.xml index 11318e612..38b90c9c3 100644 --- a/version-manifest/pom.xml +++ b/version-manifest/pom.xml @@ -3,12 +3,13 @@ 4.0.0 org.onap.oparent - version + oparent 0.1.0 org.onap.integration version-manifest maven-plugin + 0.1.0-SNAPSHOT ONAP Version Manifest and Maven Plugin https://www.onap.org @@ -51,7 +52,7 @@ maven-plugin-plugin 3.2 - version-check + version-manifest true diff --git a/version-manifest/src/main/java/org/onap/integration/versioncheck/VersionCheckMojo.java b/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java similarity index 93% rename from version-manifest/src/main/java/org/onap/integration/versioncheck/VersionCheckMojo.java rename to version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java index ffd106cf5..b26c1cdac 100644 --- a/version-manifest/src/main/java/org/onap/integration/versioncheck/VersionCheckMojo.java +++ b/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java @@ -14,12 +14,11 @@ * limitations under the License. */ -package org.onap.integration.versioncheck; +package org.onap.integration.versionmanifest; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; -import java.net.URI; import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; @@ -52,17 +51,17 @@ public class VersionCheckMojo extends AbstractMojo { /** * Location of the file. */ - @Parameter(property = "manifestUri", required = true) - private URI manifestUri; + @Parameter(property = "manifest", required = true, defaultValue = "/java-manifest.csv") + private String manifest; public void execute() throws MojoExecutionException { final Log log = getLog(); - log.info("Checking version manifest " + manifestUri); + log.info("Checking version manifest " + manifest); Map expectedVersions = new HashMap<>(); - try (InputStreamReader in = new InputStreamReader(manifestUri.toURL().openStream(), + try (InputStreamReader in = new InputStreamReader(getClass().getResourceAsStream(manifest), StandardCharsets.ISO_8859_1)) { Iterable records = CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(in); for (CSVRecord record : records) {