由于执行目标失败导致构建失败错误org.apache.maven.plugins:maven-failsafe-plugin:2.18:integration-test

时间:2018-05-29 04:23:30

标签: maven selenium maven-2 maven-plugin

我的测试用例都已通过,但仍然存在构建失败错误

测试运行:12,失败:0,错误:0,跳过:0

[错误]无法执行目标org.apache.maven.plugins:maven-failsafe-plugin:2.18:项目StoreTestUiAutomation上的集成测试(默认):目标的执行默认值org.apache.maven.plugins:maven- failsafe-plugin:2.18:集成测试失败:java.lang.RuntimeException:org.apache.maven.surefire.report.ReporterException:无法为报告创建文件:C:\ Users \ Nageswar \ Desktop \ E-Florist \ qa -ui-automation \ target \ failsafe-reports_ smoketest.nageswar@qa.com _ Mine @ 123456 _ T11Z101A _新收件人_ 07470 _ Nageswar _饶_55宽街_8187828580 _生日_Nageswar _测试留言_签证_ 4111111111111111 _ 123 _ Jan _ 2022 _ Nageswar _ Pattipati _ 13 nevins rd _ Wayne _ New Jersey _美国_ 07470 _ 8187828580 _.txt(文件名,目录名或卷标语法不正确) - > [帮助1] [错误]

这是我的pom.xml

http://maven.apache.org/xsd/maven-4.0.0.xsd">     4.0.0

<groupId>net.serenity-bdd.demos</groupId>
<artifactId>StoreTestUiAutomation</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>StoreTest</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <serenity.version>1.2.4</serenity.version>
    <serenity.maven.version>1.2.4</serenity.maven.version>
    <serenity.cucumber.version>1.1.27</serenity.cucumber.version>
</properties>

<!-- Define the Bintray repos for convenience -->
<repositories>
    <repository>
        <id>serenity</id>
        <name>bintray</name>
        <url>http://dl.bintray.com/serenity/maven</url>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>serenity</id>
        <name>bintray-plugins</name>
        <url>http://dl.bintray.com/serenity/maven</url>
    </pluginRepository>
</pluginRepositories>

<dependencies>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-core</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-junit</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-rest-assured</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>${serenity.cucumber.version}</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.6.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.7</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-text</artifactId>
        <version>1.3</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.8.0</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
    <dependency>
        <groupId>com.sikulix</groupId>
        <artifactId>sikulixapi</artifactId>
        <version>1.1.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.opencsv/opencsv -->
    <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>3.2</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.4</version>
            <executions>
                <execution>
                    <id>enforce</id>
                    <configuration>
                        <rules>
                            <requireUpperBoundDeps />
                        </rules>
                    </configuration>
                    <goals>
                        <goal>enforce</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
    <testFailureIgnore>true</testFailureIgnore>
 </configuration>
 </plugin>
        <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.18</version>
            <configuration>
                <parallel>classes</parallel>
                <threadCount>1</threadCount>
                <argLine>-Xmx2048m</argLine>
                <forkCount>1</forkCount>
                <!-- <systemPropertyVariables> <webdriver.driver>${webdriver.driver}</webdriver.driver> 
                    </systemPropertyVariables> -->
                <includes>
                    <include>**/cucumber/junit/**/*.java</include>
                    <include>**/cucumber/*.java</include>
                </includes>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <classifier>exec</classifier>
            </configuration>
        </plugin>


        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>net.serenity-bdd.maven.plugins</groupId>
            <artifactId>serenity-maven-plugin</artifactId>
            <version>${serenity.maven.version}</version>
            <dependencies>
                <dependency>
                    <groupId>net.serenity-bdd</groupId>
                    <artifactId>serenity-core</artifactId>
                    <version>${serenity.version}</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <id>serenity-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

    </plugins>
</build>
<profiles>
    <profile>
        <id>firefox</id>
        <properties>
            <webdriver.driver>firefox</webdriver.driver>
        </properties>
    </profile>
    <profile>
        <id>chrome</id>
        <properties>
            <webdriver.driver>chrome</webdriver.driver>
            <webdriver.chrome.driver>chromedriver.exe</webdriver.chrome.driver>
        </properties>
    </profile>
    <profile>
        <id>phantomjs</id>
        <properties>
            <webdriver.driver>phantomjs</webdriver.driver>
        </properties>
    </profile>
</profiles>

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

假设您使用的是Windows操作系统,关键信息似乎如下:

&#34;文件名,目录名或卷标语法不正确。&#34;。请参阅以下链接https://msdn.microsoft.com/en-us/library/ms832054.aspx,其中给出了以下说明:

The system does not accept the keyboard combination Alt+0 through Alt+32 or the following characters: \\ \\ / [ ] : | < > + ; = . ? "

User Action:
Correct the file name or volume label and try the command again.

事实上,我从您的日志中看到以下文件名:

filename:
C:\Users\Nageswar\Desktop\E-Florist\qa-ui-automation\target\failsafe-reports_ smoketest.nageswar@qa.com _ Mine@123456 _ T11Z101A _ New Recipient _ 07470 _ Nageswar _ Rao _ 55 broad street _ 8187828580 _ Birthday _ Nageswar _ test message _ Visa _ 4111111111111111 _ 123 _ Jan _ 2022 _ Nageswar _ Pattipati _ 13 nevins rd _ Wayne _ New Jersey _ United States _ 07470 _ 8187828580 _.txt

我试图在Windows框中创建一个具有该名称的文件,但是从命令提示符开始,这是不可能的。我得到一个错误:

C:\Users\Nageswar\Desktop\E-Florist\qa-ui-automation\target>echo. 2>"failsafe-reports_ smoketest.nageswar@qa.com _ Mine@123456 _ T11Z101A _ New Recipient _ 07470 _ Nageswar _ Rao _ 55 broad street _ 8187828580 _ Birthday _ Nageswar _ test message _ Visa _ 4111111111111111 _ 123 _ Jan _ 2022 _ Nageswar _ Pattipati _ 13 nevins rd _ Wayne _ New Jersey _ United States _ 07470 _ 8187828580 _.txt"
Impossibile trovare il percorso specificato.    

如果我尝试从Windows资源管理器中执行此操作,它不会失败,但文件名会自动截断为:

failsafe-reports_ smoketest.nageswar@qa.com _ Mine@123456 _ T11Z101A _ New Recipient _ 07470 _ Nageswar _ Rao _ 55 broad street _ 8187828580 _ Birthday _ Nageswar _ test message _ Visa _ 4111111111111111 _ 123 _ Jan _ 2

或者,如果我保留扩展名:

failsafe-reports_ smoketest.nageswar@qa.com _ Mine@123456 _ T11Z101A _ New Recipient _ 07470 _ Nageswar _ Rao _ 55 broad street _ 8187828580 _ Birthday _ Nageswar _ test message _ Visa _ 4111111111111111 _ 123 _ Jan.txt

所以,我认为问题是文件名太长了。

希望这有帮助。