diff options
author | Gautam Shah <gautams@amdocs.com> | 2018-06-04 18:27:59 +0530 |
---|---|---|
committer | GAUTAMS <gautams@amdocs.com> | 2018-06-04 19:00:46 +0530 |
commit | d9cae980e80021dfad0bc9366d32d2cf996cfa90 (patch) | |
tree | 282dca14fec43565510e6625bdbd3efb90b01b12 /openecomp-be/tools/compile-helper-plugin/src | |
parent | 74bc96a289f9bf54a010fa7b027b839ebebead4c (diff) |
Fixing bug.
fixing bug.
Change-Id: Iedc29491adc1b066f9f6bfe4a4978c06de6be6bf
Issue-ID: SDC-1189
Signed-off-by: GAUTAMS <gautams@amdocs.com>
Diffstat (limited to 'openecomp-be/tools/compile-helper-plugin/src')
3 files changed, 8 insertions, 24 deletions
diff --git a/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/BuildHelper.java b/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/BuildHelper.java index 1b1278d797..8f20f221d9 100644 --- a/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/BuildHelper.java +++ b/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/BuildHelper.java @@ -48,12 +48,10 @@ import java.util.jar.JarEntry; import java.util.jar.JarInputStream; import java.util.stream.Collectors; import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; class BuildHelper { - private static Log logger; private static Map<String, String> store = new HashMap<>(); @@ -61,10 +59,6 @@ class BuildHelper { // donot remove. } - static void setLogger(Log log) { - logger = log; - } - static String getSnapshotSignature(File snapshotFile, String moduleCoordinate, String version) { String key = moduleCoordinate + ":" + version; String signature = store.get(key); @@ -76,7 +70,6 @@ class BuildHelper { store.put(key, signature); return signature; } catch (IOException ioe) { - logger.debug(ioe); return version; } @@ -218,7 +211,6 @@ class BuildHelper { ObjectInputStream ois = new ObjectInputStream(is)) { return Optional.of(clazz.cast(ois.readObject())); } catch (Exception ignored) { - logger.debug(ignored); return Optional.empty(); } } diff --git a/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/BuildState.java b/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/BuildState.java index 1ce60a636c..68557a9609 100644 --- a/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/BuildState.java +++ b/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/BuildState.java @@ -43,7 +43,6 @@ import java.util.Optional; import java.util.Set; import java.util.function.Function; import org.apache.maven.artifact.Artifact; -import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; public class BuildState { @@ -62,7 +61,6 @@ public class BuildState { private static File compileStateFile; private MavenProject project; private String compileStateFilePath; - private static Log logger; static { initializeStore(); @@ -76,12 +74,8 @@ public class BuildState { } } - private static void setLogger(Log log) { - logger = log; - } - void init(Log log) { - setLogger(log); + void init() { artifacts.clear(); for (Artifact artifact : project.getArtifacts()) { if (artifact.isSnapshot() && JAR.equals(artifact.getType())) { @@ -157,7 +151,7 @@ public class BuildState { } } } catch (IOException ignored) { - logger.debug(ignored); + // ignored. No need to handle. System will take care. } } @@ -168,7 +162,7 @@ public class BuildState { compileDataStore.get(FULL_RESOURCE_BUILD_DATA).put(moduleCoordinates, buildTime); writeCompileState(); } catch (IOException ignored) { - logger.debug(ignored); + // ignored. No need to handle. System will take care. } } } @@ -210,7 +204,7 @@ public class BuildState { ObjectOutputStream ois = new ObjectOutputStream(fos)) { ois.writeObject(dataToSave); } catch (IOException ignored) { - logger.debug(ignored); + // ignored. No need to handle. System will take care. } } } @@ -239,9 +233,9 @@ public class BuildState { if (artifacts.containsKey(d) && JAR.equals(artifacts.get(d).getType())) { boolean versionEqual = artifacts.get(d).getVersion().equals(project.getVersion()); if (versionEqual && getBuildTime(d) == 0) { - logger.warn(ANSI_YELLOW + "[WARNING:]" + "You have module[" + d - + "] not locally compiled even once, please compile your project once daily from root to have reliable build results." - + ANSI_COLOR_RESET); + System.err.println(ANSI_YELLOW + "[WARNING:]" + "You have module[" + d + + "] not locally compiled even once, please compile your project once daily from root to have reliable build results." + + ANSI_COLOR_RESET); return true; } } @@ -281,7 +275,6 @@ public class BuildState { try (InputStream is = new FileInputStream(file); ObjectInputStream ois = new ObjectInputStream(is)) { return HashMap.class.cast(ois.readObject()); } catch (Exception e) { - logger.debug(e); return new HashMap<>(); } } diff --git a/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/InitializationHelperMojo.java b/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/InitializationHelperMojo.java index 42ddc657db..6c1d2be28e 100644 --- a/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/InitializationHelperMojo.java +++ b/openecomp-be/tools/compile-helper-plugin/src/main/java/org/openecomp/sdc/onboarding/InitializationHelperMojo.java @@ -64,8 +64,7 @@ public class InitializationHelperMojo extends AbstractMojo { project.getProperties().setProperty(SKIP_PMD, Boolean.TRUE.toString()); if (System.getProperties().containsKey(UNICORN)) { - buildState.init(getLog()); - BuildHelper.setLogger(getLog()); + buildState.init(); } else { project.getProperties().setProperty("skipMainSourceCompile", Boolean.FALSE.toString()); project.getProperties().setProperty("skipTestSourceCompile", Boolean.FALSE.toString()); |