0

我想为我们的团队使用 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).

我刚刚用第一个构建填充了商店,现在在第二个构建中,插件告诉我它重置了商店,但没有删除任何节点或关系。

有人可以解释我如何实现我想要做的事情吗?

4

2 回答 2

0

定义的行为是在扫描反应堆构建的第一个模块之前重置存储。因此,如果可以在同一个构建反应器中扫描所有必需的模块,则通常不需要显式地重置行为。

反之亦然: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部分中使用过)。

于 2021-07-25T11:16:31.403 回答
0

啊,现在我明白了问题所在:重置商店的配置被调用reset不是 resetStore。当我reset按照 Dirk Mahler 的建议使用时,一切正常!

我没有查看源代码,而是阅读了文档,这是错误的。我会在 GitHub 上写一个 bug。

德克,非常感谢您的支持!

于 2021-07-27T11:56:31.427 回答