一.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>

打Jar包

二.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文件中正常添加依赖即可

相关文章:

  • 2021-07-03
  • 2021-06-30
  • 2022-01-29
  • 2021-12-25
  • 2022-12-23
  • 2021-11-28
猜你喜欢
  • 2021-09-27
  • 2021-04-13
  • 2021-09-24
  • 2022-12-23
  • 2022-01-05
  • 2021-06-20
  • 2021-06-30
相关资源
相似解决方案