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

From version 12.1
edited by Lachlan Deck
on 2008/06/15 18:39
Change comment: Continuing to flesh it out...
To version 11.1
edited by pierce
on 2008/07/03 14:25
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ldeck
1 +XWiki.pierce
Content
... ... @@ -2,7 +2,7 @@
2 2  
3 3  {{info title="Recommended Homework (or pre-requisites)"}}
4 4  
5 -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. Various guides are also found at http://maven.apache.org/guides/.
5 +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]. Various guides are also found at [http://maven.apache.org/guides/].
6 6  
7 7  At the very least you want to have read through, and understood, the [Getting Started Tutorial|http://maven.apache.org/guides/getting-started/index.html].
8 8  
... ... @@ -10,10 +10,28 @@
10 10  
11 11  {{/info}}
12 12  
13 -=== What's the aim ===
13 +{{tip title="Hang in there"}}
14 14  
15 -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. 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.
15 +This particular guide might look long but some of the xml is duplicated a few times to show differing examples.
16 16  
17 +{{/tip}}
18 +
19 +=== Why Maven ===
20 +
21 +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.
22 +
23 +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.
24 +
25 +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.
26 +
27 +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.
28 +
29 +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.
30 +
31 +=== A sample build ===
32 +
33 +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.
34 +
17 17  The layout of the frameworks and applications might look like this:
18 18  
19 19  {{noformat}}
... ... @@ -29,9 +29,9 @@
29 29  
30 30  {{/noformat}}
31 31  
32 -Our aim is twofold:
50 +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:
33 33  
34 -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.
52 +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.
35 35  1. Be able to issue a single command that will package each and every framework and application.
36 36  
37 37  === Key Concepts ===
... ... @@ -39,33 +39,51 @@
39 39  Typical things that make up a pom are as follows. (Note: only pom identification is mandatory. All the others have defaults.)
40 40  
41 41  1. pom identification (who am I?)
42 - The base triplet used to identify an artifact (i.e., product)
43 - {{noformat}}
60 +The base triplet used to identify an artifact (i.e., something you need to build/package/install)
61 +
62 +{{noformat}}
63 +
44 44   <artifactId>CustomExtensions</artifactId>
45 45   <groupId>com.mywostuff.frameworks</groupId>
46 46   <version>0.0.1-SNAPSHOT</version>
47 - {{/noformat}}
67 +
68 +{{/noformat}}
69 +
48 48  1. pom packaging (i.e., what are we building?)
49 - 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)
50 - {{noformat}}
71 +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)
72 +
73 +{{noformat}}
74 +
51 51   <packaging>woapplication</artifactId>
52 - {{/noformat}}
76 +
77 +{{/noformat}}
78 +
53 53  1. pom parent identification (who do I belong to?)
54 - {{noformat}}
80 +
81 +{{noformat}}
82 +
55 55   <parent>
56 56   <artifactId>frameworks</artifactId>
57 57   <groupId>com.mywostuff</groupId>
58 58   </parent>
59 - {{/noformat}}
87 +
88 +{{/noformat}}
89 +
60 60  1. modules (a.k.a kids; who belongs to me?)
61 - {{noformat}}
91 +
92 +{{noformat}}
93 +
62 62   <modules>
63 63   <module>CustomExtensions</module>
64 64   <module>CustomBusinessLogic</module>
65 65   </modules>
66 - {{/noformat}}
98 +
99 +{{/noformat}}
100 +
67 67  1. dependencies (what do I need?)
68 - {{noformat}}
102 +
103 +{{noformat}}
104 +
69 69   <dependencies>
70 70   <dependency>
71 71   <groupId>log4j</groupId>
... ... @@ -80,13 +80,15 @@
80 80   <scope>test</scope>
81 81   </dependency>
82 82   </dependencies>
83 - {{/noformat}}
119 +
120 +{{/noformat}}
121 +
84 84  1. build sources/resources (what do I have?)
85 85  1. properties and filtering resources (variable definitions)
86 86  1. dependency/plugin management (shared configuration and versioning)
87 87  1. repositories (where to find dependencies and plugins)
88 88  
89 -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.
127 +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.
90 90  
91 91  === Alternate File System Layout Concepts ===
92 92  
... ... @@ -98,7 +98,7 @@
98 98  
99 99  {{/tip}}
100 100  
101 -The following roughly resembles the current WebObjects WOLips produced project layout (a.k.a Fluffy Bunny layout).
139 +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).
102 102  
103 103  {{noformat}}
104 104  
... ... @@ -111,7 +111,7 @@
111 111  
112 112  {{/noformat}}
113 113  
114 -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. Notice we've also defined the target path for each resource. (See the [[Maven Model#class//resource//>>http://maven.apache.org/ref/2.0.9/maven-model/maven.html#class_resource]] for a definition of targetPath)
152 +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//>>http://maven.apache.org/ref/2.0.9/maven-model/maven.html#class_resource]] for a definition of targetPath)
115 115  
116 116  {{code title="pom.xml"}}
117 117  
... ... @@ -146,24 +146,526 @@
146 146  
147 147  === Project Dependencies Concepts ===
148 148  
149 -Most projects, of course, have dependencies on other libraries or frameworks.
187 +Most projects, of course, have dependencies on other libraries or frameworks. See the [[WOL:Maven Getting Started#How//do//I//use//external//dependencies//>>http://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies]].
150 150  
151 -=== Project Dependencies Prerequisites ===
189 +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//>>http://maven.apache.org/ref/2.0.9/maven-model/maven.html#class_dependency]] for specific definitions.
152 152  
153 -details to come...
191 +{{noformat}}
154 154  
193 + <dependencies>
194 + <dependency>
195 + <artifactId>CustomExtensions</artifactId>
196 + <groupId>com.mywostuff.frameworks</groupId>
197 + <version>0.0.1-SNAPSHOT</version>
198 + <scope>compile</scope>
199 + </dependency>
200 + <dependency>
201 + <groupId>log4j</groupId>
202 + <artifactId>log4j</artifactId>
203 + <version>1.2.12</version>
204 + <scope>compile</scope>
205 + </dependency>
206 + <dependency>
207 + <groupId>junit</groupId>
208 + <artifactId>junit</artifactId>
209 + <version>4.4</version>
210 + <scope>test</scope>
211 + </dependency>
212 + </dependencies>
213 +
214 +{{/noformat}}
215 +
216 +=== Project Inheritance ===
217 +
218 +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]] and [[Java World's The Maven 2 POM demystified>>http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html]] for further information and examples.
219 +
220 +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.
221 +
222 +=== Repositories ===
223 +
224 +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]]. 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.
225 +
226 +{{noformat}}
227 +
228 +<repositories>
229 + <repository>
230 + <id>system-repo</id>
231 + <name>internal repository</name>
232 + <!-- TODO switch over to your intranet.domain -->
233 + <url>file://${user.home}/.myarchiva</url>
234 + <snapshots>
235 + <enabled>true</enabled>
236 + <updatePolicy>always</updatePolicy>
237 + <checksumPolicy>ignore</checksumPolicy>
238 + </snapshots>
239 + <releases>
240 + <enabled>true</enabled>
241 + <updatePolicy>always</updatePolicy>
242 + <checksumPolicy>ignore</checksumPolicy>
243 + </releases>
244 + </repository>
245 + <repository>
246 + <id>maven2-repository.dev.java.net</id>
247 + <name>Java.net Repository for Maven</name>
248 + <url>http://download.java.net/maven/2</url>
249 + <snapshots>
250 + <enabled>true</enabled>
251 + <updatePolicy>daily</updatePolicy>
252 + </snapshots>
253 + <releases>
254 + <enabled>true</enabled>
255 + <updatePolicy>daily</updatePolicy>
256 + </releases>
257 + </repository>
258 + <repository>
259 + <id>webobjects.mdimension.com/releases</id>
260 + <name>mdimension maven 2 releases repo</name>
261 + <url>http://webobjects.mdimension.com/maven2/releases</url>
262 + <snapshots>
263 + <enabled>false</enabled>
264 + </snapshots>
265 + <releases>
266 + <enabled>true</enabled>
267 + </releases>
268 + </repository>
269 + <repository>
270 + <id>webobjects.mdimension.com/snapshots</id>
271 + <name>mdimension maven 2 snapshots repo</name>
272 + <url>http://webobjects.mdimension.com/maven2/snapshots</url>
273 + <snapshots>
274 + <enabled>true</enabled>
275 + </snapshots>
276 + <releases>
277 + <enabled>false</enabled>
278 + </releases>
279 + </repository>
280 + <repository>
281 + <id>objectstyle-maven2</id>
282 + <name>objectstyle maven2 repo</name>
283 + <url>http://objectstyle.org/maven2</url>
284 + <snapshots>
285 + <enabled>false</enabled>
286 + </snapshots>
287 + <releases>
288 + <enabled>true</enabled>
289 + </releases>
290 + </repository>
291 +</repositories>
292 +
293 +{{/noformat}}
294 +
295 +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]].
296 +
155 155  === Packaging Frameworks as Jars ===
156 156  
157 -details to come...
299 +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):
158 158  
301 +{{attachments patterns="Info.plist" upload="false"}}{{/attachments}}
302 +
303 +{{code title="/frameworks/pom.xml"}}
304 +
305 +<?xml version="1.0" encoding="UTF-8"?>
306 +<project xmlns="http://maven.apache.org/POM/4.0.0"
307 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
308 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
309 + http://maven.apache.org/xsd/maven-4.0.0.xsd">
310 +
311 + <modelVersion>4.0.0</modelVersion>
312 +
313 + <!-- parent artifact -->
314 + <parent>
315 + <artifactId>mywostuff</artifactId>
316 + <groupId>com</groupId>
317 + <version>1.0-SNAPSHOT</version>
318 + </parent>
319 +
320 + <!-- artifact identity -->
321 + <artifactId>frameworks</artifactId>
322 + <groupId>com.mywostuff</groupId>
323 + <packaging>pom</packaging>
324 +
325 + <!-- framework relevant properties -->
326 + <properties>
327 + <!-- NS related properties fills in Info.plist etc-->
328 + <CFBundleDevelopmentRegion>English</CFBundleDevelopmentRegion>
329 + <CFBundleGetInfoString></CFBundleGetInfoString>
330 + <CFBundlePackageType>FMWK</CFBundlePackageType>
331 + <CFBundleIconFile>WOAfile.icns</CFBundleIconFile>
332 + <CFBundleInfoDictionaryVersion>6.0</CFBundleInfoDictionaryVersion>
333 + <CFBundleVersion>5.3.1</CFBundleVersion>
334 + <Has_WOComponents>true</Has_WOComponents>
335 + <NSPrincipalClass>${mainclass}</NSPrincipalClass>
336 + <NSResourcesBundlePath></NSResourcesBundlePath>
337 + </properties>
338 +
339 + <!-- modules -->
340 + <modules>
341 + <module>CustomExtensions</module>
342 + <module>CustomBusinessLogic</module>
343 + </modules>
344 +
345 + <!-- specific dependencies (for modules) -->
346 + <dependencies>
347 + <dependency>
348 + <artifactId>ERExtensions</artifactId>
349 + <groupId>${wonder.common.groupId}</groupId>
350 + </dependency>
351 + <dependency>
352 + <artifactId>JavaWOExtensions</artifactId>
353 + <groupId>${wonder.common.groupId}</groupId>
354 + </dependency>
355 + <dependency>
356 + <artifactId>JavaFoundation</artifactId>
357 + <groupId>${webobjects.groupId}</groupId>
358 + </dependency>
359 + <dependency>
360 + <artifactId>JavaJDBCAdaptor</artifactId>
361 + <groupId>${webobjects.groupId}</groupId>
362 + </dependency>
363 + <dependency>
364 + <artifactId>JavaWebObjects</artifactId>
365 + <groupId>${webobjects.groupId}</groupId>
366 + </dependency>
367 + <dependency>
368 + <artifactId>JavaEOControl</artifactId>
369 + <groupId>${webobjects.groupId}</groupId>
370 + </dependency>
371 + <dependency>
372 + <artifactId>JavaEOAccess</artifactId>
373 + <groupId>${webobjects.groupId}</groupId>
374 + </dependency>
375 + <dependency>
376 + <artifactId>JavaWebObjects</artifactId>
377 + <groupId>${webobjects.groupId}</groupId>
378 + </dependency>
379 + <dependency>
380 + <artifactId>JavaXML</artifactId>
381 + <groupId>${webobjects.groupId}</groupId>
382 + </dependency>
383 + </dependencies>
384 +
385 +
386 + <!-- build config (for modules) -->
387 + <build>
388 + <sourceDirectory>src</sourceDirectory>
389 + <testSourceDirectory>tests</testSourceDirectory>
390 + <resources>
391 + <!-- relative dir for Info.plist -->
392 + <resource>
393 + <targetPath>Resources</targetPath>
394 + <filtering>true</filtering>
395 + <directory>../src/main/resources</directory>
396 + </resource>
397 + <resource>
398 + <targetPath>Resources</targetPath>
399 + <filtering>false</filtering>
400 + <directory>Components</directory>
401 + </resource>
402 + <resource>
403 + <targetPath>Resources</targetPath>
404 + <filtering>false</filtering>
405 + <directory>Resources</directory>
406 + </resource>
407 + <resource>
408 + <targetPath>WebServerResources</targetPath>
409 + <filtering>false</filtering>
410 + <directory>WebServerResources</directory>
411 + </resource>
412 + </resources>
413 + <plugins>
414 + <plugin>
415 + <groupId>org.apache.maven.plugins</groupId>
416 + <artifactId>maven-compiler-plugin</artifactId>
417 + <configuration>
418 + <source>${java.target}</source>
419 + <target>${java.target}</target>
420 + </configuration>
421 + </plugin>
422 + </plugins>
423 + </build>
424 +</project>
425 +
426 +{{/code}}
427 +
428 +Since our CustomExtensions has no further dependencies, its pom.xml merely specifies its parent and its identity.
429 +
430 +{{code title="/frameworks/CustomBusinessLogic/pom.xml"}}
431 +
432 +<?xml version="1.0"?>
433 +<project>
434 + <!-- parent artifact -->
435 + <parent>
436 + <artifactId>frameworks</artifactId>
437 + <groupId>com.mywostuff</groupId>
438 + <version>1.0-SNAPSHOT</version>
439 + </parent>
440 +
441 + <!-- artifact identity -->
442 + <artifactId>CustomBusinessLogic</artifactId>
443 + <groupId>com.mywostuff.frameworks</groupId>
444 +</project>
445 +
446 +{{/code}}
447 +
448 +CustomBusinessLogic has a further dependency on CustomExtensions, so it specifies its parent, its identity, and the dependency.
449 +
450 +{{code title="/frameworks/CustomBusinessLogic/pom.xml"}}
451 +
452 +<?xml version="1.0"?>
453 +<project>
454 + <!-- parent artifact -->
455 + <parent>
456 + <artifactId>frameworks</artifactId>
457 + <groupId>com.mywostuff</groupId>
458 + <version>1.0-SNAPSHOT</version>
459 + </parent>
460 +
461 + <!-- artifact identity -->
462 + <artifactId>CustomBusinessLogic</artifactId>
463 + <groupId>com.mywostuff.frameworks</groupId>
464 +
465 + <!-- specific dependencies -->
466 + <dependencies>
467 + <dependency>
468 + <artifactId>CustomExtensions</artifactId>
469 + <groupId>${pom.groupId}</groupId>
470 + </dependency>
471 + </dependencies>
472 +</project>
473 +
474 +{{/code}}
475 +
159 159  === Packaging Applications ===
160 160  
161 -details to come...
478 +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.
162 162  
163 -=== Project Inheritance ===
480 +{{code title="/apps/pom.xml"}}
164 164  
165 -details to come...
482 +<?xml version="1.0" encoding="UTF-8"?>
483 +<project xmlns="http://maven.apache.org/POM/4.0.0"
484 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
485 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
486 + http://maven.apache.org/xsd/maven-4.0.0.xsd">
166 166  
488 + <modelVersion>4.0.0</modelVersion>
489 +
490 + <!-- parent artifact -->
491 + <parent>
492 + <groupId>com</groupId>
493 + <artifactId>mywostuff</artifactId>
494 + <version>1.0-SNAPSHOT</version>
495 + </parent>
496 +
497 + <!-- artifact identity -->
498 + <artifactId>apps</artifactId>
499 + <groupId>com.mywostuff</groupId>
500 + <packaging>pom</packaging>
501 +
502 + <!-- modules -->
503 + <modules>
504 + <module>ApplicationA</module>
505 + <module>ApplicationB</module>
506 + </modules>
507 +
508 + <!-- specific dependencies (for modules) -->
509 + <dependencies>
510 + <!-- wonder frameworks -->
511 + <dependency>
512 + <artifactId>ERExtensions</artifactId>
513 + <groupId>${wonder.common.groupId}</groupId>
514 + </dependency>
515 + <dependency>
516 + <artifactId>JavaWOExtensions</artifactId>
517 + <groupId>${wonder.common.groupId}</groupId>
518 + </dependency>
519 +
520 + <!-- project libs -->
521 + <dependency>
522 + <artifactId>CustomExtensions</artifactId>
523 + <groupId>${my.frameworks.groupId}</groupId>
524 + </dependency>
525 + <dependency>
526 + <artifactId>CustomBusinessLogic</artifactId>
527 + <groupId>${my.frameworks.groupId}</groupId>
528 + </dependency>
529 +
530 + <!-- webobjects dependencies -->
531 + <dependency>
532 + <artifactId>JavaFoundation</artifactId>
533 + <groupId>${webobjects.groupId}</groupId>
534 + </dependency>
535 + <dependency>
536 + <artifactId>JavaJDBCAdaptor</artifactId>
537 + <groupId>${webobjects.groupId}</groupId>
538 + </dependency>
539 + <dependency>
540 + <artifactId>JavaWebObjects</artifactId>
541 + <groupId>${webobjects.groupId}</groupId>
542 + </dependency>
543 + <dependency>
544 + <artifactId>JavaEOControl</artifactId>
545 + <groupId>${webobjects.groupId}</groupId>
546 + </dependency>
547 + <dependency>
548 + <artifactId>JavaEOAccess</artifactId>
549 + <groupId>${webobjects.groupId}</groupId>
550 + </dependency>
551 + <dependency>
552 + <artifactId>JavaWebObjects</artifactId>
553 + <groupId>${webobjects.groupId}</groupId>
554 + </dependency>
555 + <dependency>
556 + <artifactId>JavaXML</artifactId>
557 + <groupId>${webobjects.groupId}</groupId>
558 + </dependency>
559 + </dependencies>
560 +
561 + <!-- build config (for modules) -->
562 + <build>
563 + <sourceDirectory>src</sourceDirectory>
564 + <testSourceDirectory>tests</testSourceDirectory>
565 + <resources>
566 + <resource>
567 + <targetPath>Resources</targetPath>
568 + <filtering>false</filtering>
569 + <directory>Components</directory>
570 + </resource>
571 + <resource>
572 + <targetPath>Resources</targetPath>
573 + <filtering>false</filtering>
574 + <directory>Resources</directory>
575 + </resource>
576 + <resource>
577 + <targetPath>WebServerResources</targetPath>
578 + <filtering>false</filtering>
579 + <directory>WebServerResources</directory>
580 + </resource>
581 + </resources>
582 + <plugins>
583 + <plugin>
584 + <artifactId>maven-wolifecycle-plugin</artifactId>
585 + <groupId>org.objectstyle.woproject.maven2</groupId>
586 + <version>2.0.15</version>
587 + <extensions>true</extensions>
588 + <configuration>
589 + <source>${java.target}</source>
590 + <target>${java.target}</target>
591 + </configuration>
592 + </plugin>
593 + <plugin>
594 + <groupId>org.apache.maven.plugins</groupId>
595 + <artifactId>maven-javadoc-plugin</artifactId>
596 + <configuration>
597 + <javadocVersion>${java.target}</javadocVersion>
598 + <locale>en-AU</locale>
599 + <minmemory>128m</minmemory>
600 + <maxmemory>512m</maxmemory>
601 + </configuration>
602 + </plugin>
603 + <!--
604 + TODO build numbering
605 + <plugin>
606 + <groupId>org.codehaus.mojo</groupId>
607 + <artifactId>maven-buildnumber-plugin</artifactId>
608 + <version>0.9.6</version>
609 + <executions>
610 + <execution>
611 + <phase>validate</phase>
612 + <goals>
613 + <goal>create</goal>
614 + </goals>
615 + </execution>
616 + </executions>
617 + <configuration>
618 + <doCheck>true</doCheck>
619 + <doUpdate>true</doUpdate>
620 + </configuration>
621 + </plugin>
622 + -->
623 + </plugins>
624 + <pluginManagement>
625 + <plugins>
626 + <plugin>
627 + <groupId>org.apache.maven.plugins</groupId>
628 + <artifactId>maven-compiler-plugin</artifactId>
629 + <configuration>
630 + <source>${java.target}</source>
631 + <target>${java.target}</target>
632 + </configuration>
633 + </plugin>
634 + </plugins>
635 + </pluginManagement>
636 + </build>
637 +</project>
638 +
639 +{{/code}}
640 +
641 +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.
642 +
643 +{{code title="/apps/ApplicationA/pom.xml"}}
644 +
645 +<?xml version="1.0"?>
646 +<project>
647 + <modelVersion>4.0.0</modelVersion>
648 +
649 + <!-- parent artifact -->
650 + <parent>
651 + <artifactId>apps</artifactId>
652 + <groupId>com.mywostuff</groupId>
653 + <version>1.0-SNAPSHOT</version>
654 + <relativePath>../apps</relativePath> <!-- e.g., (optional) if your app is under /trunk -->
655 + </parent>
656 +
657 + <!-- artifact identity -->
658 + <artifactId>ApplicationA</artifactId>
659 + <groupId>com.mywostuff.apps</groupId>
660 + <packaging>woapplication</packaging> <!-- woproject specific packaging -->
661 +
662 + <!-- specific properties -->
663 + <properties>
664 + <!-- general properties -->
665 + <mainclass>your.app.Application</mainclass>
666 + </properties>
667 +
668 + <!-- specific dependencies -->
669 + <dependencies>
670 + <!-- wonder frameworks -->
671 + <dependency>
672 + <artifactId>Ajax</artifactId>
673 + <groupId>${wonder.ajax.groupId}</groupId>
674 + </dependency>
675 + <dependency>
676 + <artifactId>ERCaptcha</artifactId>
677 + <groupId>${wonder.common.groupId}</groupId>
678 + <!-- requires jcaptcha-all below -->
679 + </dependency>
680 + <dependency>
681 + <artifactId>WOOgnl</artifactId>
682 + <groupId>${wonder.common.groupId}</groupId>
683 + </dependency>
684 +
685 + <!-- general libs -->
686 + <dependency>
687 + <artifactId>jcaptcha-all</artifactId>
688 + <groupId>com.octo.captcha</groupId>
689 + </dependency>
690 + <dependency>
691 + <artifactId>commons-collections</artifactId>
692 + <groupId>commons-collections</groupId>
693 + </dependency>
694 + <dependency>
695 + <groupId>ognl</groupId>
696 + <artifactId>ognl</artifactId>
697 + </dependency>
698 + </dependencies>
699 +</project>
700 +
701 +{{/code}}
702 +
703 +=== Packaging Applications as True WAR ===
704 +
705 +You can find steps to package WO Applications as True WAR [[here>>WOL:Packaging WO Applications as true WAR with Maven]].
706 +
167 167  === Eclipse Integration ===
168 168  
169 169  details to come...