Method One: I have actually operated, easy to use
<build> <finalname>basic</finalname > <plugins> <plugin> <groupid>org.codehaus.mojo</groupid > <artifactId>tomcat-maven-plugin</artifactId> <version>1.0-beta-1</version> < configuration> <url>http://www.my.com:6789/manager/html</url> <server> tomcat7</server> </configuration> </plugin> </ plugins> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*. hbm.xml</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.xml</include> <include>**/*.properties</include> </includes > </resource> </resources> </build>
Method Two: I did not use, I heard that is not very stable
(1) when the jar package
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <art ifactid>maven-jar-plugin</artifactid> <configuration> <archive> <addmavendesc riptor>false</addmavendescriptor> </archive> </configuration> </plugin> </pl Ugins></build>
(2) When the war package
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <art ifactid>maven-war-plugin</artifactid> <configuration> <archive> <addmavendesc riptor>false</addmavendescriptor> </archive> </configuration> </plugin> </pl Ugins></build>
Hbm.xml files in a MAVEN project into a jar package