我想为我们的团队使用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).我只是用第一个构建填充了存储,现在在第二个构建中,插件告诉我它重置了存储,但没有删除任何节点或关系。
有人能解释一下我如何才能实现我想要做的事情吗?
发布于 2021-07-25 19:16:31
定义的行为是这样的,即在扫描反应堆构建的第一个模块之前重置存储。因此,如果所有需要的模块都可以在同一个构建的反应堆中扫描,则通常不需要显式地重置行为。
反之亦然:如果先前反应堆构建的现有扫描需要扩展,则必须为构建反应堆内的扫描停用重置(例如,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>请更新您的配置(您在另一个configuration部分中使用了resetStore )。
发布于 2021-07-27 19:56:31
啊,现在我知道问题是什么了:重置存储的配置是reset和,而不是 resetStore。当我按照Dirk Mahler的建议使用reset时,一切都很好!
我读取的是documentation,而不是looking at the source,这是错误的。我将在GitHub中写一个bug。
Dirk,非常感谢你的支持!
https://stackoverflow.com/questions/68343954
复制相似问题