# How to run a maven project in eclipse?

ntsetso
51 1 3

Hi,

I'm in the very beginning. I've configured ZK Studio 6 in eclipse following ZK 6 Essentials instructions and imported the sample store application following same instructions as well.
After all I can't find out how to run the project. I find ZK documentation laconic in many aspects for a beginner. I managed to run the same project in the ZK 5 version some time ago, but looks like the html version of ZK 5 Essentials is no longer available and the available pdf version has long code lines cut in some places. Any way I'd like to follow newer tutorials.
I'll appreciate a step by step explanation.

TIA,
ntsetso

delete retag edit

## 11 Replies

hawk
1879 1 5
http://hawkphoenix.blogsp...

Hi,

Do you mean run a web application project in eclipse?
just right click on the project, select "Run As" \ "Run on Server"

ntsetso
51 1 3

Hi,

The option "Run As" \ "Run on Server" worked with the former version of "Store sample" based on ZK 5, and Tomcat could be chosen as the server.
With ZK 6, following this tutorial Setting Up the Applications Using Eclipse/Store, the server option is no longer available.
The options I get from "Run As" are:
1 Java Applet
2 Java Application
3 Junit Test
4 Maven Build
5 Maven Build
6 Maven clean
... and so on.
Please have a look at referred instructions if you don't mind.
BTW, after installing maven, I can run the project from project root directory on command line with:

mvn jetty:run

Want to run it from eclipse.

hawk
1879 1 5
http://hawkphoenix.blogsp...

Hi,

Right Click on the project \ "Properties" \ "Project Facets"

then check the "Dynamic Web Module" to make the project as a dynamic web project, then you can run it with "Run As" \ "Run on Server".

ntsetso
51 1 3

Hi,

Just to rectify my early statement: Was wrong. In fact the available HTML version I referred above does not differ in contents with the ZK 5 Essentials PDF.
Regards.

hawk
1879 1 5
http://hawkphoenix.blogsp...

Hi,
So, your "running project" problem is solved?

pasqualeleone
81 2

i have the same problem of ntsetso. After import click right mouse button and then?

The options I get from "Run As" are:
1 Java Applet
2 Java Application
3 Junit Test
4 Maven Build
5 Maven Build
6 Maven clean
...
what is the right procedure for import an existing maven project?
tnx

hawk
1879 1 5
http://hawkphoenix.blogsp...

Hi,
The procedure is right. you can run the project with maven command "mvn jetty:run".
If you want to use "Run As", you should setup "Project facet" first. The eclipse doesn't setup this automatically when importing a maven project, that's why you can't see a "Run on Server" option.

pasqualeleone
81 2

Hi,
i work with IDE Eclipse, i setup "project facet" adding "Dynamic Web Module" and "Zk Studio" and than download Tomcat 7.0 (becauseTomcat 6.0 don't work) and than drag some file from folder webapp to WEB-INF and now think that run.
I will test this.
Thank you

ntsetso
51 1 3

Hi,

When searching for maven in eclipse market place there is:

1 - Maven integration for eclipse WTP
2- Maven integration for eclipse

In the past I always chose the second option.
This time I decided to try the first option (afterward I took the second also).

Then imported a maven project and ran it straight forward with no need of additional configuration. Now it works.

After installing "Maven integration for eclipse WTP", take a look in this page . There's no need of drag files from folder webapp to WEB-INF.

hawk
1879 1 5
http://hawkphoenix.blogsp...

Hi,
I don't see any description in the page http://books.zkoss.org/wiki/ZK_Installation_Guide/Setting_up_IDE/Maven/Use_ZK_Maven_Archetype/Create_and_Run_ZK_Application_with_Maven_Archetype that tells you drag files from "webapp" to "WEB-INF". Could you point out more precisely ?

[hide preview]