forked from peterpilgrim/javaee7-developer-handbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
executable file
·252 lines (136 loc) · 6.05 KB
/
README.txt
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
README README README README README README README README README README
================================================================================
Author: Peter A. Pilgrim
Original Date: 01/October/2012
Impression Date: 31/July/2013
Email: [email protected]
================================================================================
J A V A E E 7 D E V E L O P E R H A N D B O O K
================================================================================
This is software to go with the book with ``The Java EE 7 Developer
Handbook'' written by Peter A. Pilgrim, published by Packt Publishing.
(September 2013)
You can purchase a copy of the book from Packt Pub at this URL:
http://www.packtpub.com/java-ee-7-developer-handbook/book
This source code distribution can be found on GitHub after the
book's publication date:
http://github.com/peterpilgrim/javaee7-developer-handbook
(The code will be uploaded simultaneously with the book's
publication date ;-)
LICENSE
------------
The entire source code and software for the book falls under the GNU
GENERAL PUBLIC LICENSE (Version 3, 29 June 2007)
http://www.gnu.org/licenses/gpl-3.0.txt
See the ``LICENSE.txt'' for the full legal text.
COMPILATION
------------
Each of the chapters in the book has its own folder, and within those
chapter folder there is at least one project folder with a Gradle
project. You will recognize them, because they have a ``build.gradle'
file inside them. This is the project build file.
Go http://gradle.org/ and download Gradle version 1.6 or better
To compile the program
% gradle build
Explicitly to just compile the sources, run this command line:
% gradle compileJava
To clean the project and reset to the start, run this command line:
% gradle clean
TEST
-----
Ask Gradle to run the Unit Tests with the following comand:
% gradle test --info
Look for the results in the folder `build/reports' and view the HTML
file inside a web browser or examine the XML test file. By the way all
of the tests from the source code were written with JUnit.
ECLIPSE
------------
Ask Gradle to (re-)create Eclipse project artifacts ``.classpath''
and ``.project''
% gradle eclipse
IDEA
---------
Ask Gradle to (re-)create IDEA project configuration files ``*.ipr''
and ``*.iml'' etc
% gradle idea
DEPENDENCIES
-----------------
You can ask a gradle project about its dependencies with the following:
% gradle dependencies
And you can find out about the tasks that you can invoke with:
% gradle tasks
OTHER ARTIFACTS
-----------------
Some project create WAR files. Gradle plugin for WAR files bind
automatically `assemble'. This also applies to EAR and RAR files. So
this implies that:
% gradle assemble
Will do the right thing for certain projects. Here are some other
useful Gradle tasks.
% gradle jar // for project that builds a JAR
% gradle war // ditto
% gradle ear // ditto
ROOT GRADLE PROJECT
----------------------
The root `build.gradle' file now can build the subprojects. It is
NOT by any stretch of the imagination a standard Gradle
multi-module project, however. Here are the necessary commands
Build just the initial project, here is the command:
% gradle build
Build everything project in the Java EE 7 Developer Handbook example
except for Chapter 11, use this command:
% gradle build_everything
To build and install all projects to the local Ivy repository:
% gradle install_everything
To clean all projects, run this following command:
% gradle clean_everything
To clean and build projects, run this following command:
% gradle clean_build_everything
// equivalent to `gradle clean build'
% gradle clean_install_everything
// equivalent to `gradle clean install'
It certainly helps to know how to list out tasks in a Gradle project.
To find about Gradle the available tasks, execute the following command:
% gradle tasks --all
MISCELLANEOUS
----------------
I had to disable the multi-module nature of the root Gradle project,
because it does not work intuitively for sub modules. With multi-module
enables, running `gradle idea' for any of the sub module causes Gradle
to copy all the other dependencies into that module, which is definitely
not acceptable!
Sadly, the only thing the root Gradle project can do is build a
distribution ZIP file. If you don't belive me, I shared my problem with
Luke Daley, the Gradleware committer and he told me that is the way
Gradle works.
% gradle myZip
++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++
++++ LATE BREAKING NEWS ++++
++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++
At the last moment, I decided to split the XenTracker demonstration is
two modes: modern and traditional. The first mode that I developed uses
AngularJS (http://angularjs.org), a popular JavaScript framework and
this is very modern. However I realized that this would be impedement to
very new Java EE developer, who have just started to learn JavaServer
Pages, JavaServer Faces and therefore I felt their learning would
benefit a simplified page flow without AJAX. So please bear with me as I
sort out the split. PS: I am doing post JavaOne 2013, conference and
travelling around California.
HINT:
Navigate to the `Embedded Container' project and build that one first.
Execute the following commands from the project root directory
% cd appendix01/glassfish-embedded
% gradle clean
% gradle install
The embedded container is used by many of the examples. I am sorry about
this mess, because Gradle multi-module files do not behave exactly like
Maven modules. I counted on it when I was writing the book and then
discovered this was the wrong approach for IDE's such as JetBrains IDEA.
++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++
All the best.
Peter Pilgrim, 2013
To send comments, email me : [email protected]
Web Blog http://www.xenonique.co.uk/blog/