重在思路
行内容器环境,tomcat版本是8.5,导致jar包冲突,优先调用了jar包中的方法,致使同名同路径下,改写的类方法失效,报java.lang.NoSuchMethodError错误,删除对应class后需要重新更新jar包到行内maven私服仓库,流程复杂,且不清楚哪些地方依然有重写方法的地方,设置tomcat加载jar包优先级的方式,jar包路径不够灵活,就把关键的几个jar包直接放入lib下,本地调用
Jar包依赖关系
<groupId>ibp</groupId>
<artifactId>ibp-parent、ibp-common-validator、ibp-common-workflow、ibp-coreservice</artifactId>
<version>1.2.1.20180408</version>
<groupId>ibp</groupId>
<artifactId>ibp-parent、ibp-api、ibp-common-attach、ibp-common-cache、ibp-common-echarts、ibp-login、ibp-sysmanage</artifactId>
<version>2.0.1.20200110</version>
<groupId>awp</groupId>
<artifactId>awp-parent、awp-common、awp-relation、awp-rpp、awp-search</artifactId>
<version>1.0-RELEASE</version>
<groupId>grc</groupId>
<artifactId>grc-parent</artifactId>
<version>1.0-SNAPSHOT、grc-xxx</version>8
ibp-sysmanage-2.0.1.20200110
1.在WEB-INF/lib下放入jar包
2.在grc-common模块pom文件修改引入方式,(注意:这种方式,自身依赖传递会失效)
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-sysmanage</artifactId>
<version>2.0.1.20200110</version>
<scope>system</scope>
<systemPath>${project.basedir}/../grc/src/main/webapp/WEB-INF/lib/ibp-sysmanage-2.0.1.20200110.jar</systemPath>
</dependency>
3.经过idea的maven树分析,ibp-sysmanage自身有效依赖,补充如下
<!--***代替ibp-sysmanage补充jar包 start****-->
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-api</artifactId>
<version>2.0.1.20200110</version>
</dependency>
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-common-cache</artifactId>
<version>2.0.1.20200110</version>
</dependency>
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-common-echarts</artifactId>
<version>2.0.1.20200110</version>
</dependency>
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-common-attach</artifactId>
<version>2.0.1.20200110</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<!--***代替ibp-sysmanage补充jar包 end****-->
4.查找引用ibp-sysmanage的jar包进行排除,
ibp-common-workflow和awp-common在grc-common模块引用
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-common-workflow</artifactId>
<version>${ibp.version}</version>
<exclusions>
...
<exclusion>
<groupId>ibp</groupId>
<artifactId>ibp-sysmanage</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>awp</groupId>
<artifactId>awp-common</artifactId>
<version>1.0-RELEASE</version>
<exclusions>
<exclusion>
<groupId>ibp</groupId>
<artifactId>ibp-sysmanage</artifactId>
</exclusion>
</exclusions>
</dependency>
因为grc-common已经引入awp-common,可以排除了awp-relation下的awp-common包,grc-bpa模块中引用了awp-relation
<dependency>
<groupId>awp</groupId>
<artifactId>awp-relation</artifactId>
<version>1.0-RELEASE</version>
<exclusions>
<exclusion>
<groupId>awp</groupId>
<artifactId>awp-common</artifactId>
</exclusion>
</exclusions>
</dependency>
ibp-common-workflow-1.2.1.20180408
1.在WEB-INF/lib下放入jar包
2.在grc-common模块pom文件修改引入方式,(注意:这种方式,自身依赖传递会失效)
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-common-workflow</artifactId>
<version>1.2.1.20180408</version>
<scope>system</scope>
<systemPath>${project.basedir}/../grc/src/main/webapp/WEB-INF/lib/ibp-common-workflow-1.2.1.20180408.jar</systemPath>
</dependency>
3.经过idea的maven树分析,ibp-common-workflow自身有效依赖,补充如下
<!--***代替ibp-common-workflow补充jar包 start***-->
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>5.17.0</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>5.17.0</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-rest</artifactId>
<version>5.17.0</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-modeler</artifactId>
<version>5.17.0</version>
</dependency>
<!--***代替ibp-common-workflow补充jar包 end***-->
ibp-coreservice-1.2.1.20180408
1.在WEB-INF/lib下放入jar包
2.在grc-common模块pom文件修改引入方式,(注意:这种方式,自身依赖传递会失效)
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-coreservice</artifactId>
<version>1.2.1.20180408</version>
<scope>system</scope>
<systemPath>${project.basedir}/../grc/src/main/webapp/WEB-INF/lib/ibp-coreservice-1.2.1.20180408.jar</systemPath>
</dependency>
3.经过idea的maven树分析,ibp-coreservice自身有效依赖,补充如下(好像不加也能启动)
<!--***代替ibp-coreservice补充jar包 start***-->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
</dependency>
<dependency>
<groupId>commons-dbutils</groupId>
<artifactId>commons-dbutils</artifactId>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<!--***代替ibp-coreservice补充jar包 end***-->
完整配置
启动成功,仓库不再下载相应jar包
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-sysmanage</artifactId>
<version>2.0.1.20200110</version>
<scope>system</scope>
<systemPath>${project.basedir}/../grc/src/main/webapp/WEB-INF/lib/ibp-sysmanage-2.0.1.20200110.jar</systemPath>
</dependency>
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-common-workflow</artifactId>
<version>1.2.1.20180408</version>
<scope>system</scope>
<systemPath>${project.basedir}/../grc/src/main/webapp/WEB-INF/lib/ibp-common-workflow-1.2.1.20180408.jar</systemPath>
</dependency>
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-coreservice</artifactId>
<version>1.2.1.20180408</version>
<scope>system</scope>
<systemPath>${project.basedir}/../grc/src/main/webapp/WEB-INF/lib/ibp-coreservice-1.2.1.20180408.jar</systemPath>
</dependency>
<dependency>
<groupId>awp</groupId>
<artifactId>awp-common</artifactId>
<version>1.0-RELEASE</version>
<exclusions>
<exclusion>
<groupId>ibp</groupId>
<artifactId>ibp-sysmanage</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--***代替ibp-common-workflow补充jar包 start***-->
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>5.17.0</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>5.17.0</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-rest</artifactId>
<version>5.17.0</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-modeler</artifactId>
<version>5.17.0</version>
</dependency>
<!--***代替ibp-common-workflow补充jar包 end***-->
<!--***代替ibp-sysmanage补充jar包 start****-->
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-api</artifactId>
<version>2.0.1.20200110</version>
</dependency>
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-common-cache</artifactId>
<version>2.0.1.20200110</version>
</dependency>
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-common-echarts</artifactId>
<version>2.0.1.20200110</version>
</dependency>
<dependency>
<groupId>ibp</groupId>
<artifactId>ibp-common-attach</artifactId>
<version>2.0.1.20200110</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<!--***代替ibp-sysmanage补充jar包 end****-->
<!--***代替ibp-coreservice补充jar包 start***-->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
</dependency>
<dependency>
<groupId>commons-dbutils</groupId>
<artifactId>commons-dbutils</artifactId>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<!--***代替ibp-coreservice补充jar包 end***-->