码迷,mamicode.com
首页 > 系统相关 > 详细

eclipse中maven打包

时间:2018-02-26 17:36:33      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:exe   depend   文件   control   pen   execution   conf   eclips   方式   

第一种方式:将依赖包打包进一个jar包中。

  <build>
      <plugins>
          <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                  <source>1.7</source>
                  <target>1.7</target>
                  <encoding>${project.build.sourceEncoding}</encoding>   
              </configuration>
          </plugin>
          <plugin>  
            <artifactId>maven-assembly-plugin</artifactId>  
            <configuration>  
              <descriptorRefs>  
                <descriptorRef>jar-with-dependencies</descriptorRef>  
              </descriptorRefs>  
              <archive>    
                <manifest>    
                    <mainClass>com.xx.kafka.GWProducer</mainClass>  
                </manifest>  
            </archive>  
        </configuration>  
        <executions>  
          <execution>  
            <id>make-assembly</id> <!-- this is used for inheritance merges -->  
            <phase>package</phase> <!-- bind to the packaging phase -->  
            <goals>  
              <goal>single</goal>  
            </goals>  
          </execution>  
        </executions>  
       </plugin>  
      </plugins>
  </build>

第二种方式: 将依赖包单独放到lib文件夹中

 

 

eclipse中maven打包

标签:exe   depend   文件   control   pen   execution   conf   eclips   方式   

原文地址:https://www.cnblogs.com/30go/p/8473952.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!