maven assembly plugin,maven dependency plugin的使用
maven assembly plugin: 將第三方jar包和應用整合打成一個jar包,打包時使用mvn clean, mvn assembly:assembly, jar檔案會比較冗餘盤大
maven dependency plugin: 將第三方jar包打包到一個資料夾中,打包時使用mvn clean,mvn package,伺服器上上傳一次lib包,後面的應用程式jar包檔案很小
暫時理解Pom.xml檔案中配置一個就可以了 如下:
maven dependency plugin: 將第三方jar包打包到一個資料夾中,打包時使用mvn clean,mvn package,伺服器上上傳一次lib包,後面的應用程式jar包檔案很小
暫時理解Pom.xml檔案中配置一個就可以了 如下:
點選(此處)摺疊或開啟
-
<project xmlns="" xmlns:xsi=""
-
xsi:schemaLocation=" ">
-
<modelVersion>4.0.0</modelVersion>
-
<groupId>com.sany</groupId>
-
<artifactId>ECCDataElasticSearch</artifactId>
-
<version>0.0.1-SNAPSHOT</version>
-
<build>
-
<finalName>ECCDataElasticSearch</finalName> <!-- 指定輸出到target目錄的jar包名稱 -->
-
<plugins>
-
-
<!-------------------- maven assembly plugin ------------------------>
-
<!-- <plugin> -->
-
<!-- <artifactId>maven-assembly-plugin</artifactId> -->
-
<!-- <version>2.6</version> -->
-
<!-- <configuration> -->
-
<!-- <descriptorRefs> -->
-
<!-- <descriptorRef>jar-with-dependencies</descriptorRef> -->
-
<!-- </descriptorRefs> -->
-
<!-- <archive> -->
-
<!-- <manifest> -->
-
<!-- <mainClass>com.sany.ecc.WkTimeCal</mainClass> -->
-
<!-- </manifest> -->
-
<!-- </archive> -->
-
<!-- </configuration> -->
- <!-- </plugin> -->
-
-
-
<!-- maven-dependency-plugin -------------------------------------------------------->
-
<plugin>
-
<groupId>org.apache.maven.plugins</groupId>
-
<artifactId>maven-dependency-plugin</artifactId>
-
<executions>
-
<execution>
-
<id>copy-dependencies</id>
-
<phase>prepare-package</phase>
-
<goals>
-
<goal>copy-dependencies</goal>
-
</goals>
-
<configuration>
-
<outputDirectory>${project.build.directory}/lib</outputDirectory>
-
<overWriteReleases>false</overWriteReleases>
-
<overWriteSnapshots>false</overWriteSnapshots>
-
<overWriteIfNewer>true</overWriteIfNewer>
-
</configuration>
-
</execution>
-
</executions>
-
</plugin>
-
<plugin>
-
<groupId>org.apache.maven.plugins</groupId>
-
<artifactId>maven-jar-plugin</artifactId>
-
<configuration>
-
<archive>
-
<manifest>
-
<addClasspath>true</addClasspath>
-
<classpathPrefix>lib/</classpathPrefix>
-
<mainClass>com.sany.ecc.WkTimeCal</mainClass>
-
</manifest>
-
</archive>
-
</configuration>
-
</plugin>
-
</plugins>
-
</build>
-
-
<dependencies>
-
<!-- https://mvnrepository.com/artifact/org.elasticsearch/elasticsearch -->
-
<dependency>
-
<groupId>org.elasticsearch</groupId>
-
<artifactId>elasticsearch</artifactId>
-
<version>2.3.3</version>
-
</dependency>
-
-
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
-
<dependency>
-
<groupId>log4j</groupId>
-
<artifactId>log4j</artifactId>
-
<version>1.2.17</version>
-
</dependency>
-
-
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
-
<dependency>
-
<groupId>mysql</groupId>
-
<artifactId>mysql-connector-java</artifactId>
-
<version>5.1.6</version>
-
</dependency>
-
-
<dependency>
-
<groupId>org.apache.kafka</groupId>
-
<artifactId>kafka_2.10</artifactId>
-
<version>0.8.2.1</version>
-
</dependency>
-
</dependencies>
- </project>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31347383/viewspace-2122027/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用Maven打包你的應用——maven-jar-plugin & maven-assembly-plugin & maven-shade-pluginMavenJARPlugin
- Apache Maven Assembly Plugin 的介紹ApacheMavenPlugin
- Maven - Maven-dependency-plugin (goals "copy-dependencies","unpack") is not supportedMavenPluginGo
- 恕我直言!!!對於Maven,菜鳥玩dependency,神仙玩pluginMavenPlugin
- Maven - No plugin found for prefix 'war' in the current project and in the plugin groupsMavenPluginProject
- Maven那些非常有用的 PluginMavenPlugin
- 解決Maven外掛無法下載Cannot resolve plugin org.apache.maven.plugins:maven-clean-plugin:2.5MavenPluginApache
- Maven 教程(21)— maven-compiler-plugin 外掛詳解MavenCompilePlugin
- dockerfile-maven-plugin極簡教程DockerMavenPlugin
- SpringBoot專案使用maven-assembly-plugin根據不同環境打包成tar.gz或者zipSpring BootMavenPlugin
- Plugin 'org.apache.maven.plugins:maven-resources-plugin:2.7' not found less... (Ctrl+F1)問題解決PluginApacheMaven
- **spring-boot-maven-plugin:<unknown>**解決方法SpringbootMavenPlugin
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compileAIGoApacheMavenPluginCompile
- maven-compiler-plugin外掛引數配置詳解MavenCompilePlugin
- 使用Docker WildFly和wildfly-maven-plugin實現Java應用容器化DockerMavenPluginJava
- Apache Maven Assembly自定義打包外掛的使用ApacheMaven
- 解決Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile(default-compile)AIGoApacheMavenPluginCompile
- 基於jib-maven-plugin快速構建微服務docker映象MavenPlugin微服務Docker
- 利用classfinal-maven-plugin對jar進行加密,防止反編譯MavenPluginJAR加密編譯
- Maven中的dependency的scope作用域詳解Maven
- Go 1.8 的 plugin 使用GoPlugin
- 【Maven實戰技巧】「外掛使用專題」Maven-Assembly外掛實現自定義打包Maven
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default-cli)AIGoMavenPlugin
- ] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin Cannot instantiate object of typeAIGoMyBatisMavenPluginObject
- 聊聊如何修復springboot使maven-resources-plugin佔位符失效問題Spring BootMavenPlugin
- 使用maven-war-plugin動態載入處理環境變數,過濾打包檔案MavenPlugin變數
- Maven中dependency和plugins的繼承與約束MavenPlugin繼承
- jenkins中使用Config File Provider Plugin(Config File Provider)外掛靈活配置maven多settings.xml檔案JenkinsIDEPluginMavenXML
- Maven的使用Maven
- Maven Dependency Version:依賴版本自動升級Maven
- JQuery Plugin 2 - Passing Options into Your PluginjQueryPlugin
- Webpack的pluginWebPlugin
- 以MySQL為例,來看看maven-shade-plugin如何解決多版本驅動共存的問題?MySqlMavenPlugin
- Maven 使用Maven
- webpack(9)plugin外掛功能的使用WebPlugin
- vue 使用vite-plugin-svg-iconsVueVitePluginSVG
- 說說Loader和Plugin的區別?編寫Loader,Plugin的思路?Plugin
- 【Maven】Maven概述Maven
- 大白話講解Mybatis的plugin(Interceptor)的使用MyBatisPlugin