neo4j - jQAssistant:商店重置是如何工作的?
问题描述
我想为我们的团队使用 jQAssistant。我根据https://101.jqassistant.org/setting-up-a-team-server/index.html安装了它,所以我有一个独立于 jQAssistant 运行的外部 Neo4j 商店。
我想在夜间构建期间扫描我们的软件并获得最新信息。所以我的想法是在每晚构建之前使用重置:
<!-- Use this profile to reset the jQAssistant store (database) -->
<profile>
<id>jqassistant-reset</id>
<build>
<plugins>
<plugin>
<groupId>com.buschmais.jqassistant</groupId>
<artifactId>jqassistant-maven-plugin</artifactId>
<executions>
<execution>
<id>reset-store</id>
<phase>clean</phase>
<goals>
<goal>reset</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
然后我会遍历每个 Maven 模块并扫描它:
<pluginManagement>
<plugin>
<groupId>com.buschmais.jqassistant</groupId>
<artifactId>jqassistant-maven-plugin</artifactId>
<version>1.9.1</version>
<configuration>
<store>
<uri>bolt://my-neo4j-store.com:7687</uri>
<username>neo4j</username>
<password>reallysecret</password>
<encryption>false</encryption>
</store>
<configuration>
<resetStore>false</resetStore>
</configuration>
<continueOnError>true</continueOnError>
</configuration>
</plugin>
</pluginManagement>
...
<!-- Use this profile to gather information using jQAssistant -->
<profile>
<id>jqassistant</id>
<build>
<plugins>
<plugin>
<groupId>com.buschmais.jqassistant</groupId>
<artifactId>jqassistant-maven-plugin</artifactId>
<executions>
<execution>
<id>scan-software</id>
<phase>package</phase>
<goals>
<goal>scan</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
但是,我看到令人困惑的日志消息:
[INFO] --- jqassistant-maven-plugin:1.9.1:scan (scan-software) @ foobar ---
[INFO] Scanning for jQAssistant plugins...
[INFO] [Asciidoc Report, CDI, Common, Core Analysis, Core Report, EJB3, GraphML, GraphQL, JAX-RS, JPA 2, JSON, JUnit, Java, Java EE 6, Maven 2 Repository, Maven 3, OSGi, RDBMS, Spring, TestNG, Tycho, XML, YAML].
[INFO] Connecting to store at 'bolt://my-neo4j-store.com:7687' (username=neo4j)
Jul 12, 2021 9:46:59 AM org.neo4j.driver.internal.logging.JULogger info
INFORMATION: Direct driver instance 839477204 created for server address my-neo4j-store.com:7687
[INFO] Resetting store.
[INFO] Reset finished (removed 0 nodes, 0 relations).
[INFO] Entering /foobar/target/classes
[INFO] Leaving /foobar/target/classes (70 entries, 307558 ms)
[INFO] Entering /foobar/target/test-classes
[INFO] Leaving /foobar/target/test-classes (70 entries, 1422 ms)
[INFO] Entering /foobar/target/surefire-reports
[INFO] Leaving /foobar/target/surefire-reports (46 entries, 1127 ms)
我不明白为什么我会看到,Resetting store.
尽管我已经在配置中关闭了它。
然而,更让我困惑的是,当再次启动 Maven 构建时,我看到了:
[INFO] Resetting store.
[INFO] Reset finished (removed 0 nodes, 0 relations).
我刚刚用第一个构建填充了商店,现在在第二个构建中,插件告诉我它重置了商店,但没有删除任何节点或关系。
有人可以解释我如何实现我想要做的事情吗?
解决方案
定义的行为是在扫描反应堆构建的第一个模块之前重置存储。因此,如果可以在同一个构建反应器中扫描所有必需的模块,则通常不需要显式地重置行为。
反之亦然:mvn package
如果应扩展来自先前反应堆构建的现有扫描,则必须为构建反应堆内的扫描(例如命令)停用重置。
扫描目标的重置行为可以通过重置标志来控制:
<plugin>
<groupId>com.buschmais.jqassistant</groupId>
<artifactId>jqassistant-maven-plugin</artifactId>
<configuration>
<store>
<uri>bolt://my-neo4j-store.com:7687</uri>
<username>neo4j</username>
<password>reallysecret</password>
<encryption>false</encryption>
</store>
<reset>false</reset> <!-- true is the default setting to clear the store at the beginning of each reactor build -->
</configuration>
</plugin>
请更新您的配置(您resetStore
在另一configuration
部分中使用过)。
推荐阅读
- c# - Entity Framework Core:无法在生产服务器上运行迁移脚本,聚集索引的最大键长度为 900 字节
- java - EDT(Java)的问题如何拆分几个动作/事件
- javascript - 在 vue 中将链接数组从父级传递给子级(创建链接菜单)
- javascript - 多个 Ajax 请求相互等待运行
- python - Pandas groupby 值差异很小
- bash - 如何使用 shell 脚本获取文件中的最小值
- java - 如何强制 Tomcat 接受 DispatcherServlet url 映射,以编程方式配置?
- javascript - Javascript 更新变量
- android - Android studio intellisense 无法解析导入时的符号
- json - TypeError: JSON.stringify(...).then 不是一个函数 - React JS