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

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

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

    posts - 495,comments - 227,trackbacks - 0
    <plugin>
                    
    <groupId>org.apache.maven.plugins</groupId>
                    
    <artifactId>maven-shade-plugin</artifactId>
                    
    <version>2.4.2</version>
                    
    <configuration>
                        
    <createDependencyReducedPom>false</createDependencyReducedPom>
                    
    </configuration>
                    
    <executions>
                        
    <execution>
                            
    <phase>package</phase>
                            
    <goals>
                                
    <goal>shade</goal>
                            
    </goals>
                            
    <configuration>
                                
    <artifactSet>
                                    
    <includes>
                                        
    <include>org.apache.activemq:activemq-mqtt</include>
                                    
    </includes>
                                
    </artifactSet>
                               
    <transformers>
    <transformer
    implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
    <mainClass>com.duxiu.demo.app.ApplicationKt</mainClass>
    </transformer>
    </transformers>

                            
    </configuration>
                        
    </execution>
                    
    </executions>
                
    </plugin>


    此配置方式將所有的依賴包的源碼都解壓打包進去.
    如果是war包,會將整個站點解壓打包進去.
    同時打包過程中如果有classpath和依賴的jar包有相同的類,會將classpath里的類替換掉依賴包里的類


    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
    <descriptorRefs>
    <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
    <!--<descriptors>
    <descriptor>assembly.xml</descriptor>
    </descriptors>-->
    <!--<finalName>employees-app-${project.version}</finalName>-->
    <archive>
    <manifest>
    <mainClass>com.duxiu.demo.app.ApplicationKt</mainClass>
    </manifest>
    </archive>
    </configuration>
    <executions>
    <execution>
    <phase>package</phase>
    <goals>
    <goal>single</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    只將依賴的jar包解壓打包,對于靜態文件等是不會打包的


    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>appassembler-maven-plugin</artifactId>
    <version>1.10</version>
    <configuration>
    <!-- 生成linux, Windows兩種平臺的執行腳本 -->
    <platforms>
    <platform>windows</platform>
    <platform>unix</platform>
    </platforms>
    <!-- 根目錄 -->
    <assembleDirectory>${project.build.directory}/mall</assembleDirectory>
    <!-- 打包的jar,以及maven依賴的jar放到這個目錄里面 -->
    <repositoryName>lib</repositoryName>
    <!-- 可執行腳本的目錄 -->
    <binFolder>bin</binFolder>
    <!-- 配置文件的目標目錄 -->
    <configurationDirectory>conf</configurationDirectory>
    <!-- 拷貝配置文件到上面的目錄中 -->
    <copyConfigurationDirectory>true</copyConfigurationDirectory>
    <!-- 從哪里拷貝配置文件 (默認src/main/config) -->
    <configurationSourceDirectory>src/main/resources</configurationSourceDirectory>
    <!-- lib目錄中jar的存放規則,默認是${groupId}/${artifactId}的目錄格式,flat表示直接把jar放到lib目錄 -->
    <repositoryLayout>flat</repositoryLayout>
    <encoding>UTF-8</encoding>
    <logsDirectory>logs</logsDirectory>
    <tempDirectory>tmp</tempDirectory>
    <programs>
    <program>
    <id>mall</id>
    <!-- 啟動類 -->
    <mainClass>com.duxiu.demo.app.ApplicationKt</mainClass>
    <jvmSettings>
    <extraArguments>
    <extraArgument>-server</extraArgument>
    <extraArgument>-Xmx2G</extraArgument>
    <extraArgument>-Xms2G</extraArgument>
    </extraArguments>
    </jvmSettings>
    </program>
    </programs>
    </configuration>
    </plugin>

    打包應用程序,并會生成bat或sh可執行文件



    <plugin>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
    <execution>
    <id>move-main-class</id>
    <phase>compile</phase>
    <configuration>
    <tasks>
    <move todir="${project.build.directory}/${project.artifactId}-${version}/com/duxiu/demo/app">
    <fileset dir="${project.build.directory}/classes/com/duxiu/demo/app">
    <include name="*.class" />
    </fileset>
    </move>
    </tasks>
    </configuration>
    <goals>
    <goal>run</goal>
    </goals>
    </execution>
    </executions>
    </plugin>

    打包的時候將包里的某個文件移動到指定的位置
    posted on 2016-07-20 09:42 SIMONE 閱讀(1326) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲色成人网站WWW永久| 永久免费毛片在线播放| 亚洲福利精品一区二区三区| 亚洲熟妇av一区二区三区下载| 久久精品免费观看| 人人狠狠综合久久亚洲婷婷| 中文字幕在线免费看线人| 国产成人亚洲综合| 最近2019中文免费字幕在线观看| 亚洲国产成人影院播放| 天堂亚洲免费视频| 亚洲午夜久久久影院伊人| a级在线免费观看| 亚洲AV无码久久| **毛片免费观看久久精品| 亚洲成人网在线观看| 在线观看视频免费完整版| 亚洲日韩精品国产一区二区三区| 日本免费观看网站| 在线播放国产不卡免费视频| 中文字幕亚洲日韩无线码| 久久免费精品一区二区| 亚洲综合小说久久另类区| 中文字幕无码免费久久99| 日韩亚洲翔田千里在线| 在线精品亚洲一区二区三区| 日本中文字幕免费高清视频| 亚洲国产品综合人成综合网站| 69成人免费视频无码专区| 免费人成大片在线观看播放电影| 亚洲日韩小电影在线观看| 在线观看www日本免费网站| 亚洲人成人伊人成综合网无码| 亚洲第一区精品观看| 外国成人网在线观看免费视频 | 一个人免费观看视频在线中文| 亚洲人成网77777色在线播放| 久久综合给合久久国产免费| 亚洲妇女熟BBW| 亚洲色偷偷偷鲁综合| 在线观看免费人成视频色|