grails maven-functional-test 执行失败
grails maven-functional-test failsed to execute
当 运行 mvn clean install
我的 grails 应用程序时出现此异常。
Grails 版本 2.4.4
Failed to execute goal org.grails:grails-maven-plugin:2.4.4:maven-functional-test (default-maven-functional-test) on project nrm: Execution default-maven-functional-test of goal org.grails:grails-maven-plugin:2.4.4:maven-functional-test failed: java.lang.reflect.InvocationTargetException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'customCacheKeyGenerator' while setting bean property 'keyGenerator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customCacheKeyGenerator': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [grails.plugin.cache.CustomCacheKeyGenerator]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
此外,当我在 tomcat 上部署应用程序时会发生此错误。
我的构建配置:
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1101-jdbc41'
test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
compile 'org.hibernate:hibernate-ehcache:4.3.5.Final'
compile 'org.springframework:spring-context:4.0.5.RELEASE'
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.55"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:1.9.9"
compile ":mail:1.0.7"
compile ":mongo-file:1.4.1"
compile ":mongodb:3.0.2"
compile ':spring-security-core:2.0-RC4'
compile ":spring-security-ui:1.0-RC2"
// plugins needed at runtime but not for compilation
runtime ":hibernate4:4.3.5.5"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
}
在下面添加您的 pom.xml 依赖项:
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId>
<version>4.0.0.M3</version>
</dependency>
当 运行 mvn clean install
我的 grails 应用程序时出现此异常。
Grails 版本 2.4.4
Failed to execute goal org.grails:grails-maven-plugin:2.4.4:maven-functional-test (default-maven-functional-test) on project nrm: Execution default-maven-functional-test of goal org.grails:grails-maven-plugin:2.4.4:maven-functional-test failed: java.lang.reflect.InvocationTargetException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'customCacheKeyGenerator' while setting bean property 'keyGenerator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customCacheKeyGenerator': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [grails.plugin.cache.CustomCacheKeyGenerator]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
此外,当我在 tomcat 上部署应用程序时会发生此错误。
我的构建配置:
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1101-jdbc41'
test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
compile 'org.hibernate:hibernate-ehcache:4.3.5.Final'
compile 'org.springframework:spring-context:4.0.5.RELEASE'
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.55"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:1.9.9"
compile ":mail:1.0.7"
compile ":mongo-file:1.4.1"
compile ":mongodb:3.0.2"
compile ':spring-security-core:2.0-RC4'
compile ":spring-security-ui:1.0-RC2"
// plugins needed at runtime but not for compilation
runtime ":hibernate4:4.3.5.5"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
}
在下面添加您的 pom.xml 依赖项:
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId>
<version>4.0.0.M3</version>
</dependency>