码迷,mamicode.com
首页 > 编程语言 > 详细

将maven项目中的hbm.xml文件打入jar包中

时间:2015-10-10 17:24:28      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:

方法一:本人实际操作过,好用

<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>

方法二:本人没用过,听说不是很稳定

(1)jar包的时候

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <configuration>
        <archive>
          <addMavenDescriptor>false</addMavenDescriptor>
        </archive>
      </configuration>
    </plugin>
  </plugins>
</build>

(2)war包的时候

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <configuration>
        <archive>
          <addMavenDescriptor>false</addMavenDescriptor>
        </archive>
      </configuration>
    </plugin>
  </plugins>
</build>

 

将maven项目中的hbm.xml文件打入jar包中

标签:

原文地址:http://my.oschina.net/u/1169535/blog/515311

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!