0

当父项目下有多个模块时,如何指示jqassistant不扫描或分析特定模块?这是因为我在执行 jqassistant:scan,analyze with parent pom.xml 时遇到以下错误。但是单独运行时,扫描和分析是成功的。不确定失败的原因。那么有没有办法从 jqassistant scan & analyze 跳过这个模块?

Maven 错误

[错误] 无法在项目 >myXYZProjectIntegrationTests 上执行目标 com.buschmais.jqassistant:jqassistant->maven-plugin:1.3.0:analyze (default-cli):执行目标的默认 cli >com.buschmais.jqassistant:jqassistant- maven-plugin:1.3.0:analyze failed:>为节点[80826]找到多个关系[DECLARES,INCOMING] -> >[Help 1]

Maven调试日志:

[INFO] 应用概念 'customJU:LambdaMethods' 严重性:'MINOR'。

[DEBUG] Executing query '
                 MATCH
  (type:Type)-[:DECLARES]->(lambda:Method)
WHERE
  exists(lambda.synthetic)
  and exists(lambda.static)
  and lambda.name starts with("lambda$")
SET
  lambda:Lambda
WITH
  type, lambda
MATCH
  (type)-[:DECLARES]->(method:Method)
WHERE
  method <> lambda
  and method.firstLineNumber <= lambda.firstLineNumber
  and method.lastLineNumber >= lambda.lastLineNumber
MERGE
  (method)-[:DECLARES]->(lambda)
RETURN
  method as lambdaMethod
        ' with parameters [{}]

如果任一侧为空,则似乎“合并(方法)-[:DECLARES]->(lambda)”失败。如何在合并之前检查它是否是有效的合并?

4

1 回答 1

1

两个答案:

  1. 我在扩展演示应用程序时偶然发现了同样的问题,只需替换

    MERGE
      (method)-[:DECLARES]->(lambda)
    

    MERGE
      (method)-[:DECLARES_LAMBDA]->(lambda)
    

    请注意,任何相关的约束/概念都需要相应地更改以使用 DECLARES_LAMBDA 而不是 DECLARES。背后的原因是 jQAssistant 的报告机制无法处理 DECLARES 关系的模糊性。

  2. 您可以通过将以下插件配置添加到 pom.xml 来跳过单个 Maven 模块的执行:

    <build>
        <plugins>
            <plugin>
                <groupId>com.buschmais.jqassistant</groupId>
                <artifactId>jqassistant-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>
    

    或者干脆

    <properties>
        <jqassistant.skip>true</jqassistant.skip>
    </properties>
    
于 2018-05-02T08:59:50.190 回答