1

I have an issue when I use maven for installing an external jar from SAP.I'm using springboot and I've gotten 2 scenarios with no success.

1- Using maven dependency directly from folder I get an exception and the jar is not added in BOOT-INF/lib folder. But on eclipse the jar is added in Maven Dependency

<dependency>
<groupId>com.sap.conn.jco</groupId>
    <artifactId>sapjco3</artifactId>
    <version>3.0.19</version>
    <scope>system</scope>
             <systemPath>/home/eder/workspace/obsekium/TesteSelenium/sapjco3.jar</systemPath>
</dependency>

Caused by: java.lang.NoClassDefFoundError: com/sap/conn/jco/ext/DestinationDataProvider

2- Using "mvn install:install-file" Maven changes jar's name and it causes an exception

 Factory method 'sapConector' threw exception; nested exception is java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.ExceptionInInitializerError: Illegal JCo archive "sapjco3-3.0.19-3.0.19.jar". It is not allowed to rename or repackage the original archive "sapjco3.jar".

How do I solve this issue?

1 Answers1

0

You can try to use the following dependency and check whether it works.

<dependency>
    <groupId>com.sap.jco</groupId>
    <artifactId>sapjco</artifactId>
    <version>3.0.14</version>
</dependency>

You can find the details from the following link. https://mvnrepository.com/artifact/com.sap.jco/sapjco/3.0.14

If you want, you can download the jar file and you can set the dependency as system path in maven.

Sambit
  • 7,625
  • 7
  • 34
  • 65