zoukankan      html  css  js  c++  java
  • 打Jar包

    一.Idea打Jar包带上依赖

    修改pom.xml文件,添加插件,使用assembly里面的assembly打包即可
    
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>com.hbase2Redis.Hbase2Redis</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        </build>
    

    二.maven 如何将自己的jar包添加到本地仓库

    1.准备好一个jar包

    2.通过命令行安装jar包

    mvn install:install-file -Dfile=jar包的位置(参数一) -DgroupId=groupId(参数二) -DartifactId=artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar
    
    例:
    mvn install:install-file -Dfile="E:mail.jar" -DgroupId=shop.mail -DartifactId=mail -Dversion=1.0 -Dpackaging=jar
    

    3.在pom.xml文件中正常添加依赖即可

  • 相关阅读:
    第十四周作业
    十二
    第十一周作业
    第十周作业
    第八周作业
    第七周
    软件工程作业2
    自我介绍
    2019春总结作业
    2019春第一次课程设计实验报告
  • 原文地址:https://www.cnblogs.com/INnoVationv2/p/14968788.html
Copyright © 2011-2022 走看看