Run Jetty from maven

Hello Experts,

I am writing a testNG automation program in java and one of the requirements of the automation is to start a webserver and start serving static html files from a particular directory, will i be able to do this using maven and jetty ?  Please help

~manu
manugeekAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
for_yanConnect With a Mentor Commented:

Well, you can try to use jetty:
http://www.codeproject.com/KB/java/Embedding_Jetty.aspx

you also can
check tehse suggestions about omplementation of webserver in Java
http://stackoverflow.com/questions/3362855/implementation-of-a-web-server
0
 
for_yanCommented:
In order to start static HTML pages you don't need jetty or any java - just install apache web server

http://httpd.apache.org/download.cgi
0
 
manugeekAuthor Commented:
Thanks for the answer, but i should be able to setup the webserver dynamically and start serving html files on a target machine...
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
for_yanCommented:
You can start the web server from java program, if that what you meant by setup webserver dynamically

You also can set up toncat and use tomcat to serve static pages, although apache is more effective when serving static pages.
0
 
manugeekAuthor Commented:
dynamically for me is, install and start. The reason why i am thinking to embed a web server in my code is that my automation will be able to install and start webserver on any target platform without having to worry if it has a webserver installed or not  
0
 
for_yanCommented:
You can certainly create and run any java application with maven, of course also the one
which will start jetty or any other web server which you can use or implement yourself
0
 
for_yanConnect With a Mentor Commented:


This is the huge list of pure Java webservers

http://java-source.net/open-source/web-servers

though some of them mentioned there (like Tomcat) in fact rely on some pieces in native code, so
Tomcat of course would not serve your purpose
 
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.