Last modified by Ulrich Köster on 2009/08/02 20:26

From version 18.1
edited by Greg.Brown
on 2009/08/02 13:30
Change comment: bug alert panel
To version 9.1
edited by Henrique Prange
on 2009/08/02 20:26
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.gbrown
1 +XWiki.hprange
Content
... ... @@ -32,7 +32,24 @@
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 + ...
36 36   <plugins>
37 37   ...
38 38   <plugin>
... ... @@ -74,8 +74,20 @@
74 74  
75 75  {{/noformat}}
76 76  
77 -**NOTE**: if your application uses Wonder, please read [[this tutorial>>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:
78 78  
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 +
79 79  == Step 5: Change the packaging type ==
80 80  
81 81  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:
... ... @@ -88,38 +88,52 @@
88 88  
89 89  It's done.
90 90  
91 -{{panel title="2009 Bug Warning" borderStyle="dashed" borderColor="#ccc" titleBGColor="#F7D6C1" bgColor="#FFFFCE"}}
92 -
93 -It should be done, but...
94 -The 2.0.17 archetype does not add :
95 -{noformat}
96 - <resource>
97 - <targetPath>Resources</targetPath>
98 - <directory>${basedir}/src/main/components</directory>
99 - </resource>
100 -{noformat}
101 -to the pom.xml file, so your war will have no components; you should add these lines.
120 +== Step 6: Filtering variables with Maven (OPTIONAL) ==
102 102  
103 -Also, it does not add a necessary WebObjects 5.3 dependency:
104 -{noformat}
105 - <dependency>
106 - <groupId>${webobjects.groupId}</groupId>
107 - <artifactId>JavaWOJSPServlet_client
108 - </artifactId>
109 - <version>${webobjects.version}</version>
110 - </dependency>
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]].
111 111  
112 -{noformat}
113 -So, you may need to add that.
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:
114 114  
115 -In addition, the archetype generated Info.plist needs fixing, as does the web.xml in the WEB-INF folder. There are values in these files like $\{project.artifactId\}, but for now, you must manually replace those values with actual values, e.g, MyProject.
126 +{{noformat}}
116 116  
117 -These probably will be fixed in the next release of plugins, but for now, watch this space, as there may be additional
118 -bugs posted here.
119 -
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>
120 120  
121 -{{/panel}}
142 +{{/noformat}}
122 122  
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 +
123 123  = Running your application as true WAR =
124 124  
125 125  You can use the [[maven-jetty-plugin>>http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin]] to run and test your application.