Introduction maven3 and gwt2.5 rc2 - Lesson 01


Published on

First Part of GWT Course

1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Introduction maven3 and gwt2.5 rc2 - Lesson 01

  1. 1. Introduction to Apache Maven 3 and GWT 2.5-rc2Juan Manuel Rojas R. Lima, Perú 12/10/2012
  2. 2. MavenIs a build automation tool typically used forJava projects.Maven dynamically downloads Java librariesand Maven plug-ins from one or morerepositories such as the Maven 2 CentralRepository search.maven.orgMaven use an XML file to describe thesoftware project being built, dependencies,plugins, etc.Pluginsmvn [plugin-name]:[goal-name]
  3. 3. POM.xml(Project Object Model)
  4. 4. Installing the JDKWindowsDownload the JDK installer for Windows from the installerAdd the bin directory of the installed JDK to the PATH environment variable, asdescribed here: verify the JDK installation, open the Command Prompt and typejava -version.
  5. 5. Install Apache Maven 31. Download Unzip3. Add bin directory to system path4. In command line write mvn --version
  6. 6. The Maven Integration for Eclipse(m2eclipse, Eclipse m2e)Update Site eclipseHelp - Install New SoftwareAddName : m2eLocation: all and Next
  7. 7. Using the Archetypemvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.5.0-rc2
  8. 8. New Project
  9. 9. Run dev mode
  10. 10. Import in EclipseIf Eclipse ask to installa connector -> installthen restart eclipse
  11. 11. Add this lines<extraJvmArgs>-XX:MaxPermSize=512m -Xmx1024m</extraJvmArgs><generateDirectory>${}</generateDirectory>
  12. 12. <compilerArgument>-proc:none</compilerArgument>required by JPA
  13. 13. Setting the localeAdd to GWT module<extend-property name="locale" values="es_PE"/>(after entry point)In HTML file Header (src/main/webapp/FirstProject.html)<meta name="gwt:property" content="locale=es_PE"> to
  14. 14. GWT taskmvn gwt:i18nGenerate interfaz and Messages_es_PE.propertiesmvn gwt:runRun Dev Mode. Firefox is recommended andinstall the GWT Developer Plugin (dont updateyour browser) GWT DevMode Plugin for Firefox 16Optional parametermvn gwt:run -Dgwt.codeServerPort=9997
  15. 15. GWT task (Continuation)mvn packageBuild the war file of the application in targetdirectory.
  16. 16. GWT dev mode
  17. 17. Super dev modeNew in GWT 2.5. works in any browser, pluginsis not required.Add to gwt module<add-linker name="xsiframe"/><set-configuration-property name="devModeRedirectEnabled" value="true"/>remove or comment the last line in production
  18. 18. Super dev mode (Continuation)Compile the application for first timemvn packageStart the code servermvn gwt:run-codeserverormvn gwt:run-codeserver -Dgwt.codeServerPort=9876The code server is ready.Next, visit: http://localhost:9876/
  19. 19. Super dev mode (Continuation)Add to bookmarks (Drag and Drop)I am using Chrome
  20. 20. Super dev mode (Continuation)Start the web server (without stop the servercode)mvn gwt:runWe use jetty. e.g. Chromehttp:// mode)
  21. 21. Super dev mode (Continuation)Dev Mode On clickDev Mode Off to clear cache
  22. 22. Super dev mode (Continuation)Play with some changes to client code and testwith Dev Mode On. Update the browser is nolonger required
  23. 23. Super dev mode (Continuation)Chrome Developer tools you can see the codegenerated
  24. 24. Super dev mode (Continuation)For see java codeEnable source maps in settings
  25. 25. Super dev mode (Continuation)Recompile super dev mode with source mapsenabled.Click Dev Mode On
  26. 26. Super dev mode (Continuation)
  27. 27. References