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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top