Error compiling Grails 2.4.2 application when adding Spring Security Rest plugin to BuildConfig.groovy -
i have grails 2.4.2 application working spring security core , i'm trying implement restful api authentication. this, added spring security rest v1.5.4 plugin in buildconfig.groovy file, follows:
grails.servlet.version = "2.5" grails.tomcat.nio=false grails.project.class.dir = "target/classes" grails.project.test.class.dir = "target/test-classes" grails.project.test.reports.dir = "target/test-reports" grails.project.work.dir = "target/work" grails.project.target.level = 1.6 grails.project.source.level = 1.6 grails.project.war.file = "target/${appname}.war" grails.project.dependency.resolver = "maven" // or ivy grails.project.dependency.resolution = { inherits("global") { } log "info" checksums true legacyresolve false repositories { inherits true mavencentral() grailsplugins() grailshome() mavenlocal() grailscentral() mavenrepo "http://repository.codehaus.org" mavenrepo "http://repo.spring.io/milestone/" mavenrepo "http://repo.grails.org/grails/libs-releases-local" mavenrepo "http://repo.grails.org/grails/core" mavenrepo "http://repo.spring.io/libs-snapshot" } dependencies { compile('com.lowagie:itext-rtf:2.1.7') compile('org.codehaus.groovy.modules.http-builder:http-builder:0.7') { excludes "commons-logging", "xml-apis", "groovy", "xercesimpl" } compile 'net.sf.ehcache:ehcache-core:2.4.8' test("org.seleniumhq.selenium:selenium-firefox-driver:2.41.0") test "org.gebish:geb-spock:0.9.2" compile 'org.grails.plugins:events:1.0.0.m1' compile 'org.springframework:spring-core:4.0.5.release' compile 'org.springframework:spring-context:4.0.5.release' compile 'org.springframework:spring-beans:4.0.5.release' compile 'commons-beanutils:commons-beanutils:1.8.3' compile ('eu.medsea.mimeutil:mime-util:2.1.3'){ excludes([group:'org.slf4j', name:'slf4j-log4j12', version: '1.5.6']) } compile ('org.apache.poi:poi:3.10.1'){ excludes "xml-apis", "xercesimpl", "stax-api" } compile ('org.apache.poi:poi-ooxml:3.10.1'){ excludes "xml-apis", "xercesimpl", "stax-api" } compile ( group:'org.springframework.cloud', name:'spring-cloud-starter-eureka', version:'1.0.0.m2', changing: true){ excludes "logback-classic", "xercesimpl", "tomcat-embed-core", "tomcat-embed-el", "stax-api", "hibernate-validator", "log4j-over-slf4j" } compile ('com.netflix.ribbon:ribbon-eureka:2.0-rc9'){ excludes "xercesimpl", "stax-api" } compile ('com.netflix.ribbon:ribbon-loadbalancer:2.0-rc9'){ excludes "xercesimpl", "stax-api" } provided ('xerces:xercesimpl:2.9.1'){ excludes "xml-apis", "stax-api" } compile 'br.com.caelum.stella:caelum-stella-core:2.1.2' compile ('br.com.caelum.stella:caelum-stella-boleto:2.1.2'){ excludes('itext') } } environments { test { dependencies { runtime 'org.springframework:spring-test:3.2.9.release' compile "commons-codec:commons-codec:1.9" } } production{ dependencies { runtime 'org.springframework:spring-test:3.2.9.release' compile "commons-codec:commons-codec:1.9" } } development { dependencies { runtime 'org.springframework:spring-test:3.2.9.release' compile "commons-codec:commons-codec:1.9" } } } plugins { test ":geb:0.9.2" build ":tomcat:7.0.54" compile ":scaffolding:2.1.2" compile ':cache:1.1.7' compile ":rest:0.8" compile ':spring-security-core:2.0-rc3' compile ":spring-security-rest:1.5.4" compile ":mail:1.0.6" compile ':mongodb:3.0.3' compile ":ckeditor:4.4.1.0" runtime ":jquery:1.11.0.2" compile ':console:1.4.2' compile ":asset-pipeline:1.9.9" compile ":sass-asset-pipeline:1.9.1" compile ":mongodb-create-drop:1.0" compile (":export:1.6"){ excludes "xml-apis", 'itext', 'itext-rtf', "xercesimpl", "stax-api" } compile (":rendering:1.0.0") compile ":br-validation:0.3" compile ":google-analytics:2.3.3" compile ":cache-headers:1.1.7" compile ":jslint:0.6" } }
when execute run-app command, following errors shown: compiling 279 source files note: input files use or override deprecated api. note: recompile -xlint:deprecation details. note: /tmp/groovy-generated-68181663753307402-java-source/grails/plugin/springsecurity/rest/token/accesstoken.java uses unchecked or unsafe operations. note: recompile -xlint:unchecked details. [groovyc] org.codehaus.groovy.control.multiplecompilationerrorsexception: startup failed: [groovyc] /home/aescobar/ideaprojects/lasa-portal-fornecedores/portal-web/target/work/plugins/spring-security-rest-1.5.4/src/groovy/grails/plugin/springsecurity/rest/token/storage/tokenstorageservice.groovy: -1: field 'instanceeventsapi' not 'public static final' defined in interface 'grails.plugin.springsecurity.rest.token.storage.tokenstorageservice'. [groovyc] @ line -1, column -1. [groovyc] /home/aescobar/ideaprojects/lasa-portal-fornecedores/portal-web/target/work/plugins/spring-security-rest-1.5.4/src/groovy/grails/plugin/springsecurity/rest/oauth/oauthuserdetailsservice.groovy: -1: field 'instanceeventsapi' not 'public static final' defined in interface 'grails.plugin.springsecurity.rest.oauth.oauthuserdetailsservice'. [groovyc] @ line -1, column -1. [groovyc] 2 errors | compiling 279 source files. | error compilation error: startup failed: /home/aescobar/ideaprojects/lasa-portal-fornecedores/portal-web/target/work/plugins/spring-security-rest-1.5.4/src/groovy/grails/plugin/springsecurity/rest/token/storage/tokenstorageservice.groovy: -1: field 'instanceeventsapi' not 'public static final' defined in interface 'grails.plugin.springsecurity.rest.token.storage.tokenstorageservice'. @ line -1, column -1. /home/aescobar/ideaprojects/lasa-portal-fornecedores/portal-web/target/work/plugins/spring-security-rest-1.5.4/src/groovy/grails/plugin/springsecurity/rest/oauth/oauthuserdetailsservice.groovy: -1: field 'instanceeventsapi' not 'public static final' defined in interface 'grails.plugin.springsecurity.rest.oauth.oauthuserdetailsservice'. @ line -1, column -1. 2 errors
can try excluding spring-security-core
spring-security-rest
plugin? can done this:
compile ":spring-security-rest:1.5.4", { excludes: 'spring-security-core' }
or maybe try different versions of plugins: me combination of spring-security-core:2.0-rc4
spring-security-rest:1.5.0.m2
(with mentioned exclusion) works well.
Comments
Post a Comment