Maven project package cannot parse and read the properties file, mavenproperties

Source: Internet
Author: User

Maven project package cannot parse and read the properties file, mavenproperties

An error occurred while working on the project, and the properties file cannot be parsed.
Cocould not resolve placeholder .........

Previously, related configurations were made, but the above exception was never encountered. It was a long time to get confused. Finally, we extracted the war package and learned that the properties file was not loaded into the project, so it could not be identified.

The reason is that the maven configuration is used in the project, but the properties file will be lost during maven packaging, because maven will only scan the *. class file when executing compile.

Add the following configuration for this kind of payment.

<Resources> <resource> <directory> src/main/resources </directory> <filtering> true </filtering> <shortdes> <include> **/*. xml </include> <include> *. properties </include> </includes> </resource> </resources>

 

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.