Steps
in creating gwt project using spring roo 1.2.3
- Create TestProjectRoo1.2.3 from STS
- Roo commands
a.) jpa setup
--provider HIBERNATE --databaseName test--userName root --password
root --database MYSQL
b.) entity jpa --class ~.server.domain.TestEntity --testAutomatically
c.) field string description
b.) entity jpa --class ~.server.domain.TestEntity --testAutomatically
c.) field string description
d.) create all
entities of your project
e.)
gwt
project set up commands
- web gwt setup
- web gwt all --proxyPackage test.client.managed.proxy --requestPackage test.client.managed.request
- You will get build error- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:exec-maven-plugin:1.2:exec (execution: default, phase: process-classes)
To
solve this error add following code inside pom.xml below given code
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
put
this code below <outputDirectory>
<pluginManagement>
<plugins>
<!--This
plugin's configuration is used to store Eclipse m2e settings only. It
has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>
exec-maven-plugin
</artifactId>
<versionRange>[1.2,)</versionRange>
<goals>
<goal>exec</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
- You will get this error when runinng this projectThe RequestFactory ValidationTool must be run for the test.client.managed.request.ApplicationRequestFactory RequestFactory type
To
Solve this error
1.
pom.xml
<dependency>
<groupId>org.springframework.roo</groupId>
<artifactId>org.springframework.roo.annotations</artifactId>
<version>${roo.version}</version>
<scope>provided</scope>
delete this line
</dependency>
2.
Run Validation Tool(Save below file as validation.bat and run it after running project from STS)
:: made by TestProjectRoo1.2.3 TEAM ::@echo off cls :: Must change for project specific path(Project path) d: cd D:\D Drive Data\BME\workspace1\TestProjectRoo1.2.3 set TARGET=.\target :: Must change web-inf path specfic to project set BASE=%TARGET%\LogBook-0.1.0.BUILD-SNAPSHOT\WEB-INF ::---------------------------- :: don't have to edit below - unless you have more Application Request Factories set OUTPUT=%BASE%\classes ::set OUTPUT=%TARGET%\generated-sources\gwt IF NOT EXIST %TARGET% ( echo %TARGET% doesn't exists, Please check your directory structure. echo Validation file must run from project root directory. pause exit ) IF exist %OUTPUT% ( echo %OUTPUT% exists ) ELSE ( mkdir %OUTPUT% && echo %OUTPUT% created. ) set CP= set CP=%CP%%BASE%\classes; set CP=%CP%%BASE%\lib\*; :: '*' will only work with java 1.6+ :: these need to be in there ::CP="%CP%%BASE%/lib/requestfactory-apt.jar:"; ::CP="%CP%%BASE%/lib/requestfactory-server+src.jar:"; echo DEBUG ClassPath: %CP% :: these need to be in there set PATH=C:\Program Files\Java\jdk1.6.0_32\bin\ ::set CLASSPATH=.;C:\Users\tapant\.m2\repository\. :: Validation tool must run for requestfactory class for which exception was thrown java -cp %CP% com.google.web.bindery.requestfactory.apt.ValidationTool %OUTPUT% test.client.managed.request.ApplicationRequestFactory :: Do you need more Request Factories??? :: the end pause ::exit
- final Screen after above steps are perfect
6. Now create your own entry class and reuse the auto generated code. Thanks to Spring roo community for that.
Author : Milan D Ashara
No comments:
Post a Comment