简体   繁体   English

如何使用maven-antrun-plugin在pom文件中设置多个fitnesse套件? 以及如何在配置的套装中调用特定套件?

[英]How to setup multiple fitnesse suites in pom file using maven-antrun-plugin ? and how to call the specific suite run among the configured suits?

I am able to run the FitNesse suite from maven build with the following setup. 我可以使用以下设置从maven build运行FitNesse suite

<properties>
    <fitnesse.version>20160618</fitnesse.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.fitnesse</groupId>
        <artifactId>fitnesse</artifactId>
        <version>${fitnesse.version}</version>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>org.fitnesse.plugins</groupId>
        <artifactId>maven-classpath-plugin</artifactId>
        <version>1.6</version>
        <scope>runtime</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <id>start-fitnesse-integration</id>
                    <phase>integration-test</phase>
                    <configuration>
                        <tasks>
                            <echo taskname="fitnesse" message="Starting FitNesse..." />
                            <java classname="fitnesseMain.FitNesseMain" classpathref="maven.runtime.classpath"
                                fork="true" failonerror="true">
                                <jvmarg value="-Xmx1024m" />
                                <arg line="-p 9000" />
                                <arg line="-c FrontPage.TestSuite?suite&amp;amp;format=text" />
                                <arg line="-e 0" />
                                <!-- <arg line="-d ." /> -->
                            </java>
                        </tasks>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

I am running the FitNesse suite using the below command. 我正在使用以下命令运行FitNesse suite

mvn clean install

Now I want to configure execution of multiple FitNesse suites as part of pom.xml and want to run specific suite as part of maven build. 现在我想配置多个FitNesse suites执行作为pom.xml一部分,并希望将特定套件作为maven构建的一部分运行。

How can I achieve this? 我怎样才能做到这一点?

There are a couple of ways to configure multiple suites to be run: 有几种方法可以配置要运行的多个套件:

  • Add multiple execution elements to your pom (inside the executions element you already have) one per suite, each with a unique id 在每个套件中为您的pom(在您已经拥有的executions元素内)添加多个execution元素,每个元素都有一个唯一的id
  • Place all suites you want to run under a shared parent suite (and run the parent suite). 将您想要在共享父套件下运行的所有套件放置(并运行父套件)。 You can also use symbolic links to achieve this. 您还可以使用符号链接来实现此目的。
  • Create a suite query page to indicate which suites should be run (and run that page). 创建套件查询页面以指示应运行哪些套件(并运行该页面)。
  • Create a suite cross reference page and run that 创建套件交叉引用页面并运行它
  • Give all suites the same tag and use filters to select all suites to run based on the tag 为所有套件提供相同的标签,并使用过滤器根据标签选择要运行的所有套件

PS Why are you using the antrun plugin instead of maven-exec ? PS为什么你使用antrun插件而不是maven-exec

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM