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.

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.