-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle
More file actions
175 lines (147 loc) · 5.24 KB
/
build.gradle
File metadata and controls
175 lines (147 loc) · 5.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*******************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014,2015 by Peter Pilgrim, Milton Keynes, P.E.A.T LTD
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU GPL v3.0
* which accompanies this distribution, and is available at:
* http://www.gnu.org/licenses/gpl-3.0.txt
*
* Developers:
* Peter Pilgrim -- design, development and implementation
* -- Blog: http://www.xenonique.co.uk/blog/
* -- Twitter: @peter_pilgrim
*
* Contributors:
*
*******************************************************************************/
// Packt Publishing and Peter A. Pilgrim present the
// ================================================================================
// D I G I T A L J A V A E E 7 W E B D E V E L O P M E N T
// ================================================================================
//
// This is a multi-mode Gradle build. This is the root file.
// See also: http://www.gradle.org/docs/current/userguide/multi_project_builds.html
apply plugin: 'java'
// The name of this project
project.archivesBaseName = 'digital-javaee7-web-root'
// --------------------------------------------------------------------------------
// Settings for all Digital Java EE 7 projects
// --------------------------------------------------------------------------------
allprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
// Define equivalent Maven GAV coordinates.
group = 'uk.co.xenonique.digital'
version = '1.0-SNAPSHOT'
ext {
glassfishVersion = "4.1"
javaeeVersion = "7.0"
ozarkVersion = "1.0.0-m01"
// 1.0.0-m01 1.0.0-m02-SNAPSHOT
}
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://maven.java.net/content/groups/promoted'
}
maven {
url 'http://repository.jboss.org/nexus/content/groups/public'
}
}
// Java version compatibility to use when compiling Java source
sourceCompatibility = '1.8'
// Java version to generate classes
targetCompatibility = '1.8'
task wrapper(type: Wrapper) {
gradleVersion = '2.7'
}
idea {
module {
//if you love browsing Javadoc
downloadJavadoc = false
//and hate reading sources :)
downloadSources = true
}
}
}
// --------------------------------------------------------------------------------
// Configure settings for Digital Java EE 7 sub projects
// --------------------------------------------------------------------------------
subprojects {
dependencies {
// compile 'joda-time:joda-time:2.2'
// compile 'org.slf4j:slf4j-simple:1.6.4'
// compile 'org.glassfish.main.extras:glassfish-embedded-all:4.1'
// compile 'com.javaeehandbook.book1:glassfish-embedded-runner:1.0'
// compile 'org.jboss.shrinkwrap:shrinkwrap-api:1.0.1'
// compile 'org.jboss.shrinkwrap:shrinkwrap-impl-base:1.0.1'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
}
// Override Gradle defaults - a force an exploded JAR view
sourceSets {
main {
output.resourcesDir = 'build/classes/main'
output.classesDir = 'build/classes/main'
}
test {
resources {
srcDir 'src/test/resources'
}
resources {
srcDir 'src/test/resources-glassfish-embedded'
}
// resources {
// srcDir 'src/test/resources-jbossas-embedded'
// }
output.resourcesDir = 'build/classes/test'
output.classesDir = 'build/classes/test'
}
}
}
// --------------------------------------------------------------------------------
// Specific tasks and configuration for the current gradle module
// --------------------------------------------------------------------------------
// Specific task to build the ZIP
task myZip(type: Zip) {
description = "Creates a ZIP distribution of the `${archivesBaseName}' project."
from '.'
def datestamp = new Date().format("yyyyMMdd")
def targetName = "B01496-${archivesBaseName}-sources-${version}-${datestamp}.zip"
println "**** Creating achive targetName=${targetName} ****"
archiveName "${targetName}"
include '**/src/**'
include '**/*.xml'
include '**/*.gradle'
include '**/*.txt'
include '**/*.md'
include '**/.gitignore'
exclude '**/.gradle'
exclude '**/.gradle/**'
exclude '**/.idea'
exclude '**/.idea/**'
exclude '**/.eclipse'
exclude '**/.classpath'
exclude '**/build'
exclude '**/build/**'
exclude '**/target'
exclude '**/target/**'
exclude '**/classes'
exclude '**/classes/**'
exclude '**/out'
exclude '**/out/**'
into "B01496-${archivesBaseName}"
/*
exclude {
details ->
details.file.name.equals('.gradle')
}
*/
}
// End.