<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包解壓打包,對于靜態(tài)文件等是不會打包的


    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>appassembler-maven-plugin</artifactId>
    <version>1.10</version>
    <configuration>
    <!-- 生成linux, Windows兩種平臺的執(zhí)行腳本 -->
    <platforms>
    <platform>windows</platform>
    <platform>unix</platform>
    </platforms>
    <!-- 根目錄 -->
    <assembleDirectory>${project.build.directory}/mall</assembleDirectory>
    <!-- 打包的jar,以及maven依賴的jar放到這個目錄里面 -->
    <repositoryName>lib</repositoryName>
    <!-- 可執(zhí)行腳本的目錄 -->
    <binFolder>bin</binFolder>
    <!-- 配置文件的目標目錄 -->
    <configurationDirectory>conf</configurationDirectory>
    <!-- 拷貝配置文件到上面的目錄中 -->
    <copyConfigurationDirectory>true</copyConfigurationDirectory>
    <!-- 從哪里拷貝配置文件 (默認src/main/config) -->
    <configurationSourceDirectory>src/main/resources</configurationSourceDirectory>
    <!-- lib目錄中jar的存放規(guī)則,默認是${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>

    打包應(yīng)用程序,并會生成bat或sh可執(zhí)行文件



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

    打包的時候?qū)锏哪硞€文件移動到指定的位置
    posted on 2016-07-20 09:42 SIMONE 閱讀(1324) 評論(0)  編輯  收藏

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


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 一本色道久久88—综合亚洲精品| 久久国产亚洲精品麻豆| 亚洲乱亚洲乱妇无码| 国产亚洲av人片在线观看| 亚洲av成人一区二区三区观看在线 | 免费高清国产视频| 亚洲精品夜夜夜妓女网| 国产永久免费高清在线| 久久国产精品亚洲综合| 无码av免费网站| 亚洲国产日产无码精品| 国产免费看JIZZ视频| 亚洲精品国产日韩| 成年午夜视频免费观看视频| 亚洲爆乳AAA无码专区| 免费在线精品视频| 国产日韩精品无码区免费专区国产| 伊人亚洲综合青草青草久热| 男女一进一出抽搐免费视频| 亚洲国产成人久久综合一| 日本免费网站视频www区| 亚洲成a人片在线不卡| 国产jizzjizz视频免费看| 和老外3p爽粗大免费视频| 亚洲视频2020| 成人毛片免费视频| 一级毛片免费一级直接观看| 亚洲va在线va天堂va四虎| 最近的免费中文字幕视频| 日韩在线一区二区三区免费视频| 亚洲中文字幕无码不卡电影| 99热在线精品免费播放6| 亚洲中文精品久久久久久不卡| 亚洲国产一区二区视频网站| 一级做a爰全过程免费视频| 国产日本亚洲一区二区三区| 亚洲成网777777国产精品| 亚洲欧美日韩一区二区三区| 亚洲国产成人爱av在线播放| 久久国产乱子伦精品免费看| 亚洲熟妇AV日韩熟妇在线|