Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that maven didn't package the xml file?

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "how to solve the problem that maven did not package xml files". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Maven did not package the xml file.

Recently, we used maven to manage the project and adopted SSM's technology stack. After configuring some configuration files, packaged and deployed to tomcat, there were configuration files that could not be found in SpringMVC. In the folder generated by viewing maven packaging, we really did not see the corresponding xml files.

Originally, you need to add it to the pom.xml file of maven

MobileSchool-chat src/main/java * * / .xml true

In this way, you can repackage the xml.

When maven is packaged, the xml file under resources is not packaged.

In the maven project, when we use the install command to package jar, we sometimes need not to package some files under resources, such as the * Mapper.xml file generated by Mybatis, in order to overwrite with our newly generated files. At this time, we need to introduce the maven-jar-plugin plug-in into the project.

Add the following configuration to the pom.xml file of the project:

${project.artifactId} org.apache.maven.plugins maven-jar-plugin / mapping/**/*.xml This is the end of the content of "how to solve the problem that maven did not package xml files". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report