Create and Run Your First ZK Application with Gradle"

From Documentation
Line 16: Line 16:
  
 
== Run the Project ==
 
== 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:
+
The example project uses the gradle build plugin [https://github.com/akhikhl/gretty gretty], which allows running the program with the command below:
  
 
     ./gradlew appRun
 
     ./gradlew appRun
  
Then access the test page under:
+
Once you see the following output:
 +
 
 +
    17:32:19 INFO  Jetty 9.2.15.v20160210 started and listening on port 8080
 +
    17:32:19 INFO  zk-gradle runs at:
 +
    17:32:19 INFO    http://localhost:8080/zk-gradle
 +
    Press any key to stop the server.
 +
 
 +
The server has started and you can access the test page under:
 +
 
 
http://localhost:8080/zk-gradle
 
http://localhost:8080/zk-gradle
  

Revision as of 09:37, 15 March 2017


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



Using the gradle example

To use the zk-gradle example project all you need is a command line interface (and preferably git - but not necessary).

Since gradle is a complex tool a basic understanding about gradle itself will help understanding the example -> please refer to the gradle documentation pages.

Download/Clone the example project

with git command line installed all you need is to clone the example repository:

   git clone [email protected]:zkoss-demo/zk-gradle.git


Run the Project

The example project uses the gradle build plugin gretty, which allows running the program with the command below:

   ./gradlew appRun

Once you see the following output:

   17:32:19 INFO  Jetty 9.2.15.v20160210 started and listening on port 8080
   17:32:19 INFO  zk-gradle runs at:
   17:32:19 INFO    http://localhost:8080/zk-gradle
   Press any key to stop the server.

The server has started and you can access the test page under:

http://localhost:8080/zk-gradle

Import a Gradle project into your IDE

The example project doesn't include or require any IDE specific settings and can be imported into your preferred IDE supporting gradle.

In Eclipse you can use the buildship plugin For IntelliJ IDEA just follow the Help page: Working with Gradle Projects