Excluding “provided” dependencies from Maven assembly

后端 未结 4 1304
长情又很酷
长情又很酷 2020-12-25 13:49

I am trying to use the Maven assembly plugin to build a jar-with-dependencies, except those that have provided scope.

I have copied the jar-with-dependencie

4条回答
  •  悲哀的现实
    2020-12-25 14:51

    With the latest Maven (I was testing on Maven 3.0) this appears to work as expected, with some caveats:

    The requested scope (in the dependencySet) may include additional scopes based on the following definition: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope

    Thus, if you request compile scope you will get both compile and provided. However, if you request runtime scope you should get compile and runtime (but not provided).

提交回复
热议问题