When using Eclipse dependency build jar package, if do configuration, the generated jar package file will be all generated outside, this is not what we need, let's modify the next configuration, so that the generated jar package to meet our needs.
1. If you do not make any configuration, the generated jar package is as follows.
The most primitive way to build is not what we want, we want the test.properties and ums.properties files to be placed in the message folder at the same time, modify the eclipse configuration below.
2. Modify the eclipse configuration so that the test.properties and ums.properties files are placed in the message folder at the same time.
The most primitive is shown
Modify the Deploy path for the source to/message as a message, as shown
After the modification is finished, click the OK button, publish, and generate the jar package content as shown below
At this point we can see that there is a message folder in the jar package, but at this time we will find that the message folder contains Test.properties and ums.properties files, and the outermost layer also has the two files. At this point we need to continue to do configuration.
3. Modify the configuration so that the specified contents of the Message resource folder do not appear at the outermost layer of the jar package.
Not modified before as shown
Click on the excluded below the message, then click Edit on the right, enter the editor, enter the *.properties in the exclude below, complete as shown
Finally, when you build the jar package, you will see that there is only one message folder in it, and no other files are generated at the outermost time, as shown in the
4. Complete.
When JAVA uses eclipse dependency to build a jar package, it avoids the configuration of the outermost layer generating the resource file at the same time.