Create and Run ZK Application with Maven Artifacts"

From Documentation
Line 19: Line 19:
  
 
== Enable Dependency and Web Project configuration ==
 
== Enable Dependency and Web Project configuration ==
 
+
[[File:MavenProject.png|frame|ZK Maven Project Hierarchy]]
 
=== web.xml ===
 
=== web.xml ===
 
*Overwrite the content of '''/src/main/webapp/WEB-INF/web.xml''' with [[ZK Installation Guide/ZK Background/Sample of web.xml | Sample of web.xml]].
 
*Overwrite the content of '''/src/main/webapp/WEB-INF/web.xml''' with [[ZK Installation Guide/ZK Background/Sample of web.xml | Sample of web.xml]].

Revision as of 07:00, 7 July 2011


DocumentationZK Installation GuideSetting up IDEMavenUse ZK Maven ArtifactsCreate and Run ZK Application with Maven Artifacts
Create and Run ZK Application with Maven Artifacts



How to create ZK Maven web project

Create Project of Maven

  • [File] -> [New] -> [Other] --> [Maven Project]
    ZK Installation Guide Maven step1.png
  • Check Create a simple Project
    ZK Installation Guide Maven step2.png
  • Fill the first 4 field (you can change them later) --> Click [Finish]
    ZK Installation Guide Maven step3.png

Add WTP Support (Project Facet)

  1. Create new folder under /src/main/ named webapp
  2. Right Click on your Maven Project -> Choose Properties -> Choose Project Facets -> Check Dynamic Web Module
  • Note: if it showing Covert facet from..., simply click it to enable facet.
    ZK Installation Guide Maven web1.png
  1. Click Further configuration available' --> input the Context Root and Content Directory --> Check Generate web.xml deployment descriptor
  • ZK Installation Guide Maven web2.png

Enable Dependency and Web Project configuration

ZK Maven Project Hierarchy

web.xml

pom.xml

How to run Maven project on Run-Jetty-Run

  1. Create new zul file index.zul [1] under /src/main/webapp
  2. Goto Run Configurations
    ZK Installation Guide maven run1.png
  3. Double click on Jetty Webapp
    • It will auto fill Project / Port / Context / WebApp Dir
    ZK Installation Guide maven run2.png
  4. Click Run and browse http://127.0.0.1:8080/TestMavenWebProject/