Maven ant task not getting executed while running cucumber tests

旧城冷巷雨未停 提交于 2019-12-13 02:54:13

问题


We are trying to set up cucumber framework tests. We started with sample tests and it ran fine. I then updated maven to have maven profiles which will do certain tasks specific to that profile. I have profile QA_Smoke and have ant task under it ( for now simple echo) . I have set this profile as active maven profile but whenever I run the profile , task does not get executed. Instead it directly starts cucumber tests. Below is snapshot of maven profile.Can someone please tell,how can we execute maven tasks first then start cucumber tests-

<profile>
        <id>QA1_Smoke</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.6</version>
                    <executions>
                        <execution>
                            <phase>test</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <tasks>
                                    <echo>**********Running QA1 Smoke Tests*******************</echo>

                                </tasks>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

Further investigation shows that task is getting executed but after cucumber test execution. I would like to get this task executed first and then run cucumber tests. Any thoughts ? how can we do this ?

来源:https://stackoverflow.com/questions/56311533/maven-ant-task-not-getting-executed-while-running-cucumber-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!