如何在jQAssistant中聚合具有复杂父结构的多模块maven项目的扫描结果?

时间:2017-02-17 03:58:40

标签: maven jqassistant

我遇到的问题是使用-Djqassistant.useExecutionRootAsProjectRoot=true在单个商店目录中聚合多模块maven项目的数据。

以下是我的项目结构

root-project [NO PARENT]
----/project-A [PARENT company-parent-pom-A]
----/project-B [PARENT company-parent-pom-B]

我在根项目上运行以下内容

mvn clean install -DskipTests=true com.buschmais.jqassistant:jqassistant-maven-plugin:1.2.0:scan -Djqassistant.useExecutionRootAsProjectRoot=true

但它显示以下错误。

Failed to execute goal com.buschmais.jqassistant:jqassistant-maven-plugin:1.2.0:scan (default-cli) on project root-project: Cannot re-use store instance from reactor. Either declare the plugin as extension or execute Maven using the property -Djqassistant.store.lifecycle=MODULE on the command line.

所以我添加-Djqassistant.store.lifecycle=MODULE并运行以下

mvn clean install -DskipTests=true com.buschmais.jqassistant:jqassistant-maven-plugin:1.2.0:scan -Djqassistant.useExecutionRootAsProjectRoot=true -Djqassistant.store.lifecycle=MODULE

现在构建成功了。但是在最后扫描根项目时,插件会重置商店目录。因此,之前收集的所有数据都将被删除。这是jqa-maven-plugin的问题还是我做错了什么?

19984 [INFO] --- jqassistant-maven-plugin:1.2.0:scan (default-cli) @ project-B ---
22034 [INFO] Loaded jQAssistant plugins [Common, Core Analysis, JUnit, Java, Maven 3, XML].
22082 [INFO] Opening store in directory '/home/mehedi/Develop/WorkSpace/jqa-projects/test-project/target/jqassistant/store'.
24227 [INFO] Resetting store.
27464 [INFO] Reset finished.
28887 [INFO] Entering /home/mehedi/Develop/WorkSpace/jqa-projects/test-project/project-B/target/classes
29861 [INFO] Leaving /home/mehedi/Develop/WorkSpace/jqa-projects/test-project/project-B/target/classes (183 entries, 972 ms)
29864 [INFO] Entering /home/mehedi/Develop/WorkSpace/jqa-projects/test-project/project-B/target/test-classes
29874 [INFO] Leaving /home/mehedi/Develop/WorkSpace/jqa-projects/test-project/project-B/target/test-classes (12 entries, 10 ms)
30823 [INFO] Closing store in directory '/home/mehedi/Develop/WorkSpace/jqa-projects/test-project/target/jqassistant/store'.

...

124415 [INFO] --- jqassistant-maven-plugin:1.2.0:scan (default-cli) @ project-A ---
124423 [INFO] Opening store in directory '/home/mehedi/Develop/WorkSpace/jqa-projects/test-project/target/jqassistant/store'.
124971 [INFO] Entering /home/mehedi/Develop/WorkSpace/jqa-projects/test-project/project-A/target/classes
124973 [INFO] Leaving /home/mehedi/Develop/WorkSpace/jqa-projects/test-project/project-A/target/classes (2 entries, 1 ms)
125222 [INFO] Closing store in directory '/home/mehedi/Develop/WorkSpace/jqa-projects/test-project/target/jqassistant/store'.

...

138156 [INFO] --- jqassistant-maven-plugin:1.2.0:scan (default-cli) @ root-project ---
139411 [INFO] Loaded jQAssistant plugins [Common, Core Analysis, JUnit, Java, Maven 3, XML].
139448 [INFO] Opening store in directory '/home/mehedi/Develop/WorkSpace/jqa-projects/test-project/target/jqassistant/store'.
140780 [INFO] Resetting store.
146562 [INFO] Reset finished.
147842 [INFO] Closing store in directory '/home/mehedi/Develop/WorkSpace/jqa-projects/test-project/target/jqassistant/store'.

1 个答案:

答案 0 :(得分:0)

您正在描述的设置应该正常工作,因此您很可能发现了错误。您能否在https://github.com/buschmais/jqa-maven-plugin上报告此事?