Robot Framework Maven插件配置问题

Robot Framework Maven plug-in configuration issues

我的项目 pom 文件中有这个:

  <build>
    <plugins>
      <plugin>
        <groupId>org.robotframework</groupId>
        <artifactId>robotframework-maven-plugin</artifactId>
        <version>1.7.1</version>
        <executions>
          <execution>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <testCasesDirectory>path/to/testcases</testCasesDirectory>
              <extraPathDirectories>
                <extraPathDirectory>path/to/python/Lib</extraPathDirectory>
              </extraPathDirectories>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

我想 运行 机器人测试使用

mvn robotframework:run

但是当我这样做时,它不识别我的配置,仍然转到默认的测试源文件夹(/src/test/robotframework/acceptance),它也不识别添加的 extraPathDirectory。

但是,当我在 cmd 行中指定时它有效

mvn robotframework:run -DtestCasesDirectory=path/to/testcases

或者当我 运行

mvn install

为什么我不能使用 mvn robotframework:run?

谢谢!

我通过简单地将配置移到执行块之外设法解决了我的问题。

  <build>
    <plugins>
      <plugin>
        <groupId>org.robotframework</groupId>
        <artifactId>robotframework-maven-plugin</artifactId>
        <version>1.7.1</version>
        <configuration>
          <testCasesDirectory>path/to/testcases</testCasesDirectory>
          <extraPathDirectories>
            <extraPathDirectory>path/to/python/Lib</extraPathDirectory>
          </extraPathDirectories>
          <libdoc/>
          <testdoc/>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>