3

I'm new to Java and Java web applications. I'm trying to understand why I should use a Java application server like Tomcat instead of running it from command line.

  • Should I running Jenkins without a servlet container in production i.e using java -jar jenkins.war?
  • Is Tomcat more suitable for production environments?
  • Are there other advantages?

Please give me some idea why running the application in a servlet container is important.

erikrunia
  • 2,371
  • 1
  • 15
  • 22
Sunil Khiatani
  • 337
  • 4
  • 12

1 Answers1

7

Actually when you run Jenkins as "java -jar jenkins.war" it starts embedded servlet container anyway (Winstone or Jetty). Since main load on build server comes not from web users, but (surprise-surprise) from build jobs, I don't think servlet container type can affect performance. Moreover build jobs are started in separate JVM or even on slave machines.

Also all server/job/plugins configuration is stored in Jenkins home / config folder, so the way you started Jenkins does not affect server maintenance / backup tasks. Native installers also create user and start Jenkins as a service.

"Jenkins: The Definitive Guide" - "Running Jenkins as a stand-alone application may not be to everyone’s taste. For a production server, you might want to take advantage of the more sophisticated monitoring and administration features of a full blown Java application server such as JBoss, GlassFish, or WebSphere Application Server. And system administrators may be wary of the relatively little-known Winstone server, or may simply prefer Jenkins to fit into a known pattern of Java web application development. If this is the case, you may prefer to, or be obliged to, deploy Jenkins as a standard Java web application."

volkovs
  • 1,153
  • 2
  • 11
  • 24