0

I am trying to develop a distribution package for a complex simulator with a web-based front-end (see www.powertac.org). The simulator is a Spring-based application with 11 separate modules. We have distributed a "headless" version (without the web front-end) that allows a user to simply download the pom.xml and run the server directly - maven downloads all the pieces, if necessary, and calls the main class with command-line args.

Now I want to distribute a version that includes the simulator and the web app, and I want users to have the same experience - just issue a maven command and have it start and run in a web container. The user should not be required to have an existing installation of jetty or tomcat. I have tried to configure the cargo plugin to do this; It downloads jetty correctly, and the war file appears to contain all the dependencies (under WEB-INF/lib), but it acts as if the dependencies are not in the classpath. If there's a way to get the simulator and all the dependencies for the war file into the jetty classpath, I have not found it.

Is there some trick to this? Is it even possible?

Thanks in advance!

GrampaJohn
  • 617
  • 6
  • 10
  • I don't really know about cargo... in my prohects I just `mvn jetty:run` and everything works http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin – giorgiga Apr 21 '12 at 23:17
  • I would be happy to use the jetty plugin. It's what we use in the source environment, but I cannot see how to get it to use a .war that is specified as a maven dependency. – GrampaJohn Apr 21 '12 at 23:34
  • I inspected the .war file that is produced from the web app project, and it seems to include all its dependencies. Perhaps my problem is not related to the classpath, but to the initialization process under cargo. The error message I get is `WARN:/visualizer:unavailable java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:800) ` - note that `/visualizer` is the web context path. – GrampaJohn Apr 21 '12 at 23:42
  • see http://stackoverflow.com/questions/5259145/exception-could-not-find-factory-javax-faces-context-facescontextfactory (I'm not sure applies to jetty too – I'm no JSF fan) – giorgiga Apr 21 '12 at 23:56
  • I have it working using maven-dependency-plugin:copy, and jetty:run-war. It may not be elegant, but it works and I think I understand what it's doing. – GrampaJohn Apr 22 '12 at 02:30

0 Answers0