0

I have a largish project that needs to be usable either with a command-line interface or through a web-app. The core server is deployed as 10 separate jars. The web-app is currently deployed as a .war, but that is a huge file that duplicates all the individual deployments and makes updating a module a big pain - you have to re-deploy this huge .war file every time you update anything, and much of the time we don't use the web-app.

So I am trying to deploy a "skinny war", without the dependencies. However, there's no .ear file to carry them, so at runtime, I unpack the skinny war and use jetty:run, with the classesDirectory and webAppSourceDirectory pointing into the unpacked content. That all seems to work. The problem is that the dependencies from the web-app module do not make it into the classpath for jetty:run. When I use jetty:run in the web-app module, the classpath includes all parent, local, and transitive dependencies. But when I use jetty:run in the "distribution" project that depends on the web-app module, the only dependencies that get into the classpath are from the parent module, not from the web-app module. Note that the web-app module is the only local dependency in the distribution module.

What am I missing?

GrampaJohn
  • 617
  • 6
  • 10

1 Answers1

1

If I'm understanding you correctly, your problem is that Maven doesn't resolve transitive dependencies for war dependencies.

Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199
  • Exactly. I had not turned that one up - thanks! So perhaps I need to move those dependencies out into a separate pom module. – GrampaJohn Dec 16 '12 at 01:39
  • The solution was to factor out the common dependencies into another pom module and then (1) leave the lib dir empty in the .war, and (2) depend on the common dependencies in both places. It's working. – GrampaJohn Dec 17 '12 at 02:59