<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)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 精品国产免费一区二区三区香蕉| 成人免费看片又大又黄| 久久久久久亚洲Av无码精品专口 | 国产精品黄页免费高清在线观看| 亚洲综合无码精品一区二区三区| 1000部夫妻午夜免费| 久久久久久亚洲精品无码| 国产亚洲一区二区精品| 成年女人午夜毛片免费视频| 国产精品成人免费观看| 亚洲成人福利网站| ZZIJZZIJ亚洲日本少妇JIZJIZ| 天天影视色香欲综合免费| 久久亚洲精品高潮综合色a片| 久久亚洲一区二区| 四虎永久免费影院在线| 99re6在线精品视频免费播放| 国产成人va亚洲电影| 久久久久久亚洲AV无码专区| 亚洲国产精品人人做人人爱| 四虎永久在线观看免费网站网址| sihu国产精品永久免费| 亚洲国产视频久久| 午夜亚洲www湿好大| 亚洲国产精品成人AV无码久久综合影院| 无码成A毛片免费| 午夜免费国产体验区免费的| 亚洲一区二区三区免费观看| 亚洲国产精品无码久久一区二区| 国产免费观看a大片的网站| 1000部拍拍拍18勿入免费视频软件 | 亚洲日韩激情无码一区| 免费看a级黄色片| 亚洲第一网站免费视频| 热99RE久久精品这里都是精品免费| 含羞草国产亚洲精品岁国产精品 | 亚洲色欲久久久综合网东京热| 日韩在线a视频免费播放| 精品一区二区三区免费毛片爱 | 亚洲精品黄色视频在线观看免费资源| 中国china体内裑精亚洲日本|