【问题标题】:Robot Framework Maven plug-in configuration issuesRobot Framework Maven 插件配置问题
【发布时间】:2020-09-30 08:08:48
【问题描述】:

我的项目 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?

谢谢!

【问题讨论】:

    标签: maven plugins robotframework


    【解决方案1】:

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

      <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>
    

    【讨论】:

      猜你喜欢
      • 2011-03-20
      • 2011-06-01
      • 2011-01-14
      • 1970-01-01
      • 2017-08-04
      • 1970-01-01
      • 1970-01-01
      • 2017-03-22
      • 1970-01-01
      相关资源
      最近更新 更多