From 239b407cabb975fb6ae4853168ac6e9fe3626341 Mon Sep 17 00:00:00 2001 From: Alex Vazquez Date: Sun, 9 Oct 2022 11:12:19 +0200 Subject: [PATCH 1/2] Fix for #680 --- .../plugin/module/BWModulePackageMojo.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/module/BWModulePackageMojo.java b/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/module/BWModulePackageMojo.java index 397177e7..3b01bfc3 100644 --- a/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/module/BWModulePackageMojo.java +++ b/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/module/BWModulePackageMojo.java @@ -192,18 +192,17 @@ private void addDependencies() throws Exception { boolean isSharedModule = false; Manifest mf = ManifestParser.parseManifestFromJAR( file); - if(mf == null){ - throw new Exception("Failed to get Manifest for - "+ file.getName() +". Please verify if jar file is valid, the MANIFEST.MF should be first or second entry in the jar file. Use Command - jar tf to verify."); - } - for( Object str : mf.getMainAttributes().keySet()) - { - getLog().debug( str.toString() ); - if( Constants.TIBCO_SHARED_MODULE.equals(str.toString() )) - { - isSharedModule = true; - break; - } - } + if(mf != null){ + for( Object str : mf.getMainAttributes().keySet()) + { + getLog().debug( str.toString() ); + if( Constants.TIBCO_SHARED_MODULE.equals(str.toString() )) + { + isSharedModule = true; + break; + } + } + } if(!isSharedModule) { getLog().debug("Dependency added with name " + file.toString()); jarArchiver.addFile(file, "lib/" + file.getName()); From 5de08ec55bbc1a800b9c539248c72cae4cfdb550 Mon Sep 17 00:00:00 2001 From: Alex Vazquez Date: Wed, 8 Feb 2023 11:32:01 +0100 Subject: [PATCH 2/2] Fix for #680 --- .../bw/maven/plugin/test/setuplocal/ESMTestFile.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/test/setuplocal/ESMTestFile.java b/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/test/setuplocal/ESMTestFile.java index 1b451c55..daeba9b3 100644 --- a/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/test/setuplocal/ESMTestFile.java +++ b/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/test/setuplocal/ESMTestFile.java @@ -113,14 +113,10 @@ private void checkForSharedModule( Map artifactFiles) { continue; } boolean isSharedModule = false; + System.out.println("#### " + file.getAbsolutePath()); Manifest mf = ManifestParser.parseManifestFromJAR( file); - if(mf == null){ - try { - throw new Exception("Failed to get Manifest for - "+ file.getName() +". Please verify if jar file is valid, the MANIFEST.MF should be first or second entry in the jar file. Use Command - jar tf to verify."); - } catch (Exception e) { - e.printStackTrace(); - } - } + if(mf != null){ + for( Object str : mf.getMainAttributes().keySet()) { if( Constants.TIBCO_SHARED_MODULE.equals(str.toString() )) @@ -136,6 +132,7 @@ private void checkForSharedModule( Map artifactFiles) { e.printStackTrace(); } } + } } }