Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Update war task to create war with exclusions.
Browse files Browse the repository at this point in the history
  • Loading branch information
proteus-russ committed Mar 5, 2014
1 parent 27d4500 commit 2034a9b
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions example-app/build.gradle
Expand Up @@ -49,7 +49,7 @@ buildscript {
classpath 'com.i2rd:gradle-aspectj-weave:1.1',
'org.jfrog.buildinfo:build-info-extractor-gradle:2.2+',
'org.ajoberstar:gradle-git:0.6.3'
//'org.hibernate:hibernate-gradle-plugin:4.2.8' - waiting to show up in release repos
//'org.hibernate:hibernate-gradle-plugin:4.3.1.Final'
}
}

Expand Down Expand Up @@ -95,8 +95,16 @@ ext.sharedManifest = manifest {
'Implementation-Version': version,
'Commit-ID': (hasProperty('gitinfo') ? gitinfo.commit : '')
}
jar { manifest = sharedManifest }
war { manifest = sharedManifest }
jar {
manifest = sharedManifest
enabled = true
}
ext.warTaskSpecified = gradle.startParameter.taskNames.any {it == 'war'}
war {
manifest = sharedManifest
classpath = jar.outputs.files + configurations.runtime
if(warTaskSpecified) classpath = classpath - configurations.providedRuntime
}
configurations {
runtimeaspects { transitive = false }
compiletimeaspects { transitive = false }
Expand Down Expand Up @@ -133,6 +141,16 @@ dependencies {
"org.springframework:spring-aspects:${springVersion}"

testCompile 'junit:junit:4.11'


// These are for the war plugin
if(warTaskSpecified)
{
providedCompile('javax.servlet:javax.servlet-api:3.0+'){ transitive = false }
providedCompile('javax.servlet.jsp:jsp-api:2.2'){ transitive = false }
//providedCompile('org.eclipse.jetty.orbit:org.apache.jasper.glassfish:2.2+')
providedCompile('org.eclipse.jetty:jetty-jsp:8+')
}
}

task wrapper(type: Wrapper) { gradleVersion = '1.8' }
Expand All @@ -158,7 +176,7 @@ gradle.projectsEvaluated {
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
include 'net/proteusframework/**'
include 'com/example/**'
}
javadoc {
def year = new SimpleDateFormat('yyyy').format(new Date())
Expand Down Expand Up @@ -190,7 +208,7 @@ javadoc {
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
include 'net/proteusframework/**'
include 'com/example/**'
}
publishing {
publications {
Expand Down

0 comments on commit 2034a9b

Please sign in to comment.