I have packaged a spring boot service using Maven "mvn package" and I am successfully able to create the jar. But when I run it from command line using below command : "java -jar \target\demo-0.0.1-SNAPSHOT.jar" I am getting below error ::
java.io.IOException: Unable to open nested jar file 'lib/JavaPNS-jar-2.2.0.jar'
Caused by: java.io.IOException: Unable to find ZIP central directory records after reading 65792 bytes
Above jar "JavaPNS-jar-2.2.0.jar" i am referening in my pom.xml from my local file system using below : JavaPNS JavaPNS-jar 2.2.0 in-project In Project Repo file://${project.basedir}/lib
When i run the application using "mvn spring-boot:run" command it runs fine without any error.
I have tried below options to resolve this :
- Cleared the local cache of Maven and then again build the application. But it does not help to resolve it.
- Also I tried to add the jar again to make sure that it is not corrupt.
Can someone please help me with this issue.