image.png

方案一 利用CodeQL提供的功能

https://codeql.github.com/docs/codeql-cli/creating-codeql-databases/

image.png

  1. codeql database create ehr-ql -l java --command="mvn clean compile -P pre -Dmaven.test.skip=true" --command="mvn clean compile -P pre -Dmaven.test.skip=true -f lbatis\pom.xml"

TODO
一个command利用Maven编译目标项目,第二个command利用Ant编译JSP文件,第三个command利用fernflower反编译jar包

使用fernflower反编译jar包
https://www.cnblogs.com/whytohow/p/6130623.html

方案二 利用Maven提供的功能

Maven Aggregate

利用Maven聚合可以实现一条mvn命令同时构建多个项目。

假设我们要同时构建ehr和lbatis两个项目,我们需要再创建一个项目,例如ehr-egg,然后在ehr-egg中创建pom.xml,然后在里面指定ehr和lbatis两个模块。

目录结构如下所示
image.png
pom.xml文件内容如下所示

image.png
然后在该目录下按往常一样执行编译CodeQL数据库的命令即可将ehr项目跟lbatis编译到一个CodeQL数据库中。