Maven surefire插件无需编译 - 所有类都是最新的

时间:2014-10-19 04:37:26

标签: eclipse maven-surefire-plugin

当我跑干净的测试或 在eclipse中清理测试-DsuiteFile = src / main / resources / testng / SmokeTestSuite.xml 以下是输出。没有测试运行,但Build是成功的。 我已经为这个问题奋斗了好几周。如果有人能解释我的问题和解决方案,那就太棒了。

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building eselenium-ellis-tests 0.0.1
[INFO] ------------------------------------------------------------------------
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Downloading: https://devops-tools.pearson.com/nexus-master/content/repositories/releases/com/pearson/eselenium-pageobjects-ellis/1.0.1-SNAPSHOT/maven-metadata.xml
Downloading: https://devops-tools.pearson.com/nexus-deps/content/groups/all-deps/com/pearson/eselenium-pageobjects-ellis/1.0.1-SNAPSHOT/maven-metadata.xml
Downloaded: https://devops-tools.pearson.com/nexus-deps/content/groups/all-deps/com/pearson/eselenium-pageobjects-ellis/1.0.1-SNAPSHOT/maven-metadata.xml (788 B at 0.2 KB/sec)
Downloading: https://devops-tools.pearson.com/nexus-deps/content/groups/all-deps/com/pearson/eselenium-pageobjects-ellis/1.0.1-SNAPSHOT/maven-metadata.xml
Downloading: https://devops-tools.pearson.com/nexus-master/content/repositories/releases/com/pearson/eselenium-pageobjects-ellis/1.0.1-SNAPSHOT/maven-metadata.xml
Downloaded: https://devops-tools.pearson.com/nexus-deps/content/groups/all-deps/com/pearson/eselenium-pageobjects-ellis/1.0.1-SNAPSHOT/maven-metadata.xml (788 B at 0.2 KB/sec)
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ eselenium-ellis-tests ---
[INFO] Deleting C:\ATDD\workspace\galaxy-tests\target
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ eselenium-ellis-tests ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 8 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ eselenium-ellis-tests ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 19 source files to C:\ATDD\workspace\galaxy-tests\target\classes
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ eselenium-ellis-tests ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ eselenium-ellis-tests ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ eselenium-ellis-tests ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.003s
[INFO] Finished at: Sun Oct 19 09:48:48 IST 2014
[INFO] Final Memory: 20M/153M
[INFO] ------------------------------------------------------------------------

AND我的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>com.pearson</groupId>
    <artifactId>eselenium-ellis-tests</artifactId>
    <version>0.0.1</version>
    <properties>
        <suiteXmlFile>${suiteFile}</suiteXmlFile>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.pearson</groupId>
            <artifactId>eselenium.framework</artifactId>
            <version>1.2.0</version>
        </dependency>
        <dependency>
            <groupId>com.pearson</groupId>
            <artifactId>eselenium-pageobjects-ellis</artifactId>
            <version>1.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.5.2</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                    <suiteXmlFiles>
                        <suiteXmlFile>${suiteFile}</suiteXmlFile>
                        <!--<suiteXmlFile>src/main/resources/testng/SmokeTestSuite.xml</suiteXmlFile> -->
                    </suiteXmlFiles>
                    <reportsDirectory>test-output</reportsDirectory>
                    <reportsDirectory>test-output\archive\${timestamp}</reportsDirectory>
                    <systemProperties>
                        <property>
                            <name>browser.NAME</name>
                            <value>${browser.NAME}</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
        </plugins>
    </build>

1 个答案:

答案 0 :(得分:-1)

您的问题实际上无法从命令提示符提供pom.xml值。

的副本

Passing command line arguments from Maven as properties in pom.xml

你会在那里找到解决方案。你需要加倍引用你的参数。