The goal you specified requires a project to execute but there is no POM in this directory

不要被公司局限自己的技术栈,还得抽时间提升自己!!!

最近在docker上搭建了nexus,实战jar上传下载过程中遇到的问题,记录一下(你也可能遇到的坑),下一篇介绍nexus搭建https://mp.csdn.net/console/editor/html/105124404

 

1、配置maven settings文件,添加nexus server

<servers>
		<server>
          <id>releases</id>
          <username>admin</username>
          <password>admin</password>
		</server>
		<server>
          <id>snapshots</id>
          <username>admin</username>
          <password>admin</password>
		</server>
		<server>
          <id>test</id>
          <username>admin</username>
          <password>admin</password>
		</server>
	</servers>

配置pom.xml

<distributionManagement>
        <repository>
            <id>releases</id>
            <name>Repository</name>
            <url>http://127.0.0.1:8081/repository/releases/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>Snapshot Repository</name>
            <url>http://127.0.0.1:8081/repository/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    <repositories>
        <!--local库配置-->
        <repository>
            <id>releases</id>
            <name>private maven release</name>
            <url>http://127.0.0.1:8081/repository/releases/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>snapshots</id>
            <name>private maven snapshot</name>
            <url>http://127.0.0.1:8081/repository/snapshots/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

编译成功后deploy

2、命令式

-DgroupId=jar包的组名

-DartifactId=jar包名称

-Dversion=jar包版本

-Dfile=jar包绝对路径

-DrepositoryId=仓库名称(releases)

cmd命令窗口执行(不需要pom,项目deploy才需要pom)

 

mvn deploy:deploy-file -DgroupId=com.asd -DartifactId=dom4j -Dversion=1.6.1 -Dpackaging=jar -DrepositoryId=releases -Dfile=D:/maven/Repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar -Durl=http://127.0.0.1:8081/repository/releases/

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值