Create and Run ZK Application with Maven Artifacts"
From Documentation
Line 17: | Line 17: | ||
#Create new folder under '''/src/main/''' named webapp | #Create new folder under '''/src/main/''' named webapp | ||
#Right Click on your Maven Project -> Choose '''Properties''' -> Choose '''Project Facets''' -> Check '''Dynamic Web Module''' | #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. | |
− | + | #:[[File:ZK_Installation_Guide_Maven_web1.png]] | |
#Click '''Further configuration available'''' --> input the ''Context Root'' and ''Content Directory'' --> Check '''Generate web.xml deployment descriptor''' | #Click '''Further configuration available'''' --> input the ''Context Root'' and ''Content Directory'' --> Check '''Generate web.xml deployment descriptor''' | ||
− | + | #:[[File:ZK_Installation_Guide_Maven_web2.png]] | |
== Enable Dependency and Web Project configuration == | == Enable Dependency and Web Project configuration == |
Revision as of 09:00, 22 August 2011
How to create ZK Maven web project
Create Project of Maven
- [File] -> [New] -> [Other] --> [Maven Project]
- Check Create a simple Project
- Fill the first 4 field (you can change them later) --> Click [Finish]
Add WTP Support (Project Facet)
- Create new folder under /src/main/ named webapp
- Right Click on your Maven Project -> Choose Properties -> Choose Project Facets -> Check Dynamic Web Module
- Click Further configuration available' --> input the Context Root and Content Directory --> Check Generate web.xml deployment descriptor
Enable Dependency and Web Project configuration
web.xml
- Overwrite the content of /src/main/webapp/WEB-INF/web.xml with Sample of web.xml.
pom.xml
- Overwrite the content of pom.xml with Sample of pom.xml
How to run Maven project on Run-Jetty-Run (Optional)
Notice that Run-Jetty-Run is optional. The speed of deployment is much faster, but the server is Jetty embedded in Run-Jetty-Run. If you prefer to use your own server, you could skip this step.
- Create new zul file index.zul [1] under /src/main/webapp
- Goto Run Configurations
- Double click on Jetty Webapp
- It will auto fill Project / Port / Context / WebApp Dir
- Click Run and browse http://127.0.0.1:8080/TestMavenWebProject/