1
0
mirror of synced 2026-08-05 01:36:56 +00:00

Sample app build adjustments to remove unwanted deps such as jsp-api, tidy up use of JSTL, make sure all are using servlet 2.5 etc.

This commit is contained in:
Luke Taylor
2010-08-19 22:41:51 +01:00
parent 1680807470
commit c37ca1c2a9
23 changed files with 86 additions and 71 deletions
+3 -2
View File
@@ -16,9 +16,9 @@ configurations {
// Configuration which is ONLY used for compileJava and will not be inherited by any others
// Revisit post Gradle 1.0
compileOnly
// Used to identify deps whcih should be marked as "provided" in maven poms
// Used to identify deps which should be marked as "provided" in maven poms
provided
compile.extendsFrom provided
testCompile.extendsFrom provided
compile.transitive = false
testCompile.transitive = false
}
@@ -42,6 +42,7 @@ dependencies {
[configurations.runtime, configurations.default]*.exclude(module: 'commons-logging')
sourceSets.main.compileClasspath += configurations.compileOnly
sourceSets.main.compileClasspath += configurations.provided
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
+10 -1
View File
@@ -60,19 +60,28 @@ uploadArchives {
installer = install.repositories.mavenInstaller
def optionalDeps = ['commons-logging', 'ehcache', 'log4j', 'apacheds-core', 'jsp-api', 'jsr250-api', 'ldapsdk']
def optionalDeps = ['ehcache', 'log4j', 'apacheds-core', 'jsp-api', 'jsr250-api', 'ldapsdk']
def clogging = new org.apache.maven.model.Dependency()
clogging.artifactId = clogging.groupId = "commons-logging"
clogging.scope = 'compile'
clogging.optional = true
clogging.version = '1.1.1'
[installer, deployer]*.pom.collect { pom ->
pom.scopeMappings.addMapping(10, configurations.provided, 'provided')
}
[installer, deployer]*.pom*.whenConfigured { pom ->
// Remove test scope dependencies from published poms
pom.dependencies = pom.dependencies.findAll {it.scope != 'test'}
pom.dependencies.findAll { dep ->
optionalDeps.contains(dep.artifactId) ||
dep.groupId.startsWith('org.apache.directory') ||
dep.groupId.startsWith('org.slf4j')
}*.optional = true
pom.dependencies.add(clogging)
if (pom.artifactId == 'spring-security-config') {
pom.dependencies.find { dep -> dep.artifactId == 'spring-security-web'}.optional = true
pom.dependencies.find { dep -> dep.artifactId == 'spring-web'}.optional = true