• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            ++wythern++

            X presents Y for a better Z

            What is shade jar, and what is its purpose.

            https://stackoverflow.com/questions/13620281/what-is-the-maven-shade-plugin-used-for-and-why-would-you-want-to-relocate-java


            Uber JAR, in short, is a JAR containing everything.

            Normally in Maven, we rely on dependency management. An artifact contains only the classes/resources of itself. Maven will be responsible to find out all artifacts (JARs etc) that the project depending on when the project is built.

            An uber-jar is something that take all dependencies, and extract the content of the dependencies and put them with the classes/resources of the project itself, in one big JAR. By having such uber-jar, it is easy for execution, because you will need only one big JAR instead of tons of small JARs to run your app. It also ease distribution in some case.

            Just a side-note. Avoid using uber-jar as Maven dependency, as it is ruining the dependency resolution feature of Maven. Normally we create uber-jar only for the final artifact for actual deployment or for manual distribution, but not for putting to Maven repository.


            Update: I have just discovered I haven't answered one part of the question : "What's the point of renaming the packages of the dependencies?". Here is some brief updates and hopefully will help people having similar question.

            Creating uber-jar for ease of deployment is one use case of shade plugin. There are also other common use cases which involve package renaming.

            For example, I am developing Foo library, which depends on a specific version (e.g. 1.0) of Bar library. Assuming I cannot make use of other version of Bar lib (because API change, or other technical issues, etc). If I simply declare Bar:1.0 as Foo's dependency in Maven, it is possible to fall into a problem: A Qux project is depending on Foo, and also Bar:2.0 (and it cannot use Bar:1.0 because Qux needs to use new feature in Bar:2.0). Here is the dilemma: should Qux use Bar:1.0 (which Qux's code will not work) or Bar:2.0 (which Foo's code will not work)?

            In order to solve this problem, developer of Foo can choose to use shade plugin to rename its usage of Bar, so that all classes in Bar:1.0 jar are embedded in Foo jar, and the package of the embedded Bar classes is changed from com.bar to com.foo.bar. By doing so, Qux can safely depends on Bar:2.0 because now Foo is no longer depending on Bar, and it is using is own copy of "altered" Bar located in another package.

            posted on 2017-06-19 11:23 wythern 閱讀(278) 評論(0)  編輯 收藏 引用

            久久香蕉综合色一综合色88| 久久影视国产亚洲| 无码人妻少妇久久中文字幕蜜桃 | 四虎国产精品成人免费久久| 久久天天躁狠狠躁夜夜不卡| 韩国免费A级毛片久久| 欧美久久精品一级c片片| 久久精品亚洲男人的天堂| 亚洲AV无码久久精品色欲| 久久精品一区二区三区不卡| 午夜视频久久久久一区| 久久精品黄AA片一区二区三区| 久久精品一区二区影院| 欧洲成人午夜精品无码区久久| 94久久国产乱子伦精品免费| 亚洲欧美日韩中文久久| AAA级久久久精品无码区| 青青草原精品99久久精品66| 色综合久久夜色精品国产| 久久国产精品久久精品国产| 一本久道久久综合狠狠爱| 久久久久亚洲AV无码专区桃色| 99久久精品国产免看国产一区| 久久午夜福利无码1000合集| 久久影院久久香蕉国产线看观看| 久久99热只有频精品8| 久久久久久综合网天天| 亚洲国产成人久久一区久久| 狠狠精品久久久无码中文字幕| 国产精品一久久香蕉国产线看 | 久久亚洲日韩精品一区二区三区| 久久久久久噜噜精品免费直播| 88久久精品无码一区二区毛片| 久久国产亚洲精品麻豆| AAA级久久久精品无码片| 久久精品无码一区二区无码| 人妻少妇久久中文字幕一区二区 | 久久久久人妻一区精品色| 久久精品国产欧美日韩99热| 噜噜噜色噜噜噜久久| 久久久久久国产a免费观看黄色大片 |