Maven Build Problem

2 views
Skip to first unread message

James Ward

unread,
Aug 5, 2010, 7:07:16 PM8/5/10
to Jangaroo Users
I've just found that if I don't set: <outputDirectory>target/joo</
outputDirectory>
Or if I set outputDirectory to something else then my classes don't
get copied to the right place in the war file. They only are copied
to the WEB-INF/classes folder.

Bug?

Thanks.

Joo

unread,
Aug 6, 2010, 3:25:12 AM8/6/10
to Jangaroo Users
Not really (in other words: yes ;-):
http://geekandpoke.typepad.com/.a/6a00d8341d3df553ef013485fd51ab970c-pi)
Maven heavily relies of defaults. If you change the default for the
output directory, the war-package goal and the compile goal have to be
configured consistently, like so:

<execution>
<goals>
<goal>war-package</goal>
</goals>
<configuration>
<packageSourceDirectory>${project.build.directory}/
classes</packageSourceDirectory>
</configuration>
</execution>

Documentation for "packageSourceDirectory" configuration of "war-
package" goal:
"Location of Jangaroo resources of this module (including compiler
output, usually under "scripts/") to be added to the webapp. Defaults
to ${project.build.directory}/joo/"
[${project.build.directory} is a variable for the "target" directory]

Please let me know if this works for you!

Joo

unread,
Aug 6, 2010, 3:31:24 AM8/6/10
to Jangaroo Users
P.S.: The "compile" goal only by default uses a subdirectory of
Maven's global <outputDirectory> (${project.build.outputDirectory}/
scripts/classes). To configure the goals consistently, you should
rather reconfigure the "compile" goal than change the global
<outputDirectory>, like so:

<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/myjoo/
scripts/classes</outputDirectory>
<outputFileName>${project.build.directory}/myjoo/scripts/
module.js</outputFileName>
</configuration>
</execution>
<execution>
<goals>
<goal>war-package</goal>
</goals>
<configuration>
<packageSourceDirectory>${project.build.directory}/
myjoo</packageSourceDirectory>
</configuration>
</execution>
</executions>

But again, Maven recommends to use the defaults if you don't have any
special reasons to change them.
Reply all
Reply to author
Forward
0 new messages