Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Run Jetty from maven

Posted on 2011-09-18
Last Modified: 2012-05-12
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

Question by:manugeek
  • 5
  • 2
LVL 47

Expert Comment

ID: 36558254
In order to start static HTML pages you don't need jetty or any java - just install apache web server


Author Comment

ID: 36558291
Thanks for the answer, but i should be able to setup the webserver dynamically and start serving html files on a target machine...
LVL 47

Expert Comment

ID: 36558336
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.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

ID: 36558398
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  
LVL 47

Accepted Solution

for_yan earned 500 total points
ID: 36558424

Well, you can try to use jetty:

you also can
check tehse suggestions about omplementation of webserver in Java
LVL 47

Expert Comment

ID: 36558430
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
LVL 47

Assisted Solution

for_yan earned 500 total points
ID: 36558464

This is the huge list of pure Java webservers


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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
web application structure 18 99
How  can  i  resolve  HTTP Status 404 -? 8 42
ejb message driven bean mdb creation steps 2 18
swing controls 2 16
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question