2011-04-05 166 views
1

我正在使用Maven 3.0.3,Grails 1.2.1。然而,儘管我創建了集成和單元測試,但Maven並未運行它們。同Maven目錄結構相反,我認爲Maven目錄結構(PROJECT_HOME/test/unit和PROJECT_HOME/test/integration)中的測試是允許的,但是沒有測試運行。以下是完整的輸出。如何讓「maven測試」運行我的Grails測試用例?麻煩運行maven-grails測試用例

謝謝 - 戴夫

 
davea-mbp2:socialmediaproxy davea$ mvn test 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building socialmediaproxy 0.1 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- grails-maven-plugin:1.2.1:validate (default) @ socialmediaproxy --- 
[INFO] 
[INFO] --- grails-maven-plugin:1.2.1:init (default) @ socialmediaproxy --- 
[INFO] 
[INFO] --- grails-maven-plugin:1.2.1:config-directories (default) @ socialmediaproxy --- 
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ socialmediaproxy --- 
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] skip non existing resourceDirectory /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/src/main/resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ socialmediaproxy --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- grails-maven-plugin:1.2.1:maven-compile (default) @ socialmediaproxy --- 
[INFO] Using Grails 1.2.1 
Running pre-compiled script 
Environment set to development 
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ socialmediaproxy --- 
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] skip non existing resourceDirectory /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/src/test/resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ socialmediaproxy --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ socialmediaproxy --- 
[INFO] Surefire report directory: /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/target/surefire-reports 

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 
There are no tests to run. 

Results : 

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 

[INFO] 
[INFO] --- grails-maven-plugin:1.2.1:maven-test (default) @ socialmediaproxy --- 
[INFO] Using Grails 1.2.1 
Running pre-compiled script 
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 14.194s 
[INFO] Finished at: Tue Apr 05 14:23:44 CDT 2011 
[INFO] Final Memory: 55M/110M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.grails:grails-maven-plugin:1.2.1:maven-test (default) on project socialmediaproxy: Unable to start Grails: java.lang.reflect.InvocationTargetException: org/slf4j/impl/StaticLoggerBinder: org.slf4j.impl.StaticLoggerBinder -> [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/MojoExecutionException 
+0

嗨戴夫,你有沒有得到這個解決方案?我被困在同一點,我不知道如何繼續這:( – Prasann 2017-07-25 15:13:48

回答

0

要使用maven-Grails的插件,你必須把它的測試明確地嘗試mvn grails:test-app

您可以通過mvn grails:help

顯示這個插件的所有可能的命令