- Build from the code
- Install the archetype in your repository
mvn clean install - Create a project using blazeds-spring archetype from the local archetype repository
mvn archetype:generate -DartifactId=<your artifactId> -DarchetypeCatalog=local
- OR Create a project from the remote repository
mvn archetype:generate -DartifactId=<your artifactId> -DarchetypeCatalog=http://maven-blazeds-spring-archetype.googlecode.com/svn/maven2/ - Initial setup
mvn clean install-DtemplateURI=folder:html-template The reason we must have -DtemplateURI when doing mvn install at master-pom level is the default templateURI is folder:../html-template which is relative to the app-flex folder, while at master-pom level, the default value is no longer valid
- Import project into Eclipse
- Your Eclipse must have m2eclipse plugin and WTP
- Using File->Import->Existing project into workspace
- After importing, some of the errors may occur:
- JRE version. Please change it accordingly in project properties
- m2eclipse is not updating the dependencies, right click on the project, and choose Maven2->Update Dependencies
- Create Tomcat container to host the application
- You must have Apache Tomcat installed in your local machine
- Create a new server and add your web project to tomcat. So in Server View, it would be similar to this
- If successful, you must see the whole web application folder in the Apache Tomcat deployment folder (red rectangle), relative to your workspace folder
- Debug application
- You can debug Java code by running tomcat under Debug mode
- Or you can debug Flex Application by running Flex Application in Debug mode
|
Good job, But the archetype needs more work. For starters I could get it working only when version is set to "1.0" and the artifactID is set to "app". Any other values for these 2 fields results in a non working application, which I suspect is due to hard-coding "1.0" and "app" in certain places.
Ok, but how can I try the web application? If I open a browser and type http://localhost:8080/flexTest-web (in my case), it opens the page index.jsp and says "Hello world" but no flex code is run. Thanks
The spring module "spring-flex" is released. Is there a plan to make use of this new module in maven-blazeds-spring-archetype? Maybe we can create another archetype ?
http://www.springsource.org/node/1998
Great work. It work great for me. I had to edit app-web/pom.xml and app-flex/pom.xml to minor tweak (these are really non-issues)
I also change the versions of flex-sdk and flexmojos to the latest one.
Thanks for your great work.
I got the same problem as martin.a.villafane encountered. By looking a round I found that your archetype is still using maven plugin info.flex-mojos which does not execute the html-wrapper as expected (or I could not figure it out myself). And it seems that the maven plugin info.flex.mojos is now renamed to org.sonatype.flexmojos. Here are what I tweaked to make thing work (almost works)
Here is my change in app-web/pom.xml
<build> <finalName>yomogi</finalName> <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack-config</id> <goals> <goal>unpack-dependencies</goal> </goals> <phase>generate-resources</phase> <configuration> <outputDirectory> ${project.build.directory}/${project.build.finalName}/WEB-INF/flex </outputDirectory> <includeArtifacIds> yomogi-flex-config </includeArtifacIds> <includeGroupIds> ${project.groupId} </includeGroupIds> <includeClassifiers> resources </includeClassifiers> <excludeTransitive>true</excludeTransitive> <excludeTypes>jar,swf</excludeTypes> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>${flexmojos.version}</version> <executions> <execution> <goals> <goal>wrapper</goal> <goal>copy-flex-resources</goal> </goals> </execution> </executions> <configuration> <wrapperArtifact> <groupId>${project.groupId}</groupId> <artifactId>yomogi-flex</artifactId> <!-- Optional, as a swf dependency with the same id will be searched for if not defined. --> <version>1.0-SNAPSHOT</version> </wrapperArtifact> <templateInclusions> <String>**/*.jsp</String> <String>**/*.html</String> <String>WEB-INF/**/*</String> <String>history/**</String> <String>playerProductInstall.swf</String> </templateInclusions> <templateExclusions> <String>**/*.txt</String> <String>**/*.bak</String> </templateExclusions> </configuration> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>${maven.jetty.plugin.version}</version> <configuration> <webAppSourceDirectory> ${project.build.directory}/${project.build.finalName} </webAppSourceDirectory> </configuration> </plugin> </plugins> </build>and here is my change in web-flex/pom.xml
<plugins> <plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>${flexmojos.version}</version> <extensions>true</extensions> <configuration> <contextRoot>yomogi</contextRoot> <targetPlayer>10.0.0</targetPlayer> <locales> <locale>en_US</locale> </locales> </configuration> <dependencies> <dependency> <groupId>com.adobe.flex</groupId> <artifactId>compiler</artifactId> <version>${flex.sdk.version}</version> <type>pom</type> </dependency> </dependencies> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack-config</id> <goals> <goal>unpack-dependencies</goal> </goals> <phase>generate-resources</phase> <configuration> <outputDirectory>${project.build.directory}/generated-resources</outputDirectory> <includeArtifactIds>yomogi-flex-config</includeArtifactIds> <includeGroupIds>${project.groupId}</includeGroupIds> <excludeTransitive>true</excludeTransitive> </configuration> </execution> </executions> </plugin> </plugins>After an update on flex-mojos version (2.0M8 no more available), it works perfectly. Thank you !