I'm trying to integrate Spring Security into a Struts2 project. This project doesn't use a dependency resolving tool like Maven, so
I don't know if I have to add all the Spring Security libraries and their dependencies to make the project work or I can leave those dependencies for later.
First of all you need Struts2 jars. I hope you know struts2 jars.
Second,
1.struts2-spring-plugin-2.x.x.jar
Which depends on Spring Framework
1.spring-expression-x.x.x.RELEASE.jar
2.spring-beans-x.x.x.jar
3.spring-core-x.x.x.RELEASE.jar
4.spring-context-x.x.x.RELEASE.jar
5.spring-web-x.x.x.RELEASE.jar
6.spring-test-x.x.x.RELEASE.jar
7.commons-lang3-3.1.jar
8.commons-jci-fam-1.0.jar
9.easymock.jar
Additional Support Jars if needed
10.spring-aop-x.x.x.RELEASE.jar
11.spring-aspects-x.x.x.RELEASE.jar
12.spring-context-support-4.0.4.RELEASE.jar
13.spring-test-x.x.x.RELEASE.jar
You need Spring Security Jars
1.spring-security-core-3.2.3.RELEASE.jar
2.spring-security-web-3.2.3.RELEASE.jar
3.spring-security-acl-3.2.3.RELEASE.jar
4.spring-security-aspects-3.2.3.RELEASE.jar
5.spring-security-config-3.2.3.RELEASE.jar
6.spring-security-taglibs-3.2.3.RELEASE.jar
Spring Security jars depends on SPRING Framework and
1.ehcache-core-2.4.3.jar
2.spring-tx-x.x.x.RELEASE.jar
3.cglib-2.2.jar
4.spring-webmvc-x.x.x.RELEASE.jar
And slf4j Jars for logging
1.jcl-over-slf4j-1.7.6.jar
2.slf4j-api-1.6.1.jar
3.slf4j-simple-1.6.1.jar
4.slf4j-log4j12-1.6.1.jar
5.log4j-1.2.16.jar
Related
Is there a way of disabling a plugin on a Grails 3 project? I am using dependencies that have Grails plugins but I just want to keep the classes that are in the dependency.
I created a Grails plugin which is used by my Grails app. I created an interceptor "TestInterceptor" in grails-app/controllers in the plugin. I used 'grails install' to install the plugin to my local maven repository.
When I run the app, the interceptor is not invoked.
When I examine the generated META-INF/grails-plugin.xml within my plugin JAR, the interceptor is not present. Other artefact types (services, controllers, domains) are present in grails-plugin.xml.
If I move the interceptor to my app, it gets invoked.
Does Grails 3.3.0 support interceptors in plugins? If so, what steps do I need to take to get the plugin to publish the interceptor so it gets loaded by my app?
I found another plugin in github with an interceptor and identified that my plugin was missing a required dependency in build.gradle. Namely, org.grails:grails-plugin-interceptors.
This seems obvious now, though I can't say why my plugin was missing that dependency.
I am using Grails 2.3.8
I am using - org.yaml.snakeyaml.Yaml class.
Didn't have any issues with GGTS workspace finding the package during auto
complete in the source.
But when running the application I get
java.lang.ClassNotFoundException:org.yaml.snakeyaml.Yaml
My assumption was this is part of the core Grails and the jars will be
included automatically.
Do I have to configure and add the jar or dependency in the
BuildConfig.groovy ?
Grails 3 uses Yaml and includes it as a dependency but prior to 3.0 it didn't, so you need to configure it like any third-party dependency in BuildConfig.groovy, e.g.
dependencies {
...
compile 'org.yaml:snakeyaml:1.14'
}
My grails app should work with two plugins: shiro and quartz2.
I'm add both of plugins to BuildConfig.groovy:
compile ":shiro:1.1.4"
compile ":quartz2:2.1.6.2"
(after that ide downloaded them)
The problem in dependencies: shiro depends from shiro-quartz:1.2.0 and shiro-quartz from org.opensymphony.quartz 1.6.1
I wonder why but quartz2 looking for methods implementation to quartz-1.6.1.jar.
Quartz2 cannot find implementations and that's why project cannot be build.
I think quartz2 should search methods implementations in "normal" quartz lib, like quartz:1.0-RC7, but he do not.
So, how can i solve shiro and quartz2 plugins conflict?
I heard about dependency excluding, but i not sure about this sugesstion.
P.S. with quartz(not quartz2) the same problem occurred
You can run dependency-report to check what dependencies the plugins are trying to add to your project. The problem seems to be that shiro-quartz depends on quartz 1.x and quartz plugin uses quartz 2.x.
Normally you could do:
compile (":shiro:1.1.4") {
excludes('org.opensymphony.quartz:quartz')
}
But there's a bug, and this transitive dependency isn't excluded. There's an open ticket to adjust this.
The good thing is that there's a workaround:
compile (":shiro:1.1.4") {
excludes([name: 'quartz', group: 'org.opensymphony.quartz'])
}
With this, Grails will use Quartz 2.x only.
I am using grails 2.2.1, in windows.
I want to develop a plugin which depends on spring-security-core plugin, so I add dependency into BuildConfig.groovy of my plugin:
plugins {
compile ':spring-security-core:1.2.7.3'
}
Then in my grail application project, I specify the dependency in BuildConfig.groovy in:
grails.plugin.location."xxxxx" = "../grails-plugins/xxxx"
After that, when I try to refresh dependency of my grail application project, it always prompt
unable to resolve class org.springframework.security.authentication.UsernamePasswordAuthenticationToken
this class is a class depends on by spring-security-core plugin and my plugin use this class too.
Is it a grails bug? or I miss something? Please help, thanks in advance!
I tested here. In Grails 2.2.1 you need to set legacyResolve to true since
Grails 2.2 no longer uses the BuildConfig of the plugin for dependency
resolution and only uses data provided by POMs
When you set this and refresh dependencies the install messages of Spring Security Core will appear.