1. 程式人生 > >maven 打包 依賴

maven 打包 依賴

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.longshine</groupId>
  <artifactId>kettle_shell</artifactId>
  <version>1.0-SNAPSHOT</version>

  <name>kettle_shell</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <kettle-version>8.0.0.0-28</kettle-version>
  </properties>
  <!-- with pentaho-kettle -->
  <dependencies>
    <dependency>
      <groupId>pentaho-kettle</groupId>
      <artifactId>kettle-core</artifactId>
      <version>${kettle-version}</version>
    </dependency>
    <dependency>
      <groupId>pentaho-kettle</groupId>
      <artifactId>kettle-engine</artifactId>
      <version>${kettle-version}</version>
    </dependency>
    <dependency>
      <groupId>pentaho-kettle</groupId>
      <artifactId>kettle-dbdialog</artifactId>
      <version>${kettle-version}</version>
    </dependency>
    <!-- 匯入Mysql資料庫連結jar包 -->
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.30</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.21</version>
      <scope>provided</scope>
    </dependency>


  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <!-- put your configurations here -->
        </configuration>
      </plugin>
      <!--無依賴包-->
     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <classpathPrefix>lib</classpathPrefix>
              <mainClass>com.longshine.main.RunJob</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <!--依賴包放在lib檔案-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy</id>
            <phase>package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>
                ${project.build.directory}/lib
              </outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!--全量包,所有class打在一個包-->
  <!--    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <archive>
            <manifest>
              <mainClass>com.longshine.main.RunJob</mainClass>
            </manifest>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>-->

    </plugins>
  </build>
</project>

方法如註釋所示

相關推薦

maven 打包 依賴

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLS

maven打包依賴第三方包,但不打進jar包中

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://m

maven 打包依賴專案

專案util , xfw,其中,util是工具類庫,xfw是web專案,xfw依賴util util的pom.xml檔案: <groupId>com.jiapeng</groupId> <artifactId&

maven對java專案打包,如何通過maven打包依賴jar,打包主類,在pom.xml中設定

設定位置 <build> <plugins> 在此處新增 </plugins> </build> mav

maven打包uber jar(包含依賴)

log java mvn pom.xml文件 註釋 bsp blog .cn 進行 0 概述 工作中遇到了需要將一個工程打包為一個jar包的情形,參考了如下文檔將方案整理於此。 參考: http://maven.apache.org/plugins/maven-shade-

maven常用外掛: 打包原始碼 / 跳過測試 / 單獨打包依賴

maven常用外掛: 打包原始碼 / 跳過測試 / 單獨打包依賴項 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-

maven工程依賴配置 (將功能模組打包為獨立jar,使用maven進行管理)

第一步:建立maven工程 (eclipse) 1): 2) 3)  4) 拓展公共模組pom檔案如下: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="htt

Spring-boot構建多模組依賴工程時,maven打包異常:程式包xxx不存在

在qizhi專案改版的時候, 所有程式碼都遷移好了, 但是compile的時候報程式包*****不存在, 具體到某一個類就是: 找不到符號. 下面這篇文章是正解 http://hbxflihua.iteye.com/blog/2431537 具體內容如下: =======================

Spring-boot構建多模塊依賴工程時,maven打包異常:程序包xxx不存在

core 核心 === 指定 apach 模塊 spring plugin fig 在qizhi項目改版的時候, 所有代碼都遷移好了, 但是compile的時候報程序包*****不存在, 具體到某一個類就是: 找不到符號. 下面這篇文章是正解 http://hbxflihu

spark專案藉助maven-shade-plugin外掛打包依賴

maven配置 maven配置 <profiles> <profile> <id>spark-c

頹廢的悠然 maven打包成第三方jar包且把pom依賴包打入進來

頹廢的悠然 maven打包成第三方jar包且把pom依賴包打入進來 <build> <plugins> <plugin> <ar

maven打包 把要的依賴也打進去 配置

<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifact

maven依賴jar包打包

meet the same problem, I solved it by build the jar with dependencies. add the code below to pom.xml <build> <sourceDirectory>src/main/j

利用MAVEN打包可執行jar包,包括依賴的第三方包

看下專案pom.xml的配置,首先要配置maven-jar-plugin,把自己的程式碼編譯打包成jar檔案,然後配置maven-assembly-plugin,把整個專案打包成一個釋出包。 Xml程式碼  收藏程式碼 <build>       <pl

springboot中Maven打包依賴的jar分開

   我們在用springboot開發時,時常會遇到這種問題,當我們對程式做了一個小改動時,如果要將改動後的程式釋出到生產環境,則需要將整個程式重新打包,然後將打完的包釋出到生產環境上,這樣有個問題,如

Maven打包依賴war包/Zip包 並解壓至指定目錄的pom配置

首先配置依賴,引入需要依賴的war包和zip包: <dependency> <groupId>com.huawei.mateinfo</groupId> <artifactId>kewen-common-w

springboot工程maven打包時,如果有依賴工程總是報找不到,解決辦法

引用原文: 原文地址   最近公司使用springboot開發專案,使用的構建工具是maven,專案分了很多模組,並且模組之間還存在一定的依賴,比如說一個專案common是提供各專案通用的工具類,公共的類等例子:專案root,有module common,front,mall

maven打包的時候將依賴的jar包也打進去

最近在改造底層一個utils專案的時候,再將lib工程轉maven專案後,打包丟了相關依賴;之前lib工程的時候是需要藉助第三方fatjar的,現在轉maven後相關依賴全部丟失;基於當前工程已經被很多專案引用,這裡謀求一個新的出路,希望用maven外掛也能將相關依賴打包進去

maven打包成jar, 包括依賴其他的jar

   maven打包的時候不會自動把依賴的專案打成jar放在專案中,如果需把管理的jar放在target/lib目錄下,可以在pom.xml新增: <plugin> <groupId>org.apache.maven.

maven模組依賴,正常執行,打包報錯找不到包

1.maven構建了2個模組專案,。能正常執行不報錯。 2.打包的時候時候卻報找不到類 。檢查pom中相關的模組依賴新增沒有問題,這麼個小問題折騰了我大半天。[ERROR] Failed to execute goal org.apache.maven.plugins:m