When Eclipse uses MAVEN to package, it finds that static resources are not included.

Source: Internet
Author: User

Today, when packing, we found that there was no static resource configured in the packet.

(Right-click Project---"Run as---> 8 Maven install)

It was later discovered because there was no configuration to package static resources in Pom.xml.

<resources> gives the specific path of each resource in the MAVEN project.

<Build>        <Finalname>Project</Finalname>        <Resources>            <Resource>                <Directory>Src/main/java</Directory>                <includes>                    <include>**/*.xml</include>                    <include>**/*.properties</include>                </includes>                <filtering>True</filtering>            </Resource>            <Resource>                <Directory>Src/main/resources</Directory>                <includes>                    <include>**/*.properties</include>                    <include>**/*.xml</include>                    <include>**/*.tld</include>                </includes>                <filtering>True</filtering>            </Resource>        </Resources>    </Build>

Finalname: The name of the final result of the build,
Directory: The path to the resource file,
Includes: A set of file name matching patterns, the matching resource file will be processed by the build process
Filtering: Whether the resource is filtered during the build process, false by default

When Eclipse uses MAVEN to package, it finds that static resources are not included.

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.