idea how to customize the package to the lib directory jar

Requirements: To publish a project in a test environment, so to be packaged. However, after several attempts to introduce a jar always found myself not get through, leading to start the error. so ... troubleshooting start!

My environment: idea, maven, jdk8;

Project structure: The following diagram, libs three jar package is additionally introduced himself, because in the maven PW did not find them, do not want to re-upload.

 

 

 

First look directly packed result:

  

 

 

 

 

 I introduced the custom of the jar package is zap-api. ***, and arguably should be ranked last in sequence (not to cut all the space, flip up and down and it was not jar package).

  * Here I use the gadget a package of anti-analytic jar, the jar can directly view the package contents. Attached link, there is a need can be extracted directly:

Links: https://pan.baidu.com/s/1MuhnYLA7ykqio0337LrQcg
extraction code: y7ld

Then we would think ... Why not get it? Only one reason, could not find. The program can not find the address you customize the jar.

<! - definition of the directory from the jar packets packaged together -> 
<
Resources > < Resource > < Directory > libs </ Directory > <! - Custom jar package in the project directory -> < The targetPath > the BOOT -INF / lib </ targetPath > <-! packaging target storage path -> < Includes > < the include > . ** / * JAR </ the include > <-! filter file types -> </ Includes > < / Resource > </ Resources >

Above. Code segment need to add resource in pom.xml. In order to get to your custom directory jar when packing, but after being together into the jar package of the project.

Plus packaging configuration result:

   

 

 

 

Look, custom jar which has packed a directory, the other two are the natural (did not see it, then please carefully review this article screenshot fragments!).

Rolled together ~

 

Guess you like

Origin www.cnblogs.com/haohao111/p/11769590.html