Solved

Run Jetty from maven

Posted on 2011-09-18
7
288 Views
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

~manu
0
Comment
Question by:manugeek
  • 5
  • 2
7 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36558254
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
 

Author Comment

by:manugeek
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...
0
 
LVL 47

Expert Comment

by:for_yan
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.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:manugeek
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  
0
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 36558424

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
 
LVL 47

Expert Comment

by:for_yan
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
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 500 total points
ID: 36558464


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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

813 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now