maven工程如何引入私有仓库jar包 |
您所在的位置:网站首页 › 如何在maven仓库里添加新的jar包 › maven工程如何引入私有仓库jar包 |
Maven工程引入私有仓库jar包的步骤如下: 1、首先要确定私有仓库jar包的地址,可以是本地仓库,也可以是远程仓库,例如maven中央仓库,nexus私有仓库等; 2、在maven工程的pom.xml文件中添加repository标签,指定私有仓库的地址,例如: nexus-snapshots Nexus Snapshots http://localhost:8081/nexus/content/repositories/snapshots3、在maven工程的pom.xml文件中添加dependency标签,指定要引入的jar包,例如: com.example example-jar 1.0.04、在命令行中输入mvn install命令,安装jar包到本地仓库中; 5、在命令行中输入mvn deploy命令,将jar包上传到私有仓库中; 6、在maven工程的pom.xml文件中添加dependency标签,指定要引入的jar包,例如: com.example example-jar 1.0.0 system ${project.basedir}/lib/example-jar-1.0.0.jar7、在maven工程的pom.xml文件中添加distributionManagement标签,指定私有仓库的地址,例如: nexus-snapshots Nexus Snapshots http://localhost:8081/nexus/content/repositories/snapshots8、在命令行中输入mvn deploy命令,将jar包上传到私有仓库中; 9、在maven工程的pom.xml文件中添加dependency标签,指定要引入的jar包,例如: com.example example-jar 1.0.010、在命令行中输入mvn install命令,从私有仓库中安装jar包到本地仓库中。 通过以上步骤,就可以将私有仓库中的jar包引入到maven工程中,从而实现jar包的管理和依赖。 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |