Maven插件/配置文件问题

时间:2016-08-02 12:50:24

标签: java maven jenkins testng

我是一名自动化qa工程师,我负责设置我们的Jenkins CI框架。我遇到的问题是Maven在构建阶段失败了。在查看日志时,有一些与我有关的事情,但我不确定它们是否相关或相关。请参阅下面的日志

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\dmohamed>mvn test -PCustomerFSNRegressionSuite
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
Envi_Test:Maven:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for com.qas.qtest.api:qtest-sdk-a
gent:jar should not point at files within the project directory, ${basedir}\src\
Libs\qtest-sdk-java-1.1.0.jar will be unresolvable by dependent projects @ line
42, column 17
[WARNING] 'dependencies.dependency.systemPath' for com.qas.qtest.api:qtest-testn
g-agent:jar should not point at files within the project directory, ${basedir}\s
rc\Libs\qtest-testng-agent-1.0.0.jar will be unresolvable by dependent projects
@ line 50, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Maven ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\dmohamed\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Maven ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Ma
ven ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\dmohamed\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Maven -
--
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ Maven ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.190 s
[INFO] Finished at: 2016-08-02T08:25:01-04:00
[INFO] Final Memory: 11M/307M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "CustomerFSNRegressionSuite" could not be activa
ted because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
19.1:test (default-test) on project Maven: Unable to parse configuration of mojo
 org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test for parameter proper
ties: Missing name in properties -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigur
ationException

C:\Users\dmohamed>

我的担忧特别是这些行

INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\dmohamed\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Maven ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Ma
ven ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 

C:\Users\dmohamed\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Maven -
    --
    [INFO] No sources to compile

WARNING] The requested profile "CustomerFSNRegressionSuite" could not be activa
ted because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
19.1:test (default-test) on project Maven: Unable to parse configuration of mojo
 org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test for parameter proper
ties: Missing name in properties -> [Help 1]

似乎当我尝试运行mvn命令时,它会尝试引用不存在的srs文件夹(不确定这是否有任何伤害)它不会识别我在我指定的TestnNG配置文件POM文件(我假设这会影响Jenkins)并且我的pom文件中存在一些属性/配置错误(根据我的日志中的ERROR消息)我无法解决。请参阅下面的我的POM文件

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>Envi_Test</groupId>
    <artifactId>Maven</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

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

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    </properties>
        <profiles>
        <profile>
            <id>CustomerFSNRegressionSuite</id>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.19.1</version>
                        <configuration>
                            <suiteXmlFiles>
                                <suiteXmlFile>testng.xml</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>


    </profiles>

    <dependencies>


        <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-chrome-driver</artifactId>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-testng</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>2.53.0</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-chrome-driver</artifactId>
                <version>2.53.0</version>
            </dependency>
            <dependency>
                <groupId>info.cukes</groupId>
                <artifactId>cucumber-testng</artifactId>
                <version>1.1.5</version>
            </dependency>

        </dependencies>

    </dependencyManagement>
</project>

任何帮助将不胜感激,如果这是一个转贴,我很抱歉,我看了,但我没有看到有关这种情况的问题。

0 个答案:

没有答案