From b0df1bd1b0db844028c213939b6c88866058ce3d Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 7 Feb 2011 16:06:23 +0000 Subject: [PATCH] SEC-1673: Use a map to store the range values use in the bundlor templates. --- acl/template.mf | 20 ++++++++++---------- aspects/template.mf | 6 +++--- cas/template.mf | 20 ++++++++++---------- config/template.mf | 26 +++++++++++++------------- core/template.mf | 28 ++++++++++++++-------------- gradle/bundlor.gradle | 5 +++-- gradle/javaprojects.gradle | 16 ++++++++++++++++ ldap/template.mf | 28 ++++++++++++++-------------- openid/template.mf | 14 +++++++------- taglibs/template.mf | 22 +++++++++++----------- web/template.mf | 36 ++++++++++++++++++------------------ 11 files changed, 119 insertions(+), 102 deletions(-) diff --git a/acl/template.mf b/acl/template.mf index eec3791c5b..f3ead64c3b 100644 --- a/acl/template.mf +++ b/acl/template.mf @@ -9,14 +9,14 @@ Ignored-Existing-Headers: Import-Package, Export-Package Import-Template: - org.apache.commons.logging.*;version="[1.0.4, 2.0.0)", - org.springframework.security.core.*;version="[${version}, 3.2.0)", - org.springframework.security.access.*;version="[${version}, 3.2.0)", - org.springframework.security.util.*;version="[${version}, 3.2.0)", - org.springframework.context.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.dao.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.jdbc.core.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.transaction.support.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.util.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - net.sf.ehcache.*;version="[1.4.1, 2.0.0)";resolution:=optional, + org.apache.commons.logging.*;version="${cloggingRange}", + org.springframework.security.core.*;version="${secRange}", + org.springframework.security.access.*;version="${secRange}", + org.springframework.security.util.*;version="${secRange}", + org.springframework.context.*;version="${secRange}";resolution:=optional, + org.springframework.dao.*;version="${springRange}";resolution:=optional, + org.springframework.jdbc.core.*;version="${springRange}";resolution:=optional, + org.springframework.transaction.support.*;version="${springRange}";resolution:=optional, + org.springframework.util.*;version="${springRange}";resolution:=optional, + net.sf.ehcache.*;version="${ehcacheRange}";resolution:=optional, javax.sql.*;version="0";resolution:=optional diff --git a/aspects/template.mf b/aspects/template.mf index aeb07873ab..2859d4d9aa 100644 --- a/aspects/template.mf +++ b/aspects/template.mf @@ -9,6 +9,6 @@ Ignored-Existing-Headers: Import-Package, Export-Package Import-Template: - org.aspectj.*;version="[1.6.0, 1.7.0)";resolution:=optional, - org.apache.commons.logging.*;version="[1.0.4, 2.0.0)", - org.springframework.security.core.*;version="[${version}, 3.2.0)" + org.aspectj.*;version="${aspectjRange}";resolution:=optional, + org.apache.commons.logging.*;version="${cloggingRange}", + org.springframework.security.core.*;version="${secRange}" diff --git a/cas/template.mf b/cas/template.mf index e135ae5c06..b508b16119 100644 --- a/cas/template.mf +++ b/cas/template.mf @@ -9,14 +9,14 @@ Ignored-Existing-Headers: Import-Package, Export-Package Import-Template: - org.apache.commons.logging.*;version="[1.0.4, 2.0.0)", - org.jasig.cas.client.*;version="[3.1.1, 3.2.0)", - org.springframework.security.core.*;version="[${version}, 3.2.0)", - org.springframework.security.authentication.*;version="[${version}, 3.2.0)", - org.springframework.security.web.*;version="[${version}, 3.2.0)", - org.springframework.beans.factory;version="[${spring.version}, 3.2.0)", - org.springframework.context.*;version="[${spring.version}, 3.2.0)", - org.springframework.dao;version="[${spring.version}, 3.2.0)", - org.springframework.util;version="[${spring.version}, 3.2.0)", - net.sf.ehcache.*;version="[1.4.1, 2.0.0)";resolution:=optional, + org.apache.commons.logging.*;version="${cloggingRange}", + org.jasig.cas.client.*;version="${casRange}", + org.springframework.security.core.*;version="${secRange}", + org.springframework.security.authentication.*;version="${secRange}", + org.springframework.security.web.*;version="${secRange}", + org.springframework.beans.factory;version="${springRange}", + org.springframework.context.*;version="${springRange}", + org.springframework.dao;version="${springRange}", + org.springframework.util;version="${springRange}", + net.sf.ehcache.*;version="${ehcacheRange}";resolution:=optional, javax.servlet.*;version="0" diff --git a/config/template.mf b/config/template.mf index fce9ccf156..92677c6b66 100644 --- a/config/template.mf +++ b/config/template.mf @@ -9,19 +9,19 @@ Ignored-Existing-Headers: Import-Package, Export-Package Import-Template: - org.apache.commons.logging.*;version="[1.0.4, 2.0.0)", - org.aspectj.*;version="[1.6.0, 1.7.0)";resolution:=optional, - org.springframework.security.access.*;version="[${version}, 3.2.0)", - org.springframework.security.authentication.*;version="[${version}, 3.2.0)", - org.springframework.security.core.*;version="[${version}, 3.2.0)", - org.springframework.security.util;version="[${version}, 3.2.0)", - org.springframework.security.provisioning;version="[${version}, 3.2.0)", - org.springframework.security.web.*;version="[${version}, 3.2.0)";resolution:=optional, - org.springframework.aop.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.beans.*;version="[${spring.version}, 3.2.0)", - org.springframework.context.*;version="[${spring.version}, 3.2.0)", - org.springframework.core.*;version="[${spring.version}, 3.2.0)", - org.springframework.util.*;version="[${spring.version}, 3.2.0)", + org.apache.commons.logging.*;version="${cloggingRange}", + org.aspectj.*;version="${aspectjRange}";resolution:=optional, + org.springframework.security.access.*;version="${secRange}", + org.springframework.security.authentication.*;version="${secRange}", + org.springframework.security.core.*;version="${secRange}", + org.springframework.security.util;version="${secRange}", + org.springframework.security.provisioning;version="${secRange}", + org.springframework.security.web.*;version="${secRange}";resolution:=optional, + org.springframework.aop.*;version="${springRange}";resolution:=optional, + org.springframework.beans.*;version="${springRange}", + org.springframework.context.*;version="${springRange}", + org.springframework.core.*;version="${springRange}", + org.springframework.util.*;version="${springRange}", javax.servlet;version="0";resolution:=optional, javax.naming.directory;version="0";resolution:=optional, org.w3c.dom;version="0";resolution:=optional diff --git a/core/template.mf b/core/template.mf index 21f0fbb974..aeb2bd5822 100644 --- a/core/template.mf +++ b/core/template.mf @@ -9,20 +9,20 @@ Ignored-Existing-Headers: Import-Package, Export-Package Import-Template: - org.aopalliance.*;version="[1.0.0, 2.0.0)", - org.aspectj.*;version="[1.6.0, 1.7.0)";resolution:=optional, - org.apache.commons.logging.*;version="[1.0.4, 2.0.0)", - org.springframework.aop.*;version="[${spring.version}, 3.1.0)";resolution:=optional, - org.springframework.beans.*;version="[${spring.version}, 3.1.0)", - org.springframework.context.*;version="[${spring.version}, 3.1.0)", - org.springframework.core.*;version="[${spring.version}, 3.1.0)", - org.springframework.expression.*;version="[${spring.version}, 3.1.0)";resolution:=optional, - org.springframework.remoting.*;version="[${spring.version}, 3.1.0)";resolution:=optional, - org.springframework.dao.*;version="[${spring.version}, 3.1.0)";resolution:=optional, - org.springframework.jdbc.*;version="[${spring.version}, 3.1.0)";resolution:=optional, - org.springframework.transaction.*;version="[${spring.version}, 3.1.0)";resolution:=optional, - org.springframework.util;version="[${spring.version}, 3.1.0)", - net.sf.ehcache.*;version="[1.4.1, 2.0.0)";resolution:=optional, + org.aopalliance.*;version="${aopAllianceRange}", + org.aspectj.*;version="${aspectjRange}";resolution:=optional, + org.apache.commons.logging.*;version="${cloggingRange}", + org.springframework.aop.*;version="${springRange}";resolution:=optional, + org.springframework.beans.*;version="${springRange}", + org.springframework.context.*;version="${springRange}", + org.springframework.core.*;version="${springRange}", + org.springframework.expression.*;version="${springRange}";resolution:=optional, + org.springframework.remoting.*;version="${springRange}";resolution:=optional, + org.springframework.dao.*;version="${springRange}";resolution:=optional, + org.springframework.jdbc.*;version="${springRange}";resolution:=optional, + org.springframework.transaction.*;version="${springRange}";resolution:=optional, + org.springframework.util;version="${springRange}", + net.sf.ehcache.*;version="${ehcacheRange}";resolution:=optional, javax.annotation.security.*;version="0";resolution:=optional, javax.crypto.*;version="0";resolution:=optional, javax.security.auth.*;version="0";resolution:=optional, diff --git a/gradle/bundlor.gradle b/gradle/bundlor.gradle index e670c41cbd..4237104291 100644 --- a/gradle/bundlor.gradle +++ b/gradle/bundlor.gradle @@ -29,8 +29,9 @@ task bundlor(dependsOn: compileJava) { mkdir(bundlorDir) ant.bundlor(inputPath: sourceSets.main.classesDir, outputPath: "$buildDir/bundlor", manifestTemplatePath: template) { - property(name: 'version', value: project.version) - property(name: 'spring.version', value: project.springVersion) + for (p in bundlorProperties) { + property(name: p.key, value: p.value) + } } } } diff --git a/gradle/javaprojects.gradle b/gradle/javaprojects.gradle index b9025b47e5..9d29fe4772 100644 --- a/gradle/javaprojects.gradle +++ b/gradle/javaprojects.gradle @@ -12,6 +12,22 @@ hsqlVersion = '1.8.0.10' slf4jVersion = '1.6.1' logbackVersion = '0.9.24' +bundlorProperties = [ + version: version, + secRange: "[$version, 3.2.0)", + springRange: "[$springVersion, 3.2.0)", + aspectjRange: '[1.6.0, 1.7.0)', + casRange: '[3.1.1, 3.2.0)', + cloggingRange: '[1.0.4, 2.0.0)', + ehcacheRange: '[1.4.1, 2.0.0)', + openid4javaRange: '[0.9.5, 1.0.0)', + springLdapRange: '[1.3.0,1.4.0)', + apacheDSRange: '[1.5.5, 1.6)', + apacheDSSharedRange: '[0.9.15, 1.0)', + ldapSdkRange: '[4.1, 5.0)', + aopAllianceRange: '[1.0.0, 2.0.0)' +] + configurations { // Configuration which is ONLY used for compileJava and will not be inherited by any others // Revisit post Gradle 1.0 diff --git a/ldap/template.mf b/ldap/template.mf index 58ed3b2633..236764677c 100644 --- a/ldap/template.mf +++ b/ldap/template.mf @@ -9,18 +9,18 @@ Ignored-Existing-Headers: Import-Package, Export-Package Import-Template: - org.apache.commons.logging.*;version="[1.0.4, 2.0.0)", - org.apache.directory.server.*;version="[1.5.5, 1.6)";resolution:=optional, - org.apache.directory.shared.ldap.*;version="[0.9.15, 1.0)";resolution:=optional, - org.springframework.ldap.*;version="[1.3.0,1.4.0)", - org.springframework.security.core.*;version="[${version}, 3.2.0)", - org.springframework.security.authentication.*;version="[${version}, 3.2.0)", - org.springframework.security.provisioning.*;version="[${version}, 3.2.0)", - org.springframework.security.util;version="[${version}, 3.2.0)", - org.springframework.beans.*;version="[${spring.version}, 3.2.0)", - org.springframework.context.*;version="[${spring.version}, 3.2.0)", - org.springframework.core.io.*;version="[${spring.version}, 3.2.0)", - org.springframework.dao.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.util.*;version="[${spring.version}, 3.2.0)", + org.apache.commons.logging.*;version="${cloggingRange}", + org.apache.directory.server.*;version="${apacheDSRange}";resolution:=optional, + org.apache.directory.shared.ldap.*;version="${apacheDSSharedRange}";resolution:=optional, + org.springframework.ldap.*;version="${springLdapRange}", + org.springframework.security.core.*;version="${secRange}", + org.springframework.security.authentication.*;version="${secRange}", + org.springframework.security.provisioning.*;version="${secRange}", + org.springframework.security.util;version="${secRange}", + org.springframework.beans.*;version="${springRange}", + org.springframework.context.*;version="${springRange}", + org.springframework.core.io.*;version="${springRange}", + org.springframework.dao.*;version="${springRange}";resolution:=optional, + org.springframework.util.*;version="${springRange}", javax.naming.*;version="0";resolution:=optional, - netscape.ldap.ber.stream;version="[4.1, 5.0)";resolution:=optional + netscape.ldap.ber.stream;version="${ldapSdkRange}";resolution:=optional diff --git a/openid/template.mf b/openid/template.mf index dedb9c1452..0f88f161fb 100644 --- a/openid/template.mf +++ b/openid/template.mf @@ -9,11 +9,11 @@ Ignored-Existing-Headers: Import-Package, Export-Package Import-Template: - org.apache.commons.logging.*;version="[1.0.4, 2.0.0)", - org.springframework.security.core.*;version="[${version}, 3.2.0)", - org.springframework.security.authentication.*;version="[${version}, 3.2.0)", - org.springframework.security.web.*;version="[${version}, 3.2.0)", - org.springframework.beans.factory;version="[${spring.version}, 3.2.0)", - org.springframework.util;version="[${spring.version}, 3.2.0)", - org.openid4java.*;version="[0.9.5, 1.0.0)", + org.apache.commons.logging.*;version="${cloggingRange}", + org.springframework.security.core.*;version="${secRange}", + org.springframework.security.authentication.*;version="${secRange}", + org.springframework.security.web.*;version="${secRange}", + org.springframework.beans.factory;version="${springRange}", + org.springframework.util;version="${springRange}", + org.openid4java.*;version="${openid4javaRange}", javax.servlet.*;version="0" diff --git a/taglibs/template.mf b/taglibs/template.mf index 44a5a2e82f..c0573a3a54 100644 --- a/taglibs/template.mf +++ b/taglibs/template.mf @@ -9,15 +9,15 @@ Ignored-Existing-Headers: Import-Package, Export-Package Import-Template: - org.apache.commons.logging.*;version="[1.0.4, 2.0.0)", - org.springframework.security.core.*;version="[${version}, 3.2.0)", - org.springframework.security.web.*;version="[${version}, 3.2.0)", - org.springframework.security.access.*;version="[${version}, 3.2.0)", - org.springframework.security.util;version="[${version}, 3.2.0)", - org.springframework.security.acls.*;version="[${version}, 3.2.0)";resolution:=optional, - org.springframework.beans.*;version="[${spring.version}, 3.2.0)", - org.springframework.context.*;version="[${spring.version}, 3.2.0)", - org.springframework.expression;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.web.context.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.web.util.*;version="[${spring.version}, 3.2.0)", + org.apache.commons.logging.*;version="${cloggingRange}", + org.springframework.security.core.*;version="${secRange}", + org.springframework.security.web.*;version="${secRange}", + org.springframework.security.access.*;version="${secRange}", + org.springframework.security.util;version="${secRange}", + org.springframework.security.acls.*;version="${secRange}";resolution:=optional, + org.springframework.beans.*;version="${springRange}", + org.springframework.context.*;version="${springRange}", + org.springframework.expression;version="${springRange}";resolution:=optional, + org.springframework.web.context.*;version="${springRange}";resolution:=optional, + org.springframework.web.util.*;version="${springRange}", javax.servlet.*;version="0" diff --git a/web/template.mf b/web/template.mf index 3fd0c2a866..fbf3842de0 100644 --- a/web/template.mf +++ b/web/template.mf @@ -17,24 +17,24 @@ Ignored-Existing-Headers: Import-Package, Export-Package Import-Template: - org.apache.commons.logging.*;version="[1.0.4, 2.0.0)", - org.springframework.security.core.*;version="[${version}, 3.2.0)", - org.springframework.security.authentication.*;version="[${version}, 3.2.0)", - org.springframework.security.access.*;version="[${version}, 3.2.0)", - org.springframework.security.util;version="[${version}, 3.2.0)", - org.springframework.beans.*;version="[${spring.version}, 3.2.0)", - org.springframework.context.*;version="[${spring.version}, 3.2.0)", - org.springframework.core;version="[${spring.version}, 3.2.0)", - org.springframework.core.io;version="[${spring.version}, 3.2.0)", - org.springframework.dao;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.expression;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.expression.spel.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.http.*;version="[${spring.version}, 3.2.0)", - org.springframework.jdbc.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.mock.web;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.web.context.*;version="[${spring.version}, 3.2.0)";resolution:=optional, - org.springframework.web.filter.*;version="[${spring.version}, 3.2.0)", - org.springframework.util;version="[${spring.version}, 3.2.0)";resolution:=optional, + org.apache.commons.logging.*;version="${cloggingRange}", + org.springframework.security.core.*;version="${secRange}", + org.springframework.security.authentication.*;version="${secRange}", + org.springframework.security.access.*;version="${secRange}", + org.springframework.security.util;version="${secRange}", + org.springframework.beans.*;version="${springRange}", + org.springframework.context.*;version="${springRange}", + org.springframework.core;version="${springRange}", + org.springframework.core.io;version="${springRange}", + org.springframework.dao;version="${springRange}";resolution:=optional, + org.springframework.expression;version="${springRange}";resolution:=optional, + org.springframework.expression.spel.*;version="${springRange}";resolution:=optional, + org.springframework.http.*;version="${springRange}", + org.springframework.jdbc.*;version="${springRange}";resolution:=optional, + org.springframework.mock.web;version="${springRange}";resolution:=optional, + org.springframework.web.context.*;version="${springRange}";resolution:=optional, + org.springframework.web.filter.*;version="${springRange}", + org.springframework.util;version="${springRange}";resolution:=optional, org.w3c.dom;version="0";resolution:=optional, org.xml.sax;version="0";resolution:=optional, javax.servlet.*;version="0",