aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-09-01 13:14:36 -0700
committerGary Wu <gary.i.wu@huawei.com>2017-09-01 13:14:36 -0700
commit4ccabfb4a41f5b2e81dc6e3a44b0cdc7cb375cda (patch)
tree4ff8286cad96651ccf8e9d45ee30ed3c3685c41b
parent6e99bdc32da920b23ee06e90cb6fe4d2faa04642 (diff)
Change to read manifest from classpath
Change-Id: Iba9f66cae0b018efdfd7c0827d3287866eb0b092 Issue-ID: INT-124 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
-rw-r--r--.gitignore1
-rw-r--r--version-manifest/pom.xml5
-rw-r--r--version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java (renamed from version-manifest/src/main/java/org/onap/integration/versioncheck/VersionCheckMojo.java)11
3 files changed, 9 insertions, 8 deletions
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 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.oparent</groupId>
- <artifactId>version</artifactId>
+ <artifactId>oparent</artifactId>
<version>0.1.0</version>
</parent>
<groupId>org.onap.integration</groupId>
<artifactId>version-manifest</artifactId>
<packaging>maven-plugin</packaging>
+ <version>0.1.0-SNAPSHOT</version>
<name>ONAP Version Manifest and Maven Plugin</name>
<url>https://www.onap.org</url>
<properties>
@@ -51,7 +52,7 @@
<artifactId>maven-plugin-plugin</artifactId>
<version>3.2</version>
<configuration>
- <goalPrefix>version-check</goalPrefix>
+ <goalPrefix>version-manifest</goalPrefix>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
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
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<String, String> expectedVersions = new HashMap<>();
- try (InputStreamReader in = new InputStreamReader(manifestUri.toURL().openStream(),
+ try (InputStreamReader in = new InputStreamReader(getClass().getResourceAsStream(manifest),
StandardCharsets.ISO_8859_1)) {
Iterable<CSVRecord> records = CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(in);
for (CSVRecord record : records) {