Maven - Add jar-with-dependencies as a dependency

后端 未结 2 693
夕颜
夕颜 2021-02-13 03:40

Question..
I\'d like to add a dependency on a Maven jar packaged with it\'s dependencies.

Details..
I have a multi-mod

2条回答
  •  再見小時候
    2021-02-13 04:04

    You can do this with a maven classifier. Classfiers are used so a maven module can build multiple artefacts from the same source. Examples are jdk1.6 or 1.7 version or even the source and javadoc jars maven can build.

    So try this:

    
      yourID
      seaniscool
      0.0.1-SNAPSHOT
      jar-with-dependencies
    
    

    If you want to rename your classfier to a better name like withNative or complete or anything else have a look at the maven shade plugin which can also build jars with dependencies but allows some more control.

提交回复
热议问题