zoukankan      html  css  js  c++  java
  • 《eclipse maven项目打包成jar包》

    1.pom.xml文件

    <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.boye.bigdata</groupId>
    <artifactId>hbase</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>hbase</name>
    <url>http://maven.apache.org</url>

    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>


    <dependencies>

    <dependency>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase-server</artifactId>
    <version>1.3.1</version>
    </dependency>

    <dependency>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase-client</artifactId>
    <version>1.3.1</version>
    </dependency>


    </dependencies>

    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
    <!--这部分可有可无,加上的话则直接生成可运行jar包-->
    <!--<archive>-->
    <!--<manifest>-->
    <!--<mainClass>${exec.mainClass}</mainClass>-->
    <!--</manifest>-->
    <!--</archive>-->
    <descriptorRefs>
    <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
    </configuration>
    </plugin>
    </plugins>
    </build>
    </project>

    2.运行打包

    在项目上,右键单击 Run As ——》Maven build

    输入:assembly:assembly

     

  • 相关阅读:
    关于等价类测试的简单实践 20150322
    对软件测试的理解 20150314
    pthread_wrap.h
    libuv 错误号UV_ECANCELED 的处理
    简单的后台日志组件
    Windows NTService 后台框架封装
    检查程序进程是否存在/强制杀掉程序进程
    析构函数结束线程测试
    移动天线
    猜数字游戏的Java小程序
  • 原文地址:https://www.cnblogs.com/boye169/p/13401517.html
Copyright © 2011-2022 走看看