Sagar, Velo pointed out a better location for the war example in a different thread: http://svn.sonatype.org/flexmojos/trunk/flexmojos-testing/flexmojos-test-harness/projects/issues/flexmojos-102/war/. I'm too busy living in the past... Velo's moving to fast for me. This one should always be up-to-date too in the event that someone points out any problems or provides a better use case.
As per that example (only valid for 3.3+ plugin), the wrapped files should really live in the war project and not the swf. The wrapper mojo should then be called from the war project instead (again imitating the provided example). Writing files below the project's base directory is dangerous. What if someone checks out just the swf project for experimental/testing purposes or copies it alone to create a branch going in a different direction? Build requests for this will be writing the wrapper files out who-knows-where because it will be completely out of context. The other purpose for doing it this way is if you would like to start injecting the swf artifact into multiple war projects in the future (dev, test, prod environments or different regional server environments, for example). Each war may want to wrap the swf in a completely different fashion. You lose the ability to do this if try to just throw it up directory tree into some static path. --David On Thu, Aug 27, 2009 at 10:17 PM, Sagar Jadhav < [email protected]> wrote: > Actually I have three modules (maven) client, server and common. Hence my > flex application is in client and spring-jpa application is in the server. > Hence after the client compiles I am creating the wrapper and hence in the > package phase of the "server" module I want to get the html package > (containing the html page, js and etc) to the webapp/ directory. Both the > client and the server modules are under the parent project. As of now I > created a workaround the following way.This is the extract from my client > - pom.xml > <build> > <sourceDirectory>src/main/flex</sourceDirectory> > <testSourceDirectory>src/test/flex</testSourceDirectory> > <plugins> > <plugin> > <groupId>org.sonatype.flexmojos</groupId> > <artifactId>flexmojos-maven-plugin</artifactId> > <version>3.3.0</version> > <extensions>true</extensions> > <dependencies> > <dependency> > <groupId>com.adobe.flex</groupId> > <artifactId>compiler</artifactId> > <version>3.3.0.4852</version> > <type>pom</type> > </dependency> > </dependencies> > <configuration> > <locales> > <param>en_US</param> > </locales> > <contextRoot>dellgpu-server</contextRoot> > </configuration> > <executions> > <execution> > <id>wrapper generation</id> > <goals> > <goal>wrapper</goal> > </goals> > <configuration> > > <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory> > <!-- > <outputDirectory>../dellgpu-server/src/main/webapp</outputDirectory> --> > > > <templateOutputDirectory>${project.build.directory}/templates</templateOutputDirectory> > <parameters> > <swf>dellgpu-client-${project.version}</swf> > <title>DellGPUPlanningOrder</title> > <width>100%</width> > <height>100%</height> > </parameters> > <htmlName>dellPlanningOrder</htmlName> > </configuration> > </execution> > </executions> > </plugin> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-dependency-plugin</artifactId> > <executions> > <execution> > <id>unpack-common</id> > <goals> > <goal>unpack-dependencies</goal> > </goals> > <phase>generate-resources</phase> > <configuration> > > <outputDirectory>${project.build.directory}/generated-resources</outputDirectory> > <includeArtifacIds>dellgpu-common</includeArtifacIds> > <includeGroupIds>${project.groupId}</includeGroupIds> > <excludeTransitive>true</excludeTransitive> > </configuration> > </execution> > </executions> > </plugin> > </plugins> > <resources> > <resource> > <directory>${basedir}/src/main/resources</directory> > </resource> > <resource> > <directory>${basedir}/target/generated-resources</directory> > <filtering>true</filtering> > </resource> > </resources> > </build> > This is the extract from my server - pom.xml > > *<plugin>* > * **<artifactId>maven-dependency-plugin</artifactId>* > * **<executions>* > * **<execution>* > * **<id>unpack-common</id>* > * **<goals>* > * **<goal>unpack-dependencies</goal>* > * **</goals>* > * **<phase>generate-resources</phase>* > * **<configuration>* > * ** > <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/flex</outputDirectory> > * > * **<includeArtifacIds>dellgpu-common</includeArtifacIds>* > * **<includeGroupIds>${project.groupId}</includeGroupIds>* > * **<includeClassifiers>resources</includeClassifiers>* > * **<excludeTransitive>true</excludeTransitive>* > * **<excludeTypes>jar,swf</excludeTypes>* > * **</configuration>* > * **</execution>* > * **<execution>* > * **<id>copy-swf</id>* > * **<phase>process-classes</phase>* > * **<goals>* > * **<goal>copy-dependencies</goal>* > * **</goals>* > * **<configuration>* > * ** > <outputDirectory>${project.build.directory}/${project.build.finalName}/dellgpuClient</outputDirectory> > * > * ** <includeTypes>swf</includeTypes>* > * **</configuration>* > * **</execution>* > * **</executions>* > * **</plugin>* > * **<plugin>* > * ** <artifactId>maven-resources-plugin</artifactId>* > * ** <version>2.4</version>* > * ** <executions>* > * ** <execution>* > * ** <id>copy-resources</id>* > * ** <!-- here the phase you need -->* > * ** <phase>validate</phase>* > * ** <goals>* > * ** <goal>copy-resources</goal>* > * ** </goals>* > * ** <configuration>* > * ** > > <outputDirectory>${project.build.directory}/${project.build.finalName}/dellgpuClient</outputDirectory> > * > * ** <resources> * > * ** <resource>* > * ** > > <directory>../dellgpu-client/target/dellgpu-client-${project.version}</directory> > * > * ** <filtering>true</filtering>* > * ** </resource>* > * ** </resources> * > * ** </configuration> * > * ** </execution>* > * ** </executions>* > * ** </plugin>* > * **<plugin>* > * **<groupId>org.sonatype.flexmojos</groupId>* > * ** <artifactId>flexmojos-maven-plugin</artifactId>* > * **<version>3.3.0</version>* > * ** <extensions>true</extensions>* > * **<configuration>* > * **<locales>* > * **<param>en_US</param>* > * **</locales>* > * **</configuration>* > * **</plugin>* > * **</plugins>* > * **<resources>* > * **<resource>* > * **<directory>src/main/resources</directory>* > * **</resource>* > * **<resource>* > * **<directory>src/main/java</directory>* > * **<excludes>* > * **<exclude>**/*.java</exclude>* > * **</excludes>* > * **<includes>* > * **<include>**/*.xml</include>* > * **</includes>* > * **</resource>* > * **</resources>* > * **</build>* > On Aug 27, 2009, at 7:05 PM, David Rom wrote: > > Sagar, > > I'm a bit confused about exactly what you're trying to do here (a copy of > your pom(s) would be helpful to clarify), but I'll give it a shot anyways... > > It sounds like you're trying to build a swf project and deploy it to a > separate war project during the packaging phase of the swf build since > otherwise outputDirectory should be ignored in 3.3. If true, that's not > such a safe tactic considering the way that maven/flexmojos is trying to > work. You can inject the swf from its artifact (i.e. result of running mvn > install on the swf project) and wrap everything necessary from within the > war project itself (see: > http://sites.sonatype.org/flexmojos/flexmojos-maven-plugin/wrapper-mojo.html#wrapperArtifact). > There shouldn't be any reason to copy any html, javascript, or whatever from > the swf project to the war project anymore. Anything that needs to have > parameters injected should just live in the war project. > > If any of my assumptions above are not true, correct me and we'll try > something else. > > Also, see > https://issues.sonatype.org/secure/attachment/12163/war-wrapper-test-newconfig.zipfor > an example project of how the war injection should work. > > Come to think of it, I should really add the examples to the wiki as jira > isn't really acceptable for general consumption. Unless some industrious > individual beats me to it, I'll aim to have something up over the weekend. > > --David > > On Thu, Aug 27, 2009 at 1:26 PM, Sagar Jadhav < > [email protected]> wrote: > >> >> I am using the wrapper goal of the maven flexmojo plugin and I have >> set the path of the output director to : <outputDirectory>../dellgpu- >> server/src/main/webapp</outputDirectory> >> so that it generates the directory and the rest of the resources such >> as the .js, .html, the history folder in that directory. >> But when I specifically mention the output directory outside its build >> directory it does not generate the directory but generates the >> resources directly under my webapp. >> But I want it as webapp/<clientfolder>/.... >> >> Please help. >> >> regards >> Sagar >> >> >> > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex Mojos" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex-mojos?hl=en?hl=en http://blog.flex-mojos.info/ -~----------~----~----~----~------~----~------~--~---
