将grails从1.3.x升级到2.0.4时Spring Security核心插件出错

时间:2012-11-12 05:30:48

标签: grails spring-security grails-2.0

我有一个用grails 1.3.x开发的应用程序,我升级到2.0.4,spring安全插件中存在依赖性错误,所以我做了grails install-plugin spring-security-core,它安装了1.2.7.3版本。然后我运行了grails应用程序,我得到了以下错误。

Compilation error: startup failed:
Compile error during compilation with javac.
C:\Users\Vinay.hs\.grails\2.0.4\projects\steer\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springs
ecurity\AjaxAwareAuthenticationFailureHandler.java:48: cannot find symbol
symbol  : method saveException(javax.servlet.http.HttpServletRequest,org.springframework.security.core.AuthenticationException)
location: class org.codehaus.groovy.grails.plugins.springsecurity.AjaxAwareAuthenticationFailureHandler
                        saveException(request, exception);
                        ^

然后我添加了compile ':spring-security-core:1.2.7.3'。我得到了一个不同的错误,如下所示

:::: WARNINGS
                ::::::::::::::::::::::::::::::::::::::::::::::

                ::          UNRESOLVED DEPENDENCIES         ::

                ::::::::::::::::::::::::::::::::::::::::::::::

                :: #spring-security-core;1.2.7.3: java.text.ParseException: inconsistent module descriptor file found in 'http://plugin
s.grails.org/grails-spring-security-core/tags/RELEASE_1_2_7_3/spring-security-core-1.2.7.3.pom': bad organisation: expected='' found='o
rg.grails.plugins';

                ::::::::::::::::::::::::::::::::::::::::::::::


:::: ERRORS
                grailsCentral: bad organisation found in http://plugins.grails.org/grails-spring-security-core/tags/RELEASE_1_2_7_3/spr
ing-security-core-1.2.7.3.pom: expected='' found='org.grails.plugins'

我提到this jira issue,根据我们必须将依赖项更改为运行时,但它给了我以下错误

    inconsistent module descriptor file found in 'http://plugins.grails.org/grails-spring-security-core/tags/RELEASE_1_2_7_3/spring-security-core-1.2.7.3.pom': bad organisation: expected='' found='org.grails.plugins';

那么,如何解决这个问题。

1 个答案:

答案 0 :(得分:3)

看起来你将依赖项放在BuildConfig.groovy dependencies部分,但它应该在plugins部分:

plugins {
   runtime ":hibernate:$grailsVersion"
   build ":tomcat:$grailsVersion"
   ...
   compile ':spring-security-core:1.2.7.3'
}