0

When there are multiple modules under a parent project, how to indicate jqassistant not to scan or analyze a particular module ? This is because I get below error while executing the jqassistant:scan,analyze with parent pom.xml. But when run individually, the scan & analyze are successful. Not sure about the cause of failure. So is there a way to skip this module from jqassistant scan & analyze ?

Maven Error

[ERROR] Failed to execute goal com.buschmais.jqassistant:jqassistant->maven-plugin:1.3.0:analyze (default-cli) on project >myXYZProjectIntegrationTests: Execution default-cli of goal >com.buschmais.jqassistant:jqassistant-maven-plugin:1.3.0:analyze failed: >More than one relationship[DECLARES, INCOMING] found for Node[80826] -> >[Help 1]

Maven Debug log :

[INFO] Applying concept 'customJU:LambdaMethods' with severity: '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 [{}]

Seems like "MERGE (method)-[:DECLARES]->(lambda)" fails if either side is empty. How to check if its a valid merge before merging?

Community
  • 1
  • 1
skpraveen
  • 183
  • 1
  • 5
  • 18

1 Answers1

1

Two answers:

  1. I stumbled over the same problem when extending the demo application, just replace

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

    with

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

    Note that any dependent constraints/concepts need to be changed accordingly to use DECLARES_LAMBDA instead of DECLARES. The reason behind is the ambiguity of DECLARES relations that cannot be handled by the reporting mechanism of jQAssistant.

  2. You can skip execution for a single Maven module by adding the following plugin config to the pom.xml:

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

    or simply

    <properties>
        <jqassistant.skip>true</jqassistant.skip>
    </properties>
    
Dirk Mahler
  • 1,186
  • 1
  • 6
  • 7