jQassistant评估在多个项目中失败。

huangapple go评论83阅读模式
英文:

jQassistant assessment failing with multiple projects

问题

我正在使用 jqassistant-maven-plugin 版本 1.10.1 与通用的 Neo4j 数据库,并尝试汇总来自多个基于 Spring Boot 的 Java 应用程序的扫描信息。我已禁用了重置数据库,以便我可以汇总来自多个项目的扫描信息,并识别从其他应用程序内调用 API 服务的 API 客户端,并查看是否存在循环依赖关系。当我这样做时,第一次 Maven 构建正常工作。但是,当我运行第二个应用程序扫描时,它失败,并显示以下错误:

> org.neo4j.driver.exceptions.DatabaseException:当起始节点和结束节点相同时,最短路径算法不起作用。这可能发生在经过笛卡尔积之后执行最短路径搜索时,某些行可能具有相同的起始和结束节点。如果您不想遇到此异常,并可以接受对这些行的一些结果丢失的可能性,请在 Neo4j 配置中将 cypher.forbid_shortestpath_common_nodes 设置为 false。如果您不能接受结果丢失,并确实需要两个常见节点之间的最短路径,则重新编写查询,使用标准的 Cypher 变量长度模式表达式,然后按路径长度排序并限制为一个结果。

类的包名称不同,可能会有一些类具有相似的名称,但完全限定的名称不应导致名称冲突。不确定是什么原因导致了这个问题,也不知道如何解决。任何帮助将不胜感激。

编辑 失败的查询如下:

UNWIND $batch as entry 
CREATE (n:File:Directory:Package:Java) 
SET n=entry['n']   
RETURN collect({oldId:entry['id'], newId:id(n)}) as nodes', {batch=[{n={name=controller, file
Name=/com/mycompany/client/controller, fqn=com.mycompany.client.controller}, id=-9}]} 

很不幸,我无法控制生成的查询,因为它是由 jqassistant-maven-plugin 自动生成的。

英文:

I'm using jqassistant-maven-plugin version 1.10.1 with common Neo4j database and am trying to collate scanning from multiple Spring boot based java applications. I've disabled reset database so that I can collate scan information from multiple projects and identify API clients invoking API services from within other apps and see if there is any cyclic dependencies. When I do so the first maven build is working fine. But when I run the second application scan, it fails with the below error:

>org.neo4j.driver.exceptions.DatabaseException: The shortest path algorithm does not work when the start and end nodes are the same. This can happen if you
perform a shortestPath search after a cartesian product that might have the same start and end nodes for some
of the rows passed to shortestPath. If you would rather not experience this exception, and can accept the
possibility of missing results for those rows, disable this in the Neo4j configuration by setting
cypher.forbid_shortestpath_common_nodes to false. If you cannot accept missing results, and really want the
shortestPath between two common nodes, then re-write the query using a standard Cypher variable length pattern
expression followed by ordering by path length and limiting to one result.

The package names of the class are different and there may be couple of classes that might be named similar but the fully qualified names should not create a name collision. Not sure what's causing this and how to resolve this. Any help would be appreciated.

EDIT The query that's failing is given below:

UNWIND $batch as entry 
CREATE (n:File:Directory:Package:Java) 
SET n=entry['n']   
RETURN collect({oldId:entry['id'], newId:id(n)}) as nodes', {batch=[{n={name=controller, file
Name=/com/mycompany/client/controller, fqn=com.mycompany.client.controller}, id=-9}]}

Unfortunately I don't have control on the query generated as its auto generated by the jqassistant-maven-plugin.

答案1

得分: 0

感谢@dirk-mahler。我能够使用最新版本的命令行jqassistant 1.12.2扫描多个项目。我之前使用了较旧版本的jqassistant Maven插件1.10.1,但出现了一些奇怪的错误。

英文:

Thanks to @dirk-mahler. I was able to scan multiple projects with the latest version command line jqassistant 1.12.2. I was using an older version of the jqassistant maven plugin 1.10.1 and it was failing with some weird errors.

huangapple
  • 本文由 发表于 2023年7月18日 14:15:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76709965.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定