1

I have multiple application deployed on an app server and all use the almost same set of JAR files. These applications are created as maven projects. I would want to deploy these application on my app server without having to bundle them with any JAR files. Instead i will be adding all these JAR files on the app server's separately in its own lib directory or some other directory from where these application can use for.

In this case how do i configure my maven project so that it uses the artificats to compile my project however while it creates a WAR file, it excludes all of them.

Vinodborole
  • 165
  • 2
  • 15
  • See this question: http://stackoverflow.com/questions/1031695/how-to-exclude-jars-generated-by-maven-war-plugin – matts Jun 15 '12 at 15:20

2 Answers2

3

That's what provided scope is about. From Maven docs about provided:

This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.

Michał Kalinowski
  • 16,925
  • 5
  • 35
  • 48
0

Do you create the WAR file using the maven-assembly-plugin? If so, you can exclude the dependencies being copied.

Miquel
  • 15,405
  • 8
  • 54
  • 87