瀏覽代碼

Stripping out unnecessary dependencies from sample jars.

Luke Taylor 14 年之前
父節點
當前提交
19e56f4397

+ 13 - 3
samples/cas/cas.gradle

@@ -3,10 +3,20 @@
 apply plugin: 'war'
 apply plugin: 'jetty'
 
+def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
+
 configurations {
     casServer
 }
 
+configurations {
+    excludeModules.each {name ->
+        runtime.exclude module: name
+    }
+
+    runtime.exclude group: 'org.aspectj'
+}
+
 dependencies {
     casServer "org.jasig.cas:cas-server-webapp:3.4.3.1@war"
 
@@ -20,7 +30,7 @@ dependencies {
 
 def keystore = "$rootDir/samples/certificates/server.jks"
 
-jettyRun {
+[jettyRun, jettyRunWar]*.configure {
     contextPath = "/cas"
     def httpConnector = new org.mortbay.jetty.nio.SelectChannelConnector();
     httpConnector.port = 8080
@@ -49,12 +59,12 @@ task casServer (type: org.gradle.api.plugins.jetty.JettyRunWar) {
     }
 }
 
-task cas (dependsOn: [jettyRun, casServer]) {
+task cas (dependsOn: [jettyRunWar, casServer]) {
 }
 
 gradle.taskGraph.whenReady {graph ->
     if (graph.hasTask(cas)) {
-        jettyRun.dependsOn(casServer)
+        jettyRunWar.dependsOn(casServer)
         casServer.daemon = true
     }
 }

+ 5 - 0
samples/contacts/contacts.gradle

@@ -3,6 +3,11 @@
 apply plugin: 'war'
 apply plugin: 'jetty'
 
+configurations {
+    runtime.exclude module: 'jsr250-api'
+    runtime.exclude group: 'org.aspectj'
+}
+
 dependencies {
     providedCompile 'javax.servlet:servlet-api:2.5@jar'
 

+ 10 - 0
samples/jaas/jaas.gradle

@@ -3,6 +3,16 @@
 apply plugin: 'war'
 apply plugin: 'jetty'
 
+def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
+
+configurations {
+    excludeModules.each {name ->
+        runtime.exclude module: name
+    }
+
+    runtime.exclude group: 'org.aspectj'
+}
+
 dependencies {
     providedCompile 'javax.servlet:servlet-api:2.5@jar'
 

+ 10 - 0
samples/ldap/ldap.gradle

@@ -3,6 +3,16 @@
 apply plugin: 'war'
 apply plugin: 'jetty'
 
+def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'ldapsdk']
+
+configurations {
+    excludeModules.each {name ->
+        runtime.exclude module: name
+    }
+
+    runtime.exclude group: 'org.aspectj'
+}
+
 dependencies {
 
     runtime project(':spring-security-web'),

+ 10 - 0
samples/preauth/preauth.gradle

@@ -3,6 +3,16 @@
 apply plugin: 'war'
 apply plugin: 'jetty'
 
+def excludeModules = ['jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
+
+configurations {
+    excludeModules.each {name ->
+        runtime.exclude module: name
+    }
+
+    runtime.exclude group: 'org.aspectj'
+}
+
 dependencies {
 
     runtime project(':spring-security-web'),

+ 1 - 5
samples/tutorial/src/main/webapp/WEB-INF/applicationContext-security.xml

@@ -13,11 +13,7 @@
 
     <debug />
 
-    <global-method-security pre-post-annotations="enabled">
-        <!-- AspectJ pointcut expression that locates our "post" method and applies security that way
-        <protect-pointcut expression="execution(* bigbank.*Service.post*(..))" access="ROLE_TELLER"/>
-        -->
-    </global-method-security>
+    <global-method-security pre-post-annotations="enabled" />
 
     <http pattern="/loggedout.jsp" security="none"/>
 

+ 10 - 0
samples/tutorial/tutorial.gradle

@@ -3,6 +3,16 @@
 apply plugin: 'war'
 apply plugin: 'jetty'
 
+def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
+
+configurations {
+    excludeModules.each {name ->
+        runtime.exclude module: name
+    }
+
+    runtime.exclude group: 'org.aspectj'
+}
+
 dependencies {
     providedCompile 'javax.servlet:servlet-api:2.5@jar'