麻烦运行maven-grails测试用例

时间:2011-04-05 19:33:56

标签: grails maven

我正在使用Maven 3.0.3,Grails 1.2.1。虽然我已经创建了集成和单元测试,但是我对我的Grails项目进行了编组,但maven并没有运行它们。当然,测试是在Grails目录结构(PROJECT_HOME / test / unit和PROJECT_HOME / test / integration)而不是Maven目录结构中,我认为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

1 个答案:

答案 0 :(得分:0)

要使用maven-grails插件进行测试,必须明确调用它,然后尝试mvn grails:test-app

您可以通过mvn grails:help

显示此插件的所有可能命令