我在jenkins上运行maven项目时遇到错误

时间:2016-08-17 10:10:00

标签: maven jenkins

jenkins的控制台输出 - [错误]无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test(default-test)on project apportalautomation:执行default-test of goal org.apache.maven.plugins:maven -surefire-plugin:2.19.1:测试失败:分叉进程出错

*Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.849 s
[INFO] Finished at: 2016-08-17T13:24:24+05:30
[INFO] Final Memory: 22M/282M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project apportalautomation: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
[ERROR] org.apache.maven.surefire.testset.TestSetFailedException: Suite file D:\tejas PC\1MobilityFrameWork\1M_AP_Portal_Automation\testng_po.xml is not a valid file
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.locateTestSets(TestNGXmlTestSuite.java:98)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE

以下是我的pom文件         http://maven.apache.org/xsd/maven-4.0.0.xsd">             4.0.0

        <groupId>apportalautomation</groupId>
        <artifactId>apportalautomation</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>jar</packaging>

        <name>apportalautomation</name>
        <url>http://maven.apache.org</url>

        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>
        <build>
            <!-- Source directory configuration -->
            <sourceDirectory>src</sourceDirectory>
            <plugins>
                <!-- Following plugin executes the testng tests -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.19.1</version>
                    <configuration>
                        <!-- Suite testng xml file to consider for test execution -->
                        <suiteXmlFiles>
                            <suiteXmlFile>testng_po.xml</suiteXmlFile>
                        </suiteXmlFiles>
                    </configuration>
                </plugin>
                <!-- Compiler plugin configures the java version to be usedfor compiling 
                    the code -->
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
            </plugins>
        </build>

        <dependencies>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.8</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>2.53.0</version>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi</artifactId>
                <version>3.14</version>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml</artifactId>
                <version>3.14</version>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml-schemas</artifactId>
                <version>3.14</version>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-scratchpad</artifactId>
                <version>3.14</version>
            </dependency>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.17</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.4</version>
            </dependency>
            <dependency>
                <groupId>com.opencsv</groupId>
                <artifactId>opencsv</artifactId>
                <version>3.3</version>
            </dependency>
        </dependencies>
    </project>

以下是我的testng.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Default suite">

    <parameter name="appURL"
        value="https://ssg:*ssg!@123@ap58.smartsourcingglobal.net" />
    <parameter name="browserType" value="firefox" />

    <listeners>
        <listener class-name="com.onemobility.apportal.utils.ScreenshotUtils" />
    </listeners>

    <test verbose="2" name="Default test">
        <classes>
            <class name="com.onemobility.apportal.tests.LoginPageTest" />
            <class name="com.onemobility.apportal.tests.ForgotPasswordTest" />
            <class name="com.onemobility.apportal.tests.DashboardTest" />
            <class name="com.onemobility.apportal.tests.OrganizationLocationTest" />
            <class name="com.onemobility.apportal.tests.OrganizationGroupsTest" />
            <class name="com.onemobility.apportal.tests.OrganizationEULATest" />
            <class name="com.onemobility.apportal.tests.OrganizationAddGroupTest" />
            <class name="com.onemobility.apportal.tests.OrganizationAddLocationTest" />
            <class name="com.onemobility.apportal.tests.OrganizationAddEULATest" />
            <class name="com.onemobility.apportal.tests.ReportsLoginHistoryTest" />
            <class name="com.onemobility.apportal.tests.OrganizationRolesTest" />
            <class name="com.onemobility.apportal.tests.OrganizationAddRoleTest" />
            <class name="com.onemobility.apportal.tests.OrganizationUsersTest" />
            <class name="com.onemobility.apportal.tests.OrganizationAddUserTest" />
            <class name="com.onemobility.apportal.tests.OrganizationAppStoreTest" />
            <class name="com.onemobility.apportal.tests.OrganizationAddAppTest" />
            <class name="com.onemobility.apportal.tests.ProfilesDeviceProfilesTest" />
            <class name="com.onemobility.apportal.tests.ReportsUserTest" />
            <class name="com.onemobility.apportal.tests.ReportsApplicationTest" />
            <class name="com.onemobility.apportal.tests.ReportsDeviceTest" />
            <class name="com.onemobility.apportal.tests.DIYUserPortalTest" />
            <class name="com.onemobility.apportal.tests.HelpPortalTest" />
        </classes>
    </test> <!-- Default test -->
</suite> <!-- Default suite -->

0 个答案:

没有答案