Changes for page Packaging WO Applications as true WAR with Maven
Last modified by Ulrich Köster on 2009/08/02 20:26
From version 10.1
edited by Henrique Prange
on 2008/05/15 19:29
on 2008/05/15 19:29
Change comment:
There is no comment for this version
To version 8.1
edited by Henrique Prange
on 2009/08/02 20:26
on 2009/08/02 20:26
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -32,7 +32,26 @@ 32 32 {{noformat}} 33 33 34 34 <build> 35 + ... 36 + <resources> 35 35 ... 38 + <resource> 39 + <targetPath>Resources</targetPath> 40 + <directory>${basedir}/src/main/resources</directory> 41 + </resource> 42 + <resource> 43 + <targetPath>Resources</targetPath> 44 + <directory>${basedir}/src/main/components</directory> 45 + </resource 46 + <resource> 47 + <targetPath>WebServerResources</targetPath> 48 + <directory>${basedir}/src/main/webserver-resources</directory> 49 + </resource> 50 + ... 51 + </resources> 52 + ... 53 + <plugins> 54 + ... 36 36 <plugin> 37 37 <artifactId>maven-war-plugin</artifactId> 38 38 <configuration> ... ... @@ -40,6 +40,8 @@ 40 40 </configuration> 41 41 </plugin> 42 42 ... 62 + </plugins> 63 + ... 43 43 </build> 44 44 45 45 {{/noformat}} ... ... @@ -51,7 +51,7 @@ 51 51 {{noformat}} 52 52 53 53 <dependency> 54 - <groupId>com. apple.webobjects</groupId>75 + <groupId>com.webobjects</groupId> 55 55 <artifactId>JavaWOJSPServlet</artifactId> 56 56 <version>${woversion}</version> 57 57 </dependency> ... ... @@ -63,7 +63,7 @@ 63 63 {{noformat}} 64 64 65 65 <dependency> 66 - <groupId>com. apple.webobjects</groupId>87 + <groupId>com.webobjects</groupId> 67 67 <artifactId>JavaWOJSPServlet_client</artifactId> 68 68 <version>${woversion}</version> 69 69 </dependency> ... ... @@ -70,11 +70,23 @@ 70 70 71 71 {{/noformat}} 72 72 73 -**NOTE**: if your application uses Wonder,pleaseread[[thistutorial>>http://wiki.objectstyle.org/confluence/display/WONDER/Creating+a+wonder+app+to+deploy+as+a+servlet]].94 +**NOTE**: If your application uses Wonder you must add the ERXServlet dependency: 74 74 96 +{{noformat}} 97 + 98 +<dependency> 99 + <groupId>wonder.core</groupId> 100 + <artifactId>ERServlet</artifactId> 101 + <version>1.0</version> 102 +</dependency> 103 + 104 +{{/noformat}} 105 + 106 +Read this [[tutorial>>http://wiki.objectstyle.org/confluence/display/WONDER/Creating+a+wonder+app+to+deploy+as+a+servlet]] to find how to configure the ERXServletAdaptor in your application. 107 + 75 75 == Step 5: Change the packaging type == 76 76 77 -The default maven-war-plugin can handle the war packaging correctly. You have to change the packaging of your POM to 'war' in order to use this plug-in: 110 +The default [[maven-war-plugin>>http://maven.apache.org/plugins/maven-war-plugin/]] can handle the war packaging correctly. You have to change the packaging of your POM to 'war' in order to use this plug-in: 78 78 79 79 {{noformat}} 80 80 ... ... @@ -84,9 +84,55 @@ 84 84 85 85 It's done. 86 86 120 +== Step 6: Filtering variables with Maven (OPTIONAL) == 121 + 122 +Maven supports variable substitution during build time. It is called resource filtering. You can find more information about resource filtering [[here>>http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html]] and [[here>>http://www.sonatype.com/books/maven-book/reference/resource-filtering-sect-description.html]]. 123 + 124 +If you are using variables in your resource files (i.e. the Info.plist), you have to configure Maven to filter the Resources folder like this: 125 + 126 +{{noformat}} 127 + 128 +<build> 129 + ... 130 + <resources> 131 + ... 132 + <resource> 133 + <targetPath>Resources</targetPath> 134 + <directory>${basedir}/src/main/resources</directory> 135 + <filtering>true</filtering> 136 + </resource> 137 + ... 138 + </resources> 139 + ... 140 +</build> 141 + 142 +{{/noformat}} 143 + 144 +If you are using variables in the web.xml file, you have to configure Maven to filter deployment descriptors like this: 145 + 146 +{{noformat}} 147 + 148 +<build> 149 + ... 150 + <plugins> 151 + ... 152 + <plugin> 153 + <artifactId>maven-war-plugin</artifactId> 154 + <configuration> 155 + ... 156 + <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors> 157 + </configuration> 158 + </plugin> 159 + ... 160 + </plugins> 161 + ... 162 +</build> 163 + 164 +{{/noformat}} 165 + 87 87 = Running your application as true WAR = 88 88 89 -You can use the maven-jetty-plugin to run and test your application. 168 +You can use the [[maven-jetty-plugin>>http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin]] to run and test your application. 90 90 91 91 == Step 1: Configure the maven-jetty-plugin == 92 92