exec-maven-plugin不能在jenkins上运行

时间:2014-02-21 09:22:31

标签: maven jenkins jasmine phantomjs

有谁可以帮我这个, 当我在eclipse中构建我的应用程序时,我的jasmine javascript单元测试成功运行:

    [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ sig ---
    [INFO] Installing C:\Users\C5168279\git\smsigcom.sap.solman.graphical.component.sig\SMSIG\target\sig.war to C:\Users\C5168279\.m2\repository\com\sap\solman\graphical\component\sig\1.0.0\sig-1.0.0.war
    [INFO] Installing C:\Users\C5168279\git\smsigcom.sap.solman.graphical.component.sig\SMSIG\pom.xml to C:\Users\C5168279\.m2\repository\com\sap\solman\graphical\component\sig\1.0.0\sig-1.0.0.pom
    [INFO] 
    [INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) @ sig ---
    2014-02-20 17:35:35 Device API logging initialized - DEVICE
    2014-02-20 17:35:35 registerResourcePath ('', 'https://sapui5.hana.ondemand.com/resources/') -  sap.ui.ModuleSystem
    2014-02-20 17:35:35 URL prefixes set to: -  sap.ui.ModuleSystem
    2014-02-20 17:35:35   (default) : https://sapui5.hana.ondemand.com/resources/ -  sap.ui.ModuleSystem
    XMLHttpRequest cannot load https://sapui5.hana.ondemand.com/resources/sap/ui/controller/library-preload.json. Origin file:// is not allowed by Access-Control-Allow-Origin.
    2014-02-20 17:35:37 failed to preload 'sap.ui.controller.library-preload': Error: NETWORK_ERR: XMLHttpRequest Exception 101 -  sap.ui.ModuleSystem
    XMLHttpRequest cannot load https://sapui5.hana.ondemand.com/resources/sap/ui/controller/library.js. Origin file:// is not allowed by Access-Control-Allow-Origin.
    Error: failed to load 'sap/ui/controller/library.js' from https://sapui5.hana.ondemand.com/resources/sap/ui/controller/library.js: 0 - Error: NETWORK_ERR: XMLHttpRequest Exception 101

file:///C:/Users/C5168279/git/smsigcom.sap.solman.graphical.component.sig/SMSIG/src/test/js_unit/AppCoreController.Test.js:1
    Runner Started.
    MainController : should check if all parameters are empty , ags_sig_app.Views.Main : Graph.checkParameters() ... 
    Failed.
    MainController : should check that the GraphID exist for Display Mode, ags_sig_app.Views.Main : Graph.checkParameters() ... 
    Failed.
    MainController : should check that the Context Parameters exist for SMUD Graph Providers, ags_sig_app.Views.Main : Graph.checkParameters() ... 
    Failed.
    MainController : should check that the GraphMode exist, ags_sig_app.Views.Main : Graph.checkParameters() ... 
    Failed.
    MainController : should check that Display scenario is ok, ags_sig_app.Views.Main : Graph.checkParameters() ... 
    Failed.

但是,当我在Jenkins中部署我的应用程序时,Jenkins未检测到测试用例 exec-maven-plugin不能在jenkins上运行。

[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ SMGC ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ SMGC ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory d:\.jenkins\jobs\com.sap.solman.graphical.component.sig.git\workspace\gitRepo\SMSIG\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ SMGC ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ SMGC ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.676s
[INFO] Finished at: Thu Feb 20 17:23:29 CET 2014
[INFO] Final Memory: 13M/491M
[INFO] ------------------------------------------------------------------------
Finished: SUCCESS

这是我的pom.xml插件:

<plugins>

                <!-- Run jasmine unit tests with phantomjs ************************* -->

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.2.1</version>
                    <executions>
                        <execution>
                            <id>PhantomJS Unit Testing</id>
                            <phase>test</phase>
                            <goals>
                                <goal>java</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>

                        <executable>${basedir}/src/test/phantomjs_framework/phantomjs.exe</executable>
                        <arguments>
                            <argument>run_jasmine.js</argument>
                            <argument>test_runner.html</argument>
                            <!-- <argument>${project.build.directory}/surefire-reports</argument> -->
                        </arguments>
                        <workingDirectory>${basedir}/src/test/phantomjs_framework</workingDirectory>


                    </configuration>

                </plugin>

有什么想法吗? 凯斯卡布。

0 个答案:

没有答案