Create and Run Your First ZK Application with Eclipse and Maven"

From Documentation
 
(68 intermediate revisions by 8 users not shown)
Line 1: Line 1:
=How to create ZK Maven web project=
+
{{ZKInstallationGuidePageHeader}}
== Create Project of Maven==
+
__TOC__
 +
 
 +
[https://www.eclipse.org/m2e/ M2eclipse] is the first and most mature of the projects aimed at integrating [https://maven.apache.org/ Apache Maven] within the Eclipse IDE.
 +
 
 +
=Prepare Eclipse =
 +
==Install Eclipse==
 +
Please follow the installation guide for your Eclipse:
 +
:[[ZK_Installation_Guide/Quick_Start/Create_and_Run_Your_First_ZK_Application_with_Eclipse_and_ZK_Studio#Install_Eclipse | Install Eclipse]]
 +
==Install M2eclipse==
 +
Please follow the installation guide for your M2eclipse:
 +
:[[ZK_Installation_Guide/Setting_up_IDE/Maven/Setting_up_Maven_on_Eclipse | Install M2eclipse]]
 +
==Add ZK Maven Archetype==
 +
*'''[Window]''' -> '''[Preferences]''' -> '''[Maven]''' --> '''[Archetypes]''', click ''Add Remote Catalog'' and type in the catalog file as illustrated:
 +
*:[[File:ZK_Installation_Guide_Quick_Start_Create_and_Run_with Eclipse_and_Maven.png]]
 +
https://mavensync.zkoss.org/maven2/
 +
*Click '''Verify''' and then '''OK''' to add the catalog.
 +
**If the Remote catalog is <font color="red">empty</font>.<ref>
 +
If an error message appears stating that the Remote catalog is empty, this is most likely due to a bug in the m2eclipse plugin in v0.12.x, [http://issues.sonatype.org/browse/MNGECLIPSE-2757 MNGECLIPSE-2757].
 +
Until m2eclipse 0.13.x or newer versions are released and available, there are two possible workarounds:
 +
#Install the "''older version''" 0.10.x from the [http://m2eclipse.sonatype.org/installing-m2eclipse.html Installing m2eclipse] website. Users will first need to uninstall m2eclipse 0.12.x, restart, and then install 0.10.x available from the following site:
 +
#: http://m2eclipse.sonatype.org/sites/m2e/0.10.2.20100623-1649/
 +
#Install the “newer version” from the following site: http://download.eclipse.org/technology/m2e/releases You first will need to uninstall m2eclipse 0.12.x, restart Eclipse before you can install the “newer” version from the website above. (Please note: the newer version of M2eclipse plugin is not compatible with the old Maven Project. Therefore you must enable your maven project with the latest M2eclipse plugin from the Installing m2eclipse website.)
 +
#Create the plugin from the archetype using the Maven command line tool mvn, then use import existing maven project to add the generated project to Eclipse. For more details, please refer to [[#Use_the_command_line_version_of_Maven_to_create_a_project |  Use the command line version of Maven to create a project]].
 +
</ref>
 +
----
 +
<references/>
 +
 
 +
=Create a "Hello World" application with ZK Maven Archetype=
 +
== Create a Maven Project==
 
*'''[File]''' -> '''[New]''' -> '''[Other]''' --> '''[Maven Project]'''
 
*'''[File]''' -> '''[New]''' -> '''[Other]''' --> '''[Maven Project]'''
*:[[File:ZK_Installation_Guide_Maven_step1.png]]
+
*:[[File:ZK_Installation_Guide_Quick_Start_Maven_New_project-01.png]]
*Make sure ''Create a simple project'' is not ticked in the first screen of the New Maven Project wizard and click '''Next >'''.
+
*Make sure ''Create a simple project'' is unticked in the first screen of the New Maven Project wizard and click '''Next >'''.
 
*:[[File:ZK_Installation_Guide_Maven_Archetype_step1.png]]
 
*:[[File:ZK_Installation_Guide_Maven_Archetype_step1.png]]
*From the ''Select an Archetype'' screen, we'll need to add the ZK archetype catalog. Click '''Configure...'''.
+
*From the ''Select an Archetype'' screen, select '''ZK Maven Archetype''' from the catalog dropdown list.
*:[[File:ZK_Installation_Guide_Maven_Archetype_step2.png]]
+
*:[[File:ZK_Installation_Guide_Quick_Start_Maven_New_project-02.png]]
*From the Maven archetypes catalogs setting, click ''Add Remote Catalog''... and add the catalog file:
+
*Select ''zk-archetype-webapp'' from the list. (At the time of writing this article was at version '''6.0''. Please choose the latest release available.').
*:[[File:ZK_Installation_Guide_Maven_Archetype_step3.png]]
 
http://mavensync.zkoss.org/maven2/
 
*Click '''Verify...''' and then '''OK''' to add the catalog.
 
**Remote catalog is empty.<ref>
 
If you receive the error message Remote catalog is empty, this is most likely due to a bug in the m2eclipse plugin in v0.12.x, [https://issues.sonatype.org/browse/MNGECLIPSE-2757 MNGECLIPSE-2757].
 
Until m2eclipse 0.13.x or newer are released, there are two possible workarounds:
 
#Install the "''Older version''" 0.10.x from the [http://m2eclipse.sonatype.org/installing-m2eclipse.html Installing m2eclipse] website. You'll need to first uninstall m2eclipse 0.12.x, restart and then install 0.10.x from these install sites:
 
#: http://m2eclipse.sonatype.org/sites/m2e/0.10.2.20100623-1649/
 
#Create the plugin from the archetype using the Maven command line tool mvn, then use Import existing maven project to add the generated project to Eclipse. please refer to [[#Use_the_command_line_version_of_Maven_for_creating_the_project |  Use the command line version of Maven for creating the project]].
 
</ref>
 
*Click '''OK''' in the "Preferences" dialogue.
 
*Now you should be able to find '''zk''' in the Catalog dropdown list.  
 
*:[[File:ZK_Installation_Guide_Maven_Archetype_step4.png]]
 
*Select the ''zk-archetype-webapp'' from the list. (At time of writing this is at version '''0.8.0''').
 
 
*Next, fill in details for ''group id, artifact id, version'' number and ''package'' name.
 
*Next, fill in details for ''group id, artifact id, version'' number and ''package'' name.
*:[[File:ZK_Installation_Guide_Maven_Archetype_step5.png]]
+
*:[[File:ZK_Installation_Guide_Quick_Start_Maven_New_project-03.png]]
**Property zk-version-since is missing.<ref>
+
*The property ''zk-version-since'' might be <font color="red">missing</font>.<ref>
The first time you run this wizard, m2eclipse will not yet have downloaded the zk archetype, and might not populate the zk-version-since property correctly, leading to an error message like:
+
Users who are running this wizard for the first time, ZK Archetype would not have been downloaded into m2eclipse yet, and as a result may not populate the ''zk-version-since'' property correctly, leading to an error message like the following:
* Unable to create project from archetype [org.zkoss:zk-archetype-webapp:0.8.0 -> http://mavensync.zkoss.org/maven2/], Archetype org.zkoss:zk-archetype-webapp:0.8.0 is not configured Property zk-version-since is missing.
 
  
The simple workaround is to just try again - this time the zk-version-since property should appear in the list. If it is still missing - add it with the value Example and try again.
+
<pre style="background:#FFFFDD">
 +
Unable to create project from archetype [org.zkoss:zk-archetype-webapp:6.0 -> https://mavensync.zkoss.org/maven2/],
 +
Archetype org.zkoss:zk-archetype-webapp:6.0 is not configured property ''zk-version-since'' is missing.
 +
</pre>
 +
The simple workaround for this problem is to just try again after clicking ‘Finish’ to end the ZK Maven web project wizard. When re-running the wizard, the zk-version-since property should appear in the list this time.  
 
  </ref>
 
  </ref>
*Click '''Finish''' and the Eclipse status bar should say ' ''Creating zk-archetype-webapp'' ' and ' ''Updating Maven Dependencies'' '. If this is the first time you deal with ZK libraries, Maven will download the necessary dependencies to compile and run this example, and would be stored in ''.m2/repository'' in your home directory.
+
*Click '''Finish''' and the Eclipse status bar should say ' ''Creating zk-archetype-webapp'' ' and ' ''Updating Maven Dependencies'' '. If this is the user's first time dealing with ZK libraries, Maven will download the necessary dependencies to compile and run this example, and would be stored in ''.m2/repository'' in the user's home directory.
*:[[File:ZK_Installation_Guide_Maven_Archetype_step6.png]]
+
*:[[File:ZK_Installation_Guide_Quick_Start_Maven_New_project-04.png]]
 
----
 
----
 
<references/>
 
<references/>
 
----
 
----
== How to run Maven project on Run-Jetty-Run ==
+
 
#Goto '''Run Configurations'''
+
==Run the application==
#: [[File:ZK_Installation_Guide_maven_Archetype_run1.png]]
+
#Go to '''Run As''' > '''Maven build...'''
#Double click on '''Jetty Webapp'''  
+
#: [[File:ZK_Installation_Guide_Quick_Start_Maven_run_project-01.png]]
#* It will auto fill '''Project''' / '''Port''' / '''Context''' / '''WebApp Dir '''
+
#In the goals field, enter ''jetty:stop jetty:run'' and tick ''Skip Tests'' then click "Apply" then "Run".
#: [[File:ZK_Installation_Guide_maven_Archetype_run2.png]]
+
#: [[File:ZK_Installation_Guide_Quick_Start_Maven_run_project-02.png]]
#Click '''Run''' and browse http://127.0.0.1:8080/myapp/
+
#View the result in your browser.
== packing your project ==
+
[http://localhost:8080/mywebapp/index.zul http://localhost:8080/mywebapp/index.zul]
#Goto '''Run As''' > '''Maven package'''
+
 
 +
== Packaging your project into a Web Application Archive (WAR)==
 +
#Go to '''Run As''' > '''Maven install'''
 
#: [[File:ZK_Installation_Guide_maven_Archetype_pak1.png]]
 
#: [[File:ZK_Installation_Guide_maven_Archetype_pak1.png]]
#Your project will be pack into a war file and a zip file with source code.
+
#The project will then be packed into a war file and a zip file with source code.
#: [[File:ZK_Installation_Guide_maven_Archetype_pak2.png]]
+
#: [[File:ZK_Installation_Guide_Quick_Start_Maven_package_project.png]]
== Use the command line version of Maven for creating the project==
+
 
*Here describes how to set up [http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html Maven].
+
= Create a Maven Project with a Command Line Interface=
*Go to the folder for your Eclipse workspace, then run this command.
+
Before starting, you need to [https://maven.apache.org/download.cgi install maven] and [https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html set up] first.
*Calling ''archetype:generate -DarchetypeCatalog=http://mavensync.zkoss.org/maven2/'' the plugin will first ask to choose the archetype from the zk catalog. Just enter the number of the archetype.
+
 
*It then asks you to enter the values for the groupId, the artifactId and the version of the project to create and the base package for the sources.
+
*Go to the folder in Eclipse workspace, then run the following command:
*It then asks for confirmation of the configuration and performs the creation of the project.
+
<source lang='text'>
*In the following example, we selected the webapp archetype (numbered 2) and set ''groupId'' to '''com.jimmy''', ''artifactId'' to '''myapp''', ''version'' to '''1.0-SNAPSHOT''' and ''package'' to '''com.jimmy.myapp'''.
+
mvn archetype:generate -DarchetypeCatalog=https://mavensync.zkoss.org/maven2/
<source lang="dos" >
 
$ mvn archetype:generate -DarchetypeCatalog=http://mavensync.zkoss.org/maven2/
 
[INFO] Scanning for projects...
 
[INFO] Searching repository for plugin with prefix: 'archetype'.
 
[INFO] ------------------------------------------------------------------------
 
[INFO] Building Maven Default Project
 
[INFO]    task-segment: [archetype:generate] (aggregator-style)
 
[INFO] ------------------------------------------------------------------------
 
[INFO] Preparing archetype:generate
 
[INFO] No goals needed for project - skipping
 
[INFO] [archetype:generate {execution: default-cli}]
 
[INFO] Generating project in Interactive mode
 
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
 
Choose archetype:
 
1: http://mavensync.zkoss.org/maven2/ -> zk-archetype-component (zk-archetype-component)
 
2: http://mavensync.zkoss.org/maven2/ -> zk-archetype-webapp (zk-archetype-webapp)
 
Choose a number: : 2
 
Downloading: http://mavensync.zkoss.org/maven2//org/zkoss/zk-archetype-webapp/0.8.0/zk-archetype-webapp-0.8.0.jar
 
11K downloaded  (zk-archetype-webapp-0.8.0.jar)
 
Downloading: http://mavensync.zkoss.org/maven2//org/zkoss/zk-archetype-webapp/0.8.0/zk-archetype-webapp-0.8.0.pom
 
1K downloaded  (zk-archetype-webapp-0.8.0.pom)
 
Define value for property 'groupId': : com.jimmy
 
Define value for property 'artifactId': : myapp
 
Define value for property 'version': 1.0-SNAPSHOT:
 
Define value for property 'package': com.jimmy: com.jimmy.myapp
 
[INFO] Using property: zk-version-since = 5.0.6
 
Confirm properties configuration:
 
groupId: com.jimmy
 
artifactId: myapp
 
version: 1.0-SNAPSHOT
 
package: com.jimmy.myapp
 
zk-version-since: 5.0.6
 
Y:
 
[INFO] ------------------------------------------------------------------------
 
[INFO] BUILD SUCCESSFUL
 
[INFO] ------------------------------------------------------------------------
 
[INFO] Total time: 22 seconds
 
[INFO] Finished at: Thu Jul 28 12:07:19 CST 2011
 
[INFO] Final Memory: 12M/150M
 
[INFO] ------------------------------------------------------------------------
 
 
</source>
 
</source>
== Import Maven project into Eclipse==
+
Then just answer the questions the plugin asks you to create a project.
 +
* The plugin will first ask to choose the archetype from the zk catalog, please just enter the number of the archetype
 +
*It will then ask users to enter the values for ''groupId'', the ''artifactId'' and the ''version'' of the project to create and the base package for the sources.
 +
*It will then ask for confirmation of the configuration and perform the creation of the project.
 +
*In the following example, webapp archetype (number 3) is selected and ''groupId'' is set to '''com.foo''', ''artifactId'' to '''mywebapp''', ''version'' to '''0.8.0'' and ''package'' to '''com.foo''''.
 +
 
 +
'''NOTE''': in case your maven installation uses the latest maven-archetype-plugin version 3.0.1 you'll have to use the following command (using 2.4 as a fallback - [https://issues.apache.org/jira/browse/ARCHETYPE-519 ARCHETYPE-519]):
 +
  $ mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://mavensync.zkoss.org/maven2/
 +
 
 +
 
 +
  $ mvn archetype:generate -DarchetypeCatalog=https://mavensync.zkoss.org/maven2/
 +
  [INFO] Scanning for projects...
 +
  [INFO] Searching repository for plugin with prefix: 'archetype'.
 +
  [INFO] ------------------------------------------------------------------------
 +
  [INFO] Building Maven Default Project
 +
  [INFO]    task-segment: [archetype:generate] (aggregator-style)
 +
  [INFO] ------------------------------------------------------------------------
 +
  [INFO] Preparing archetype:generate
 +
  [INFO] No goals needed for project - skipping
 +
  [INFO] [archetype:generate {execution: default-cli}]
 +
  [INFO] Generating project in Interactive mode
 +
  [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.
 +
  archetypes:maven-archetype-quickstart:1.0)
 +
  Choose archetype:
 +
  1: https://mavensync.zkoss.org/maven2/ -> zk-archetype-component (An archetype
 +
  that generates a starter ZK component project)
 +
  2: https://mavensync.zkoss.org/maven2/ -> zk-archetype-extension (An archetype
 +
  that generates a starter ZK extension project)
 +
  3: https://mavensync.zkoss.org/maven2/ -> zk-archetype-webapp (An archetype that
 +
  generates a starter ZK CE webapp project)
 +
  4: https://mavensync.zkoss.org/maven2/ -> zk-ee-eval-archetype-webapp (An
 +
  archetype that generates a starter ZK EE-eval webapp project)
 +
  Choose a number: : 3
 +
  Define value for property 'groupId': : com.foo
 +
  Define value for property 'artifactId': : mywebapp
 +
  Define value for property 'version': 1.0-SNAPSHOT: 0.8.0
 +
  Define value for property 'package': com.foo:
 +
  [INFO] Using property: zk-version-since = 6.0.1
 +
  Confirm properties configuration:
 +
  groupId: com.foo
 +
  artifactId: mywebapp
 +
  version: 0.8.0
 +
  package: com.foo
 +
  zk-version-since: 6.0.1
 +
  Y:
 +
  [INFO] ------------------------------------------------------------------------
 +
  [INFO] BUILD SUCCESSFUL
 +
  [INFO] ------------------------------------------------------------------------
 +
  [INFO] Total time: 29 seconds
 +
  [INFO] Finished at: Fri Jun 22 16:55:27 CST 2012
 +
  [INFO] Final Memory: 13M/150M
 +
  [INFO] ------------------------------------------------------------------------
 +
 
 +
== Run the Project ==
 +
The project created by archetypes above should have a maven jetty plugin configured, you can just run the project with the command below:
 +
 
 +
mvn jetty:run
 +
 
 +
== Import a Maven project into Eclipse==
 
*'''[File]''' -> '''[Import]''' -> '''[Maven]''' -->  '''[Existing Maven Projects]'''
 
*'''[File]''' -> '''[Import]''' -> '''[Maven]''' -->  '''[Existing Maven Projects]'''
*:[[File:ZK_Installation_Guide_Maven_Archetype_import1.png]]
+
*:[[File:ZK_Installation_Guide_Quick_Start_Maven_import.png]]
*After this you should get three new projects in your Package explorer.
+
*After this, the user should now get a new project in the Package explorer.
*:[[File:ZK_Installation_Guide_Maven_Archetype_step6.png]]
+
*:[[File:ZK_Installation_Guide_Quick_Start_Maven_New_project-04.png]]
 +
 
 +
=Version History=
 +
 
 +
{| border='1px' | width="100%"
 +
! Version !! Date !! Content
 +
|-
 +
| &nbsp;
 +
| &nbsp;
 +
| &nbsp;
 +
|}
 +
 
 +
{{ZKInstallationGuidePageFooter}}

Latest revision as of 10:17, 21 April 2020


DocumentationZK Installation GuideQuick StartCreate and Run Your First ZK Application with Eclipse and Maven
Create and Run Your First ZK Application with Eclipse and Maven



M2eclipse is the first and most mature of the projects aimed at integrating Apache Maven within the Eclipse IDE.

Prepare Eclipse

Install Eclipse

Please follow the installation guide for your Eclipse:

Install Eclipse

Install M2eclipse

Please follow the installation guide for your M2eclipse:

Install M2eclipse

Add ZK Maven Archetype

  • [Window] -> [Preferences] -> [Maven] --> [Archetypes], click Add Remote Catalog and type in the catalog file as illustrated:
    ZK Installation Guide Quick Start Create and Run with Eclipse and Maven.png
https://mavensync.zkoss.org/maven2/
  • Click Verify and then OK to add the catalog.
    • If the Remote catalog is empty.[1]

  1. If an error message appears stating that the Remote catalog is empty, this is most likely due to a bug in the m2eclipse plugin in v0.12.x, MNGECLIPSE-2757. Until m2eclipse 0.13.x or newer versions are released and available, there are two possible workarounds:
    1. Install the "older version" 0.10.x from the Installing m2eclipse website. Users will first need to uninstall m2eclipse 0.12.x, restart, and then install 0.10.x available from the following site:
      http://m2eclipse.sonatype.org/sites/m2e/0.10.2.20100623-1649/
    2. Install the “newer version” from the following site: http://download.eclipse.org/technology/m2e/releases You first will need to uninstall m2eclipse 0.12.x, restart Eclipse before you can install the “newer” version from the website above. (Please note: the newer version of M2eclipse plugin is not compatible with the old Maven Project. Therefore you must enable your maven project with the latest M2eclipse plugin from the Installing m2eclipse website.)
    3. Create the plugin from the archetype using the Maven command line tool mvn, then use import existing maven project to add the generated project to Eclipse. For more details, please refer to Use the command line version of Maven to create a project.

Create a "Hello World" application with ZK Maven Archetype

Create a Maven Project

  • [File] -> [New] -> [Other] --> [Maven Project]
    ZK Installation Guide Quick Start Maven New project-01.png
  • Make sure Create a simple project is unticked in the first screen of the New Maven Project wizard and click Next >.
    ZK Installation Guide Maven Archetype step1.png
  • From the Select an Archetype screen, select ZK Maven Archetype from the catalog dropdown list.
    ZK Installation Guide Quick Start Maven New project-02.png
  • Select zk-archetype-webapp from the list. (At the time of writing this article was at version '6.0. Please choose the latest release available.').
  • Next, fill in details for group id, artifact id, version number and package name.
    ZK Installation Guide Quick Start Maven New project-03.png
  • The property zk-version-since might be missing.[1]
  • Click Finish and the Eclipse status bar should say ' Creating zk-archetype-webapp ' and ' Updating Maven Dependencies '. If this is the user's first time dealing with ZK libraries, Maven will download the necessary dependencies to compile and run this example, and would be stored in .m2/repository in the user's home directory.
    ZK Installation Guide Quick Start Maven New project-04.png

  1. Users who are running this wizard for the first time, ZK Archetype would not have been downloaded into m2eclipse yet, and as a result may not populate the zk-version-since property correctly, leading to an error message like the following:
    Unable to create project from archetype [org.zkoss:zk-archetype-webapp:6.0 -> https://mavensync.zkoss.org/maven2/], 
    Archetype org.zkoss:zk-archetype-webapp:6.0 is not configured property ''zk-version-since'' is missing.
    

    The simple workaround for this problem is to just try again after clicking ‘Finish’ to end the ZK Maven web project wizard. When re-running the wizard, the zk-version-since property should appear in the list this time.

    
    

Run the application

  1. Go to Run As > Maven build...
    ZK Installation Guide Quick Start Maven run project-01.png
  2. In the goals field, enter jetty:stop jetty:run and tick Skip Tests then click "Apply" then "Run".
    ZK Installation Guide Quick Start Maven run project-02.png
  3. View the result in your browser.
http://localhost:8080/mywebapp/index.zul

Packaging your project into a Web Application Archive (WAR)

  1. Go to Run As > Maven install
    ZK Installation Guide maven Archetype pak1.png
  2. The project will then be packed into a war file and a zip file with source code.
    ZK Installation Guide Quick Start Maven package project.png

Create a Maven Project with a Command Line Interface

Before starting, you need to install maven and set up first.

  • Go to the folder in Eclipse workspace, then run the following command:
 mvn archetype:generate -DarchetypeCatalog=https://mavensync.zkoss.org/maven2/

Then just answer the questions the plugin asks you to create a project.

  • The plugin will first ask to choose the archetype from the zk catalog, please just enter the number of the archetype
  • It will then ask users to enter the values for groupId, the artifactId and the version of the project to create and the base package for the sources.
  • It will then ask for confirmation of the configuration and perform the creation of the project.
  • In the following example, webapp archetype (number 3) is selected and groupId is set to com.foo', artifactId to mywebapp, version to 0.8.0 and package to com.foo'.

NOTE: in case your maven installation uses the latest maven-archetype-plugin version 3.0.1 you'll have to use the following command (using 2.4 as a fallback - ARCHETYPE-519):

 $ mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://mavensync.zkoss.org/maven2/


 $ mvn archetype:generate -DarchetypeCatalog=https://mavensync.zkoss.org/maven2/
 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'archetype'.
 [INFO] ------------------------------------------------------------------------
 [INFO] Building Maven Default Project
 [INFO]    task-segment: [archetype:generate] (aggregator-style)
 [INFO] ------------------------------------------------------------------------
 [INFO] Preparing archetype:generate
 [INFO] No goals needed for project - skipping
 [INFO] [archetype:generate {execution: default-cli}]
 [INFO] Generating project in Interactive mode
 [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.
 archetypes:maven-archetype-quickstart:1.0)
 Choose archetype:
 1: https://mavensync.zkoss.org/maven2/ -> zk-archetype-component (An archetype 
 that generates a starter ZK component project)
 2: https://mavensync.zkoss.org/maven2/ -> zk-archetype-extension (An archetype 
 that generates a starter ZK extension project)
 3: https://mavensync.zkoss.org/maven2/ -> zk-archetype-webapp (An archetype that
 generates a starter ZK CE webapp project)
 4: https://mavensync.zkoss.org/maven2/ -> zk-ee-eval-archetype-webapp (An 
 archetype that generates a starter ZK EE-eval webapp project)
 Choose a number: : 3
 Define value for property 'groupId': : com.foo
 Define value for property 'artifactId': : mywebapp
 Define value for property 'version': 1.0-SNAPSHOT: 0.8.0
 Define value for property 'package': com.foo:
 [INFO] Using property: zk-version-since = 6.0.1
 Confirm properties configuration:
 groupId: com.foo
 artifactId: mywebapp
 version: 0.8.0
 package: com.foo
 zk-version-since: 6.0.1
 Y:
 [INFO] ------------------------------------------------------------------------
 [INFO] BUILD SUCCESSFUL
 [INFO] ------------------------------------------------------------------------
 [INFO] Total time: 29 seconds
 [INFO] Finished at: Fri Jun 22 16:55:27 CST 2012
 [INFO] Final Memory: 13M/150M
 [INFO] ------------------------------------------------------------------------

Run the Project

The project created by archetypes above should have a maven jetty plugin configured, you can just run the project with the command below:

mvn jetty:run

Import a Maven project into Eclipse

  • [File] -> [Import] -> [Maven] --> [Existing Maven Projects]
    ZK Installation Guide Quick Start Maven import.png
  • After this, the user should now get a new project in the Package explorer.
    ZK Installation Guide Quick Start Maven New project-04.png

Version History

Version Date Content
     



Last Update : 2020/04/21

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.