<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    我的java天地

    maven實際應用

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation
    ="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      
    <modelVersion>4.0.0</modelVersion>

      
    <groupId>com.xuanwu</groupId>
      
    <artifactId>sxt_mtoserver</artifactId>
      
    <version>1.0-SNAPSHOT</version>
      
    <packaging>jar</packaging>

      
    <name>sxt_mtoserver</name>
      
    <url>http://maven.apache.org</url>

      
    <properties>
          
    <!-- 自定義變量 -->
        
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        
    <project.deploy>deploy</project.deploy>
      
    </properties>
      
      
    <build>
          
    <plugins>
              
    <!-- maven編譯插件,指定編譯jdk版本   
              如果編譯目標版本是1.6,然后在1.5虛擬機上運行錯誤提示Bad version number in .class file。所以,如果希望在1.5編譯時就發現錯誤,就要用1.5的編譯器
    -->
              
    <plugin>
                  
    <groupId>org.apache.maven.plugins</groupId>
                  
    <artifactId>maven-compiler-plugin</artifactId>
                  
    <version>2.3.2</version>
                  
    <configuration>
                    
    <source>1.5</source>
                    
    <target>1.5</target>
                
    </configuration>
              
    </plugin>
              
              
    <!-- maven打包插件,可執行jar包配置 -->
              
    <!--  
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-shade-plugin</artifactId>
                  <version>1.4</version>
                  <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>com.xuanwu.mtoserver.App</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
              </plugin>
              
    -->
              
              
    <!-- maven源文件插件 -->
               
              
    <plugin>
                  
    <groupId>org.apache.maven.plugins</groupId>
                  
    <artifactId>maven-resources-plugin</artifactId>
                  
    <version>2.5</version>
                  
    <executions>
                        
    <execution>
                            
    <id>copy-resources</id>
                            
    <phase>package</phase>
                            
    <goals>
                                
    <goal>copy-resources</goal>
                            
    </goals>
                            
    <configuration>
                                
    <encoding>UTF-8</encoding>
                                
    <outputDirectory>${project.build.directory}/${project.deploy}/conf
                                
    </outputDirectory>
                                
    <resources>
                                    
    <resource>
                                        
    <directory>src/main/resources/</directory>
                                        
    <includes>
                                            
    <include>*.xml</include>
                                            
    <include>*.properties</include>
                                            
    <include>*.conf</include>
                                        
    </includes>
                                    
    </resource>
                                
    </resources>
                            
    </configuration>
                        
    </execution>
                        
    <execution>
                            
    <id>copy-sh</id>
                            
    <phase>package</phase>
                            
    <goals>
                                
    <goal>copy-resources</goal>
                            
    </goals>
                            
    <configuration>
                                
    <encoding>UTF-8</encoding>
                                
    <outputDirectory>${project.build.directory}/${project.deploy}/
                                
    </outputDirectory>
                                
    <resources>
                                    
    <resource>
                                        
    <directory>src/main/resources/</directory>
                                        
    <includes>
                                            
    <include>*.sh</include>
                                            
    <include>*.pl</include>
                                            
    <include>*.bat</include>
                                        
    </includes>
                                    
    </resource>
                                
    </resources>
                            
    </configuration>
                        
    </execution>
                    
    </executions>
              
    </plugin>
              
              
              
    <!-- maven打jar包插件,打包后不包含pom.xml文件 -->
              
    <plugin>
                  
    <groupId>org.apache.maven.plugins</groupId>
                  
    <artifactId>maven-jar-plugin</artifactId>
                  
    <version>2.3.2</version>
                  
    <configuration> 
                     
    <archive>
                         
    <!-- 打包后不包括pom的描述文件 --> 
                          
    <addMavenDescriptor>false</addMavenDescriptor>
                        
    <!-- Maven在生成jar時,并不知道這個jar是lib還是app,所以使用以下這個插件告之MAVEN這個jar為app,指定main類 --> 
                        
    <manifest>    
                               
    <mainClass>com.xuanwu.mtoserver.util.Test</mainClass>    
                           
    </manifest>
                    
    </archive> 
                 
    </configuration>
                  
    <executions>
                        
    <execution>
                            
    <id>jarexclude</id>
                            
    <phase>package</phase>
                            
    <goals>
                                
    <goal>jar</goal>
                            
    </goals>
                            
    <configuration>
                                
    <outputDirectory>${project.build.directory}/${project.deploy}/lib</outputDirectory>
                                
    <excludes>
                                    
    <exclude>*.xml</exclude>
                                    
    <exclude>*.pl</exclude>
                                    
    <exclude>*.sql</exclude>
                                    
    <exclude>*.properties</exclude>
                                    
    <exclude>*.bat</exclude>
                                    
    <exclude>*.conf</exclude>
                                    
    <exclude>*.sh</exclude>
                                    
    <exclude>*.doc</exclude>
                                
    </excludes>
                            
    </configuration>
                        
    </execution>
                
    </executions>
              
    </plugin>
              
              
    <!-- maven打war包插件,打包后不包含pom.xml文件 -->
              
    <!-- 
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-war-plugin</artifactId>
                  <version>2.1.1</version>
                  <configuration> 
                     <archive> 
                          <addMavenDescriptor>false</addMavenDescriptor> 
                    </archive> 
                 </configuration>
              </plugin>
               
    -->
               
               
    <!-- 想要把工程的所有依賴的jar都一起打包 -->
               
    <!-- 
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-assembly-plugin</artifactId>
                  <version>2.2.1</version>
                  <configuration>
                      <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                      </descriptorRefs>
                </configuration>
              </plugin>
               
    -->
               
              
    <!-- 將項目所有包放到一個指定目錄 -->
              
    <plugin>
                  
    <groupId>org.apache.maven.plugins</groupId>
                  
    <artifactId>maven-dependency-plugin</artifactId>
                  
    <version>2.3</version>
                  
    <executions>
                        
    <execution>
                            
    <id>copy-dependencies</id>
                            
    <phase>package</phase>
                            
    <goals>
                                
    <goal>copy-dependencies</goal>
                            
    </goals>
                            
    <configuration>
                                
    <outputDirectory>${project.build.directory}/${project.deploy}/lib</outputDirectory>
                                
    <overWriteReleases>false</overWriteReleases>
                                
    <overWriteSnapshots>false</overWriteSnapshots>
                                
    <overWriteIfNewer>true</overWriteIfNewer>
                            
    </configuration>
                        
    </execution>
                
    </executions>
              
    </plugin>
              
          
    </plugins>
      
    </build>
      
    <dependencies>
        
    <dependency>
          
    <groupId>junit</groupId>
          
    <artifactId>junit</artifactId>
          
    <version>3.8.1</version>
          
    <scope>test</scope>
        
    </dependency>
        
        
    <dependency>
            
    <groupId>axis</groupId>
            
    <artifactId>axis</artifactId>
            
    <version>1.4</version>
            
    <type>jar</type>
            
    <scope>compile</scope>
        
    </dependency>
        
    <dependency>
            
    <groupId>axis</groupId>
            
    <artifactId>axis-jaxrpc</artifactId>
            
    <version>1.4</version>
            
    <type>jar</type>
            
    <scope>compile</scope>
        
    </dependency>
        
    <dependency>
            
    <groupId>commons-discovery</groupId>
            
    <artifactId>commons-discovery</artifactId>
            
    <version>20040218.194635</version>
            
    <type>jar</type>
            
    <scope>compile</scope>
        
    </dependency>
        
    <dependency>
            
    <groupId>commons-logging</groupId>
            
    <artifactId>commons-logging</artifactId>
            
    <version>1.1.1</version>
            
    <type>jar</type>
            
    <scope>compile</scope>
        
    </dependency>
        
    <dependency>
            
    <groupId>axis</groupId>
            
    <artifactId>axis-saaj</artifactId>
            
    <version>1.4</version>
            
    <type>jar</type>
            
    <scope>compile</scope>
        
    </dependency>
        
    <dependency>
            
    <groupId>axis</groupId>
            
    <artifactId>axis-wsdl4j</artifactId>
            
    <version>1.5.1</version>
            
    <type>jar</type>
            
    <scope>compile</scope>
        
    </dependency>
      
    </dependencies>
    </project>
    @import url(http://m.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

    posted on 2011-11-01 17:22 tobyxiong 閱讀(5694) 評論(0)  編輯  收藏 所屬分類: java

    <2011年11月>
    303112345
    6789101112
    13141516171819
    20212223242526
    27282930123
    45678910

    導航

    統計

    常用鏈接

    留言簿(3)

    隨筆分類(144)

    隨筆檔案(157)

    相冊

    最新隨筆

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 曰批全过程免费视频播放网站 | 少妇人妻偷人精品免费视频| 免费少妇a级毛片人成网| 亚洲日韩精品无码专区加勒比 | 韩国免费三片在线视频| 亚洲综合色区中文字幕| 猫咪社区免费资源在线观看| 亚洲综合男人的天堂色婷婷| 91嫩草免费国产永久入口| 亚洲网站视频在线观看| 99久久久国产精品免费无卡顿| 亚洲色图.com| 很黄很色很刺激的视频免费| 亚洲 欧洲 日韩 综合在线| 女人被弄到高潮的免费视频 | 一区二区三区在线免费观看视频| 无码欧精品亚洲日韩一区夜夜嗨 | 亚洲av永久无码精品网站| 日韩电影免费在线观看| 亚洲精品人成电影网| 亚洲第一成年免费网站| 国产成人综合亚洲一区| 亚洲午夜激情视频| 亚欧免费无码aⅴ在线观看| 亚洲免费观看在线视频| 国产免费av一区二区三区| 国产精品美女久久久免费 | 亚洲av不卡一区二区三区| 亚洲成人免费网站| 亚洲国产成人无码AV在线| 亚洲国产精品激情在线观看| 国产羞羞的视频在线观看免费| 亚洲欧洲春色校园另类小说| 免费看片免费播放| 中文字幕久无码免费久久| 亚洲熟妇无码爱v在线观看| 国产精品公开免费视频| 免费一区二区三区| 亚洲综合成人婷婷五月网址| 国产亚洲色婷婷久久99精品91| 亚洲黄色免费电影|