<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)航:
     
    主站蜘蛛池模板: 亚洲国产综合专区在线电影| 亚洲精品午夜无码电影网| 免费人成视频x8x8入口| 亚洲精品动漫人成3d在线| 亚洲中文字幕无码不卡电影| 久久精品亚洲综合一品| 亚洲国产精品久久网午夜| 亚洲精品无码久久久久APP | 青青草国产免费国产是公开| 精品久久久久久无码免费| 亚洲午夜免费视频| 99久久精品日本一区二区免费| 免费毛片网站在线观看| 亚洲乱码中文字幕综合234| 亚洲国产精品久久久久网站| 亚洲影视自拍揄拍愉拍| 美女露隐私全部免费直播| 免费在线中文日本| 成年女人午夜毛片免费看| 亚洲av无码成人精品区在线播放| 亚洲人成色77777| 亚洲精品福利你懂| h视频免费高清在线观看| 91成人在线免费观看| 真实乱视频国产免费观看| 国产亚洲综合久久系列| 色婷五月综激情亚洲综合| 国产99精品一区二区三区免费| 亚洲免费在线视频观看| 亚洲AV无码一区二三区| 亚洲精品福利网泷泽萝拉| 青娱乐在线免费观看视频| 最近中文字幕免费完整| 免费播放春色aⅴ视频| 亚洲精品资源在线| 免费人成大片在线观看播放| 最近免费中文在线视频| 亚洲伊人成无码综合网| 在线综合亚洲中文精品| 最近国语视频在线观看免费播放| 搡女人免费视频大全|