SapJco 3.0.11 with Maven: It is not allowed to rename or repackage the original archive “sapjco3.jar”

强颜欢笑 提交于 2019-12-05 19:08:19

I had the same issue, and below is how I fixed it (in short work around it): 1. Run the command in command prompt

mvn install:install-file 
-Dfile=sapjco3.jar 
-DgroupId=com.company.sap 
-DartifactId=com.sap.conn.jco.sapjco 
-Dversion=1.0 
-Dpackaging=jar
  1. This will create a local artifact, or you can also create it in remote repository
  2. Download this dependency from maven as shown below:

    <dependency> <groupId>com.company.sap</groupId> <artifactId>com.sap.conn.jco.sapjco</artifactId> <version>1.0</version> </dependency>

This work around would avoid the sapjco3 error:

if (!jarname.equals("sapjco3.jar") 
&& !jarname.startsWith("com.sap.conn.jco") 
&& !jarname.equals("sapjco3_IDE.jar") 
&& Package.getPackage("org.apache.maven.surefire.booter") == null 
&& Package.getPackage("org.eclipse.jdt.internal.junit.runner") == null) {
    throw new ExceptionInInitializerError("Illegal JCo archive \"" + jarname + "\". It is not allowed to rename or repackage the original archive \"" + "sapjco3.jar" + "\".");
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!