Changes for page Maven Kicking the tyres without changing your project structure
Last modified by Henrique Prange on 2015/09/11 17:57
From version 15.1
edited by Lachlan Deck
on 2008/06/15 04:51
on 2008/06/15 04:51
Change comment:
Fleshing it out some more. Still a work in progress.
To version 18.1
edited by Henrique Prange
on 2008/06/15 19:35
on 2008/06/15 19:35
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. ldeck1 +XWiki.hprange - Content
-
... ... @@ -1,50 +1,117 @@ 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 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. 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. 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 9 -The mailing list is also veryhelpfulforgettinghelp. See [Getting Help|http://maven.apache.org/users/getting-help.html].9 +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|http://maven.apache.org/users/getting-help.html]. 10 10 11 11 {{/info}} 12 12 13 -=== Defining the Car - what's the aim ===13 +=== What's the aim === 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, and of course they each may have something distinctive about them. 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. 16 16 17 - So thecar, i.e., thelayout of the frameworks and applications,might look like this:17 +The layout of the frameworks and applications might look like this: 18 18 19 19 {{noformat}} 20 20 21 -/ 22 -/apps/ 23 -/apps/ApplicationA/ 24 -/apps/ApplicationB/ 25 -/frameworks/ 26 -/frameworks/CustomExtensions/ 27 -/frameworks/CustomBusinessLogic/ 28 -/frameworks/etc/ 21 +/trunk/ 22 +/trunk/apps/ 23 +/trunk/apps/ApplicationA/ 24 +/trunk/apps/ApplicationB/ 25 +/trunk/frameworks/ 26 +/trunk/frameworks/CustomExtensions/ 27 +/trunk/frameworks/CustomBusinessLogic/ 28 +/trunk/frameworks/etc/ 29 29 30 30 {{/noformat}} 31 31 32 -Our aim is t o put as much configuration that's shared between all frameworks,for example, into /frameworks/pom.xml as possible so we only have todefine it once. The configuration is inherited by a child pom.32 +Our aim is twofold: 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. 35 +1. Be able to issue a single command that will package each and every framework and application. 36 + 34 34 === Key Concepts === 35 35 36 -Typical things that make up a pom... 39 +Typical things that make up a pom are as follows. (Note: only pom identification is mandatory. All the others have defaults.) 37 37 38 -1. pom parent identification (who do I belong to?) 39 39 1. pom identification (who am I?) 42 +The base triplet used to identify an artifact (i.e., product) 43 + 44 +{{noformat}} 45 + 46 + <artifactId>CustomExtensions</artifactId> 47 + <groupId>com.mywostuff.frameworks</groupId> 48 + <version>0.0.1-SNAPSHOT</version> 49 + 50 + 51 +{{/noformat}} 52 + 53 +1. pom packaging (i.e., what are we building?) 54 +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) 55 + 56 +{{noformat}} 57 + 58 + <packaging>woapplication</artifactId> 59 + 60 + 61 +{{/noformat}} 62 + 63 +1. pom parent identification (who do I belong to?) 64 + 65 +{{noformat}} 66 + 67 + <parent> 68 + <artifactId>frameworks</artifactId> 69 + <groupId>com.mywostuff</groupId> 70 + </parent> 71 + 72 + 73 +{{/noformat}} 74 + 40 40 1. modules (a.k.a kids; who belongs to me?) 76 + 77 +{{noformat}} 78 + 79 + <modules> 80 + <module>CustomExtensions</module> 81 + <module>CustomBusinessLogic</module> 82 + </modules> 83 + 84 + 85 +{{/noformat}} 86 + 41 41 1. dependencies (what do I need?) 88 + 89 +{{noformat}} 90 + 91 + <dependencies> 92 + <dependency> 93 + <groupId>log4j</groupId> 94 + <artifactId>log4j</artifactId> 95 + <version>1.2.12</version> 96 + <scope>compile</scope> 97 + </dependency> 98 + <dependency> 99 + <groupId>junit</groupId> 100 + <artifactId>junit</artifactId> 101 + <version>4.4</version> 102 + <scope>test</scope> 103 + </dependency> 104 + </dependencies> 105 + 106 + 107 +{{/noformat}} 108 + 42 42 1. build sources/resources (what do I have?) 43 43 1. properties and filtering resources (variable definitions) 44 44 1. dependency/plugin management (shared configuration and versioning) 45 45 1. repositories (where to find dependencies and plugins) 46 46 47 -Of course, with the plethora of plugins available for maven, this is only the tip of the iceberg butthese main concepts will suffice for now.114 +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. 48 48 49 49 === Alternate File System Layout Concepts === 50 50 ... ... @@ -118,6 +118,12 @@ 118 118 119 119 details to come... 120 120 188 +=== Packaging Applications as True WAR === 189 + 190 +You can find steps to package WO Applications as True WAR [[here>>Packaging WO Applications as true WAR with Maven]]. 191 + 192 +more details to come... 193 + 121 121 === Project Inheritance === 122 122 123 123 details to come...