Last modified by Henrique Prange on 2015/09/11 17:57

Hide last authors
Henrique Prange 18.1 1 So you're interested in //kicking the maven tyres//, so to speak, or just want to see what it's all about. The following provides hints on how to try maven with your current WebObjects projects, if say you're using the standard WOLips ant builds, without having to adopt a different file structure. Whilst this is not the recommended approach for the long term it allows you to try things out side-by-side with your current build system.
Lachlan Deck 5.1 2
Henrique Prange 18.1 3 {{info title="Recommended Homework (or pre-requisites)"}}
pierce 27.1 4 It's //really// worth doing your homework on maven in order to understand it. The place to start is Learning Maven found at [[http:~~/~~/maven.apache.org>>url:http://maven.apache.org||shape="rect"]]. Various guides are also found at [[http:~~/~~/maven.apache.org/guides/>>url:http://maven.apache.org/guides/||shape="rect"]].
Lachlan Deck 5.1 5
pierce 27.1 6 At the very least you want to have read through, and understood, the [[Getting Started Tutorial>>url:http://maven.apache.org/guides/getting-started/index.html||shape="rect"]].
Henrique Prange 18.1 7
pierce 27.1 8 The maven user mailing list is also recommended for getting help. It's quite active and, as you find for the WebObjects mailing lists, is an invaluable resource. See [[Getting Help>>url:http://maven.apache.org/users/getting-help.html||shape="rect"]].
Henrique Prange 18.1 9 {{/info}}
10
Lachlan Deck 20.1 11 {{tip title="Hang in there"}}
12 This particular guide might look long but some of the xml is duplicated a few times to show differing examples.
13 {{/tip}}
14
pierce 27.1 15 === Why Maven ===
Henrique Prange 18.1 16
pierce 27.1 17 This might be stating the obvious, but an OO developer will, in the course of time (or is //supposed// to anyway), build up various encapsulated, //reusable//, libraries or frameworks that can be tapped into for differing projects. In addition, those frameworks or libraries will themselves often depend on third party frameworks like apache commons, log4j, or WebObjects.
Henrique Prange 18.1 18
pierce 27.1 19 It can be extraordinarily tedious to manage downloading, installing, compiling, and packaging these dependencies. Just finding a particular version of commons-logging-1.1.jar can take 20 minutes. Then everyone in your workgroup has to agree where to put it, and copy it over. If you decide to update to 1.1.1, you have to talk to everyone in your workgroup again, remember to put it into production when you deploy, etc.
20
21 This is not a new problem in computer science. There are other tools that attempt to solve this problem, maven just takes it beyond just the build stage into nightly builds, running tests, packaging, deploying, etc.
22
23 So in essence, the goal of maven is to automate even more of the whole build/test/install process then is currently done, even to the point of downloading software needed as part of the build. In addition, maven emphasizes //standards// over //configuration//. In WebObjects terms, that's a fancy way of saying that if you put your .wo files in Components, maven will know they need to go into the Resources folder in the .woa.
24
25 So while you still have to provide maven with information on the dependencies, if you use the standard locations for things, you won't have to specify much else.
26
27 === A sample build ===
28
29 So let's assume we have multiple frameworks and applications in our build. Each of these has some common ground, such as their dependencies on certain WebObjects frameworks, or the file layout, and of course they each may have something distinctive about them.
30
Henrique Prange 18.1 31 The layout of the frameworks and applications might look like this:
32
33 {{noformat}}
34 /trunk/
35 /trunk/apps/
36 /trunk/apps/ApplicationA/
37 /trunk/apps/ApplicationB/
38 /trunk/frameworks/
39 /trunk/frameworks/CustomExtensions/
40 /trunk/frameworks/CustomBusinessLogic/
41 /trunk/frameworks/etc/
42
43 {{/noformat}}
44
pierce 27.1 45 This is a pretty standard way for many WO developers to group their projects. Framework projects go into frameworks, apps into apps. We can leverage that standard layout to accomplish two things:
Henrique Prange 18.1 46
pierce 27.1 47 1. put as much configuration as possible that's shared between all frameworks, for example, into /frameworks/pom.xml so we only have to define it once. The configuration is inherited by a child pom. This makes the child pom.xml files simpler.
Henrique Prange 18.1 48 1. Be able to issue a single command that will package each and every framework and application.
49
50 === Key Concepts ===
51
52 Typical things that make up a pom are as follows. (Note: only pom identification is mandatory. All the others have defaults.)
53
Ramsey Gurley 28.1 54 1. (((
55 pom identification (who am I?)
56 The base triplet used to identify an artifact (i.e., something you need to build/package/install)
57
58 {{noformat}}
Henrique Prange 18.1 59 <artifactId>CustomExtensions</artifactId>
60 <groupId>com.mywostuff.frameworks</groupId>
61 <version>0.0.1-SNAPSHOT</version>
Ramsey Gurley 28.1 62
63 {{/noformat}}
64 )))
65 1. (((
66 pom packaging (i.e., what are we building?)
67 The default value for the packaging element is JAR if not specified. For the purposes of this exercise, we'll use JAR for the frameworks and woapplication for the applications, which requires the woproject maven plugin (TODO revisit this scenario with the apple maven plugin)
68
69 {{noformat}}
70 <packaging>woapplication</packaging>
71
72 {{/noformat}}
73 )))
74 1. (((
75 pom parent identification (who do I belong to?)
76
77 {{noformat}}
Henrique Prange 18.1 78 <parent>
79 <artifactId>frameworks</artifactId>
80 <groupId>com.mywostuff</groupId>
81 </parent>
Ramsey Gurley 28.1 82
83 {{/noformat}}
84 )))
85 1. (((
86 modules (a.k.a kids; who belongs to me?)
87
88 {{noformat}}
Henrique Prange 18.1 89 <modules>
90 <module>CustomExtensions</module>
91 <module>CustomBusinessLogic</module>
92 </modules>
Ramsey Gurley 28.1 93
94 {{/noformat}}
95 )))
96 1. (((
97 dependencies (what do I need?)
98
99 {{noformat}}
Henrique Prange 18.1 100 <dependencies>
101 <dependency>
102 <groupId>log4j</groupId>
103 <artifactId>log4j</artifactId>
104 <version>1.2.12</version>
105 <scope>compile</scope>
106 </dependency>
107 <dependency>
108 <groupId>junit</groupId>
109 <artifactId>junit</artifactId>
110 <version>4.4</version>
111 <scope>test</scope>
112 </dependency>
113 </dependencies>
Ramsey Gurley 28.1 114
115 {{/noformat}}
116 )))
117 1. build sources/resources (what do I have?)
Henrique Prange 18.1 118 1. properties and filtering resources (variable definitions)
119 1. dependency/plugin management (shared configuration and versioning)
120 1. repositories (where to find dependencies and plugins)
121
122 Of course, with the plethora of plugins available for maven, this is only the tip of the iceberg. However, these main concepts will suffice for now.
123
124 === Alternate File System Layout Concepts ===
125
pierce 27.1 126 As you would (i.e., should) have read by now, Maven has what it calls //standards//. One such standard is the [[standard directory layout>>url:http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html_standard||shape="rect"]]. One of the advantages of following the standards is that you get something for free: you have less to configure (or even almost nothing) in order to build a jar, for example, from your sources and resources. When that's not possible, options are available that allow you to //subvert// these standards or provide extra resouces.
Henrique Prange 18.1 127
128 {{tip title="Mavan Model Reference Doco"}}
pierce 27.1 129 To see what built-in options are available for maven see [[Maven Model>>url:http://maven.apache.org/ref/2.0.9/maven-model/maven.html||shape="rect"]].
Henrique Prange 18.1 130 {{/tip}}
131
pierce 27.1 132 In this case though, we're just trying to "kick the tyres", so we don't want to have to move our files around. The following roughly resembles the current WebObjects WOLips produced project layout (a.k.a Fluffy Bunny layout).
Henrique Prange 18.1 133
134 {{noformat}}
135 /MyProject
136 /MyProject/Components
137 /MyProject/Resources
138 /MyProject/Sources
139 /MyProject/Tests
140 /MyProject/WebServerResources
141
142 {{/noformat}}
143
pierce 27.1 144 Assuming your building a framework, for example, the following is an extract from the relevant pom.xml. It specifies where to find your java source files and resources, we can put this in /trunk/pom.xml and then all the child pom.xml files will know we're using Fluffy Bunny Layout. Notice we've also defined the target path for each resource. (See the [[WOL:Maven Model#class_resource>>url:http://maven.apache.org/ref/2.0.9/maven-model/maven.html#class_resource||shape="rect"]] for a definition of targetPath)
Henrique Prange 18.1 145
Ramsey Gurley 29.1 146 {{code 0="xml" title="pom.xml"}}
Lachlan Deck 5.1 147 <...>
148 <build>
Henrique Prange 18.1 149 <sourceDirectory>Sources</sourceDirectory>
150 <testSourceDirectory>Tests</testSourceDirectory>
Lachlan Deck 5.1 151 <resources>
152 <resource>
Henrique Prange 18.1 153 <targetPath>Resources</targetPath>
154 <filtering>false</filtering>
155 <directory>Components</directory>
Lachlan Deck 5.1 156 </resource>
Henrique Prange 18.1 157 <resource>
158 <targetPath>Resources</targetPath>
159 <filtering>false</filtering>
160 <directory>Resources</directory>
161 </resource>
162 <resource>
163 <targetPath>WebServerResources</targetPath>
164 <filtering>false</filtering>
165 <directory>WebServerResources</directory>
166 </resource>
Lachlan Deck 5.1 167 </resources>
Henrique Prange 18.1 168 <...>
Lachlan Deck 5.1 169 </build>
170 <...>
171
172 {{/code}}
173
Henrique Prange 18.1 174 So, concentrating on our frameworks alone for the moment, assuming all of your frameworks share the above project layout the above can happily go into your /frameworks/pom.xml file and as such be shared by all sub-modules (i.e., frameworks).
175
176 === Project Dependencies Concepts ===
177
pierce 27.1 178 Most projects, of course, have dependencies on other libraries or frameworks. See the [[WOL:Maven Getting Started#How_do_I_use_external_dependencies>>url:http://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies||shape="rect"]].
Henrique Prange 18.1 179
pierce 27.1 180 The following shows the mixture of third party dependencies and custom framework dependencies. Notice that the scope element determines the life cycle phase each dependency is relevant for. See [[WOL:Maven Model#class_dependency>>url:http://maven.apache.org/ref/2.0.9/maven-model/maven.html#class_dependency||shape="rect"]] for specific definitions.
Henrique Prange 18.1 181
Lachlan Deck 20.1 182 {{noformat}}
183 <dependencies>
184 <dependency>
185 <artifactId>CustomExtensions</artifactId>
186 <groupId>com.mywostuff.frameworks</groupId>
187 <version>0.0.1-SNAPSHOT</version>
188 <scope>compile</scope>
189 </dependency>
190 <dependency>
191 <groupId>log4j</groupId>
192 <artifactId>log4j</artifactId>
193 <version>1.2.12</version>
194 <scope>compile</scope>
195 </dependency>
196 <dependency>
197 <groupId>junit</groupId>
198 <artifactId>junit</artifactId>
199 <version>4.4</version>
200 <scope>test</scope>
201 </dependency>
202 </dependencies>
203
204 {{/noformat}}
205
Lachlan Deck 23.1 206 === Project Inheritance ===
207
pierce 27.1 208 It naturally gets a bit boring having to define the same things over and over again. So, you can utilise a parent pom file specifying its packaging as 'pom'. Dependencies, plugins and executions, resources specifications and so forth can be defined once and shared by any sub-modules. See [[http:~~/~~/maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance>>url:http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance||shape="rect"]] and [[Java World's The Maven 2 POM demystified>>url:http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html||shape="rect"]] for further information and examples.
Lachlan Deck 23.1 209
210 For our example we'll have trunk/pom.xml which will define everything common to any and all modules in the hierarchy. Likewise, trunk/frameworks/pom.xml and trunk/apps/pom.xml will define everything common to frameworks and applications respecively.
211
Lachlan Deck 20.1 212 === Repositories ===
213
pierce 27.1 214 So far we have assumed that maven just knows where to find third party libraries. There is the default local repository (e.g., ~~/.m2/repository) and a remote one at ibiblio.org or a mirror of the same. See [[http:~~/~~/maven.apache.org/guides/introduction/introduction-to-repositories.html>>url:http://maven.apache.org/guides/introduction/introduction-to-repositories.html||shape="rect"]]. Repositories are what lets you specify, "my app needs commons-logging-1.1.1" and maven can then pull it into the build as needed. Here we're adding some additional repositories to the defaults. You might want to setup one for your workgroup, and then there are some useful WO-related ones as well. We can include this in the master trunk/pom.xml file, then all the children can use it.
Lachlan Deck 20.1 215
216 {{noformat}}
217 <repositories>
218 <repository>
219 <id>system-repo</id>
220 <name>internal repository</name>
221 <!-- TODO switch over to your intranet.domain -->
222 <url>file://${user.home}/.myarchiva</url>
223 <snapshots>
224 <enabled>true</enabled>
225 <updatePolicy>always</updatePolicy>
226 <checksumPolicy>ignore</checksumPolicy>
227 </snapshots>
228 <releases>
229 <enabled>true</enabled>
230 <updatePolicy>always</updatePolicy>
231 <checksumPolicy>ignore</checksumPolicy>
232 </releases>
233 </repository>
234 <repository>
235 <id>maven2-repository.dev.java.net</id>
236 <name>Java.net Repository for Maven</name>
237 <url>http://download.java.net/maven/2</url>
238 <snapshots>
239 <enabled>true</enabled>
240 <updatePolicy>daily</updatePolicy>
241 </snapshots>
242 <releases>
243 <enabled>true</enabled>
244 <updatePolicy>daily</updatePolicy>
245 </releases>
246 </repository>
247 <repository>
248 <id>webobjects.mdimension.com/releases</id>
249 <name>mdimension maven 2 releases repo</name>
250 <url>http://webobjects.mdimension.com/maven2/releases</url>
251 <snapshots>
252 <enabled>false</enabled>
253 </snapshots>
254 <releases>
255 <enabled>true</enabled>
256 </releases>
257 </repository>
258 <repository>
259 <id>webobjects.mdimension.com/snapshots</id>
260 <name>mdimension maven 2 snapshots repo</name>
261 <url>http://webobjects.mdimension.com/maven2/snapshots</url>
262 <snapshots>
263 <enabled>true</enabled>
264 </snapshots>
265 <releases>
266 <enabled>false</enabled>
267 </releases>
268 </repository>
269 <repository>
270 <id>objectstyle-maven2</id>
271 <name>objectstyle maven2 repo</name>
272 <url>http://objectstyle.org/maven2</url>
273 <snapshots>
274 <enabled>false</enabled>
275 </snapshots>
276 <releases>
277 <enabled>true</enabled>
278 </releases>
279 </repository>
280 </repositories>
281
282 {{/noformat}}
283
pierce 27.1 284 Note: A remote repository is not guaranteed to keep older versions of libraries, for example, indefinitely. This is why it's recommended that you set up one for your intranet which stores what you need for longevity. See both the above intro to repositories and [[http:~~/~~/www.theserverside.com/tt/articles/article.tss?l=SettingUpMavenRepository>>url:http://www.theserverside.com/tt/articles/article.tss?l=SettingUpMavenRepository||shape="rect"]].
Lachlan Deck 20.1 285
Henrique Prange 18.1 286 === Packaging Frameworks as Jars ===
287
pierce 27.1 288 Here's the definition for /frameworks/pom.xml, definitions here will be shared by all of the individual framework pom.xml files. Note that it depends on the following Info.plist file being located under trunk/frameworks/src/main/resources (maven builds can use files stored in common off of a shared structure):
Henrique Prange 18.1 289
Lachlan Deck 23.1 290
Ramsey Gurley 28.1 291
Ramsey Gurley 29.1 292 {{attachments upload="false" patterns="Info.plist"/}}
Ramsey Gurley 28.1 293
Ramsey Gurley 29.1 294 {{code 0="xml" title="/frameworks/pom.xml"}}
Lachlan Deck 20.1 295 <?xml version="1.0" encoding="UTF-8"?>
296 <project xmlns="http://maven.apache.org/POM/4.0.0"
297 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
298 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
299 http://maven.apache.org/xsd/maven-4.0.0.xsd">
300
301 <modelVersion>4.0.0</modelVersion>
Lachlan Deck 23.1 302
Lachlan Deck 20.1 303 <!-- parent artifact -->
304 <parent>
305 <artifactId>mywostuff</artifactId>
306 <groupId>com</groupId>
307 <version>1.0-SNAPSHOT</version>
308 </parent>
309
310 <!-- artifact identity -->
311 <artifactId>frameworks</artifactId>
312 <groupId>com.mywostuff</groupId>
313 <packaging>pom</packaging>
Lachlan Deck 23.1 314
Lachlan Deck 20.1 315 <!-- framework relevant properties -->
316 <properties>
317 <!-- NS related properties fills in Info.plist etc-->
318 <CFBundleDevelopmentRegion>English</CFBundleDevelopmentRegion>
319 <CFBundleGetInfoString></CFBundleGetInfoString>
320 <CFBundlePackageType>FMWK</CFBundlePackageType>
321 <CFBundleIconFile>WOAfile.icns</CFBundleIconFile>
322 <CFBundleInfoDictionaryVersion>6.0</CFBundleInfoDictionaryVersion>
323 <CFBundleVersion>5.3.1</CFBundleVersion>
324 <Has_WOComponents>true</Has_WOComponents>
325 <NSPrincipalClass>${mainclass}</NSPrincipalClass>
326 <NSResourcesBundlePath></NSResourcesBundlePath>
327 </properties>
328
329 <!-- modules -->
330 <modules>
331 <module>CustomExtensions</module>
332 <module>CustomBusinessLogic</module>
333 </modules>
334
335 <!-- specific dependencies (for modules) -->
336 <dependencies>
337 <dependency>
338 <artifactId>ERExtensions</artifactId>
339 <groupId>${wonder.common.groupId}</groupId>
340 </dependency>
341 <dependency>
342 <artifactId>JavaWOExtensions</artifactId>
343 <groupId>${wonder.common.groupId}</groupId>
344 </dependency>
345 <dependency>
346 <artifactId>JavaFoundation</artifactId>
347 <groupId>${webobjects.groupId}</groupId>
348 </dependency>
349 <dependency>
350 <artifactId>JavaJDBCAdaptor</artifactId>
351 <groupId>${webobjects.groupId}</groupId>
352 </dependency>
353 <dependency>
354 <artifactId>JavaWebObjects</artifactId>
355 <groupId>${webobjects.groupId}</groupId>
356 </dependency>
357 <dependency>
358 <artifactId>JavaEOControl</artifactId>
359 <groupId>${webobjects.groupId}</groupId>
360 </dependency>
361 <dependency>
362 <artifactId>JavaEOAccess</artifactId>
363 <groupId>${webobjects.groupId}</groupId>
364 </dependency>
365 <dependency>
366 <artifactId>JavaWebObjects</artifactId>
367 <groupId>${webobjects.groupId}</groupId>
368 </dependency>
369 <dependency>
370 <artifactId>JavaXML</artifactId>
371 <groupId>${webobjects.groupId}</groupId>
372 </dependency>
373 </dependencies>
374
375
376 <!-- build config (for modules) -->
377 <build>
378 <sourceDirectory>src</sourceDirectory>
379 <testSourceDirectory>tests</testSourceDirectory>
380 <resources>
381 <!-- relative dir for Info.plist -->
382 <resource>
383 <targetPath>Resources</targetPath>
384 <filtering>true</filtering>
385 <directory>../src/main/resources</directory>
386 </resource>
387 <resource>
388 <targetPath>Resources</targetPath>
389 <filtering>false</filtering>
390 <directory>Components</directory>
391 </resource>
392 <resource>
393 <targetPath>Resources</targetPath>
394 <filtering>false</filtering>
395 <directory>Resources</directory>
396 </resource>
397 <resource>
398 <targetPath>WebServerResources</targetPath>
399 <filtering>false</filtering>
400 <directory>WebServerResources</directory>
401 </resource>
402 </resources>
403 <plugins>
404 <plugin>
405 <groupId>org.apache.maven.plugins</groupId>
406 <artifactId>maven-compiler-plugin</artifactId>
407 <configuration>
408 <source>${java.target}</source>
409 <target>${java.target}</target>
410 </configuration>
411 </plugin>
412 </plugins>
413 </build>
414 </project>
415
416 {{/code}}
417
pierce 27.1 418 Since our CustomExtensions has no further dependencies, its pom.xml merely specifies its parent and its identity.
Lachlan Deck 20.1 419
Ramsey Gurley 29.1 420 {{code 0="xml" title="/frameworks/CustomBusinessLogic/pom.xml"}}
Lachlan Deck 20.1 421 <?xml version="1.0"?>
422 <project>
423 <!-- parent artifact -->
424 <parent>
425 <artifactId>frameworks</artifactId>
426 <groupId>com.mywostuff</groupId>
427 <version>1.0-SNAPSHOT</version>
428 </parent>
429
430 <!-- artifact identity -->
431 <artifactId>CustomBusinessLogic</artifactId>
432 <groupId>com.mywostuff.frameworks</groupId>
433 </project>
434
435 {{/code}}
436
pierce 27.1 437 CustomBusinessLogic has a further dependency on CustomExtensions, so it specifies its parent, its identity, and the dependency.
Lachlan Deck 20.1 438
Ramsey Gurley 29.1 439 {{code 0="xml" title="/frameworks/CustomBusinessLogic/pom.xml"}}
Lachlan Deck 20.1 440 <?xml version="1.0"?>
441 <project>
442 <!-- parent artifact -->
443 <parent>
444 <artifactId>frameworks</artifactId>
445 <groupId>com.mywostuff</groupId>
446 <version>1.0-SNAPSHOT</version>
447 </parent>
448
449 <!-- artifact identity -->
450 <artifactId>CustomBusinessLogic</artifactId>
451 <groupId>com.mywostuff.frameworks</groupId>
Lachlan Deck 23.1 452
Lachlan Deck 20.1 453 <!-- specific dependencies -->
454 <dependencies>
455 <dependency>
456 <artifactId>CustomExtensions</artifactId>
457 <groupId>${pom.groupId}</groupId>
458 </dependency>
459 </dependencies>
460 </project>
461
462 {{/code}}
463
Henrique Prange 18.1 464 === Packaging Applications ===
465
pierce 27.1 466 Here's the definition for /apps/pom.xml which is shared by any sub-modules (i.e., ApplicationA and ApplicationB). Both apps need certain WebObjects frameworks, so we specify those only once for both, here in the parent pom. We also specify Fluffy Bunny Layout, and some maven plugins we want to use. Again, this is for both applications.
Henrique Prange 18.1 467
Ramsey Gurley 29.1 468 {{code 0="xml" title="/apps/pom.xml"}}
Lachlan Deck 23.1 469 <?xml version="1.0" encoding="UTF-8"?>
470 <project xmlns="http://maven.apache.org/POM/4.0.0"
471 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
472 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
473 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Henrique Prange 18.1 474
Lachlan Deck 23.1 475 <modelVersion>4.0.0</modelVersion>
Henrique Prange 18.1 476
Lachlan Deck 23.1 477 <!-- parent artifact -->
478 <parent>
479 <groupId>com</groupId>
480 <artifactId>mywostuff</artifactId>
481 <version>1.0-SNAPSHOT</version>
482 </parent>
Henrique Prange 18.1 483
Lachlan Deck 23.1 484 <!-- artifact identity -->
485 <artifactId>apps</artifactId>
486 <groupId>com.mywostuff</groupId>
487 <packaging>pom</packaging>
Henrique Prange 18.1 488
Lachlan Deck 23.1 489 <!-- modules -->
490 <modules>
491 <module>ApplicationA</module>
492 <module>ApplicationB</module>
493 </modules>
494
495 <!-- specific dependencies (for modules) -->
496 <dependencies>
497 <!-- wonder frameworks -->
498 <dependency>
499 <artifactId>ERExtensions</artifactId>
500 <groupId>${wonder.common.groupId}</groupId>
501 </dependency>
502 <dependency>
503 <artifactId>JavaWOExtensions</artifactId>
504 <groupId>${wonder.common.groupId}</groupId>
505 </dependency>
506
507 <!-- project libs -->
508 <dependency>
509 <artifactId>CustomExtensions</artifactId>
510 <groupId>${my.frameworks.groupId}</groupId>
511 </dependency>
512 <dependency>
513 <artifactId>CustomBusinessLogic</artifactId>
514 <groupId>${my.frameworks.groupId}</groupId>
515 </dependency>
516
517 <!-- webobjects dependencies -->
518 <dependency>
519 <artifactId>JavaFoundation</artifactId>
520 <groupId>${webobjects.groupId}</groupId>
521 </dependency>
522 <dependency>
523 <artifactId>JavaJDBCAdaptor</artifactId>
524 <groupId>${webobjects.groupId}</groupId>
525 </dependency>
526 <dependency>
527 <artifactId>JavaWebObjects</artifactId>
528 <groupId>${webobjects.groupId}</groupId>
529 </dependency>
530 <dependency>
531 <artifactId>JavaEOControl</artifactId>
532 <groupId>${webobjects.groupId}</groupId>
533 </dependency>
534 <dependency>
535 <artifactId>JavaEOAccess</artifactId>
536 <groupId>${webobjects.groupId}</groupId>
537 </dependency>
538 <dependency>
539 <artifactId>JavaWebObjects</artifactId>
540 <groupId>${webobjects.groupId}</groupId>
541 </dependency>
542 <dependency>
543 <artifactId>JavaXML</artifactId>
544 <groupId>${webobjects.groupId}</groupId>
545 </dependency>
546 </dependencies>
547
548 <!-- build config (for modules) -->
549 <build>
550 <sourceDirectory>src</sourceDirectory>
551 <testSourceDirectory>tests</testSourceDirectory>
552 <resources>
553 <resource>
554 <targetPath>Resources</targetPath>
555 <filtering>false</filtering>
556 <directory>Components</directory>
557 </resource>
558 <resource>
559 <targetPath>Resources</targetPath>
560 <filtering>false</filtering>
561 <directory>Resources</directory>
562 </resource>
563 <resource>
564 <targetPath>WebServerResources</targetPath>
565 <filtering>false</filtering>
566 <directory>WebServerResources</directory>
567 </resource>
568 </resources>
569 <plugins>
570 <plugin>
571 <artifactId>maven-wolifecycle-plugin</artifactId>
572 <groupId>org.objectstyle.woproject.maven2</groupId>
573 <version>2.0.15</version>
574 <extensions>true</extensions>
575 <configuration>
576 <source>${java.target}</source>
577 <target>${java.target}</target>
578 </configuration>
579 </plugin>
580 <plugin>
581 <groupId>org.apache.maven.plugins</groupId>
582 <artifactId>maven-javadoc-plugin</artifactId>
583 <configuration>
584 <javadocVersion>${java.target}</javadocVersion>
585 <locale>en-AU</locale>
586 <minmemory>128m</minmemory>
587 <maxmemory>512m</maxmemory>
588 </configuration>
589 </plugin>
590 <!--
591 TODO build numbering
592 <plugin>
593 <groupId>org.codehaus.mojo</groupId>
594 <artifactId>maven-buildnumber-plugin</artifactId>
595 <version>0.9.6</version>
596 <executions>
597 <execution>
598 <phase>validate</phase>
599 <goals>
600 <goal>create</goal>
601 </goals>
602 </execution>
603 </executions>
604 <configuration>
605 <doCheck>true</doCheck>
606 <doUpdate>true</doUpdate>
607 </configuration>
608 </plugin>
609 -->
610 </plugins>
611 <pluginManagement>
612 <plugins>
613 <plugin>
614 <groupId>org.apache.maven.plugins</groupId>
615 <artifactId>maven-compiler-plugin</artifactId>
616 <configuration>
617 <source>${java.target}</source>
618 <target>${java.target}</target>
619 </configuration>
620 </plugin>
621 </plugins>
622 </pluginManagement>
623 </build>
624 </project>
625
626 {{/code}}
627
pierce 27.1 628 With most stuff specified in the parent pom, ApplicationA needs only to specify its parent, its idenity, and add a couple of extra specific dependencies to those inherited from its parent.
Lachlan Deck 23.1 629
Ramsey Gurley 29.1 630 {{code 0="xml" title="/apps/ApplicationA/pom.xml"}}
Lachlan Deck 23.1 631 <?xml version="1.0"?>
632 <project>
633 <modelVersion>4.0.0</modelVersion>
634
635 <!-- parent artifact -->
636 <parent>
637 <artifactId>apps</artifactId>
638 <groupId>com.mywostuff</groupId>
639 <version>1.0-SNAPSHOT</version>
640 <relativePath>../apps</relativePath> <!-- e.g., (optional) if your app is under /trunk -->
641 </parent>
642
643 <!-- artifact identity -->
644 <artifactId>ApplicationA</artifactId>
645 <groupId>com.mywostuff.apps</groupId>
646 <packaging>woapplication</packaging> <!-- woproject specific packaging -->
647
648 <!-- specific properties -->
649 <properties>
650 <!-- general properties -->
651 <mainclass>your.app.Application</mainclass>
652 </properties>
653
654 <!-- specific dependencies -->
655 <dependencies>
656 <!-- wonder frameworks -->
657 <dependency>
658 <artifactId>Ajax</artifactId>
659 <groupId>${wonder.ajax.groupId}</groupId>
660 </dependency>
661 <dependency>
662 <artifactId>ERCaptcha</artifactId>
663 <groupId>${wonder.common.groupId}</groupId>
664 <!-- requires jcaptcha-all below -->
665 </dependency>
666 <dependency>
667 <artifactId>WOOgnl</artifactId>
668 <groupId>${wonder.common.groupId}</groupId>
669 </dependency>
670
671 <!-- general libs -->
672 <dependency>
673 <artifactId>jcaptcha-all</artifactId>
674 <groupId>com.octo.captcha</groupId>
675 </dependency>
676 <dependency>
677 <artifactId>commons-collections</artifactId>
678 <groupId>commons-collections</groupId>
679 </dependency>
680 <dependency>
681 <groupId>ognl</groupId>
682 <artifactId>ognl</artifactId>
683 </dependency>
684 </dependencies>
685 </project>
686
687 {{/code}}
688
689 === Packaging Applications as True WAR ===
690
Henrique Prange 30.1 691 You can find steps to package WO Applications as True WAR [[here>>doc:WOL.Home.WOProject-Maven.Packaging WO Applications as true WAR with Maven.WebHome]].
Lachlan Deck 23.1 692
Henrique Prange 18.1 693 === Eclipse Integration ===
694
695 details to come...
696
697 === Putting It All Together ===
698
699 details to come...