maven 上传项目或者jar到私服

首先到私服管理页面在配置中允许redeploy,maven 上传jar需要在某一个项目下,执行以下命令:

mvn deploy:deploy-file -DgroupId=com.need.http -DartifactId=need-http -Dversion=0.1.0 -Dpackaging=jar -Dfile=/Users/shenyb/Downloads/http.jar  Downloads -DrepositoryId=maven-repository-inner -Durl=http://ip:port/nexus/content/repositories/thirdparty/

需要配置信息为:
.settings文件,可以喂maven安装目录,也可以是当前用户.m2下,一个是全局,一个是当前用户配置

  <server>
       <id>thirdparty</id>
       <username>admin</username>
       <password>admin123</password>
    <filePermissions>664</filePermissions>
        <directoryPermissions>775</directoryPermissions>
    </server>

如果要depoly某一个项目:
可以直接在项目下执行mvn deploy。
maven的jetty插件运行配置:

<!-- 添加此插件以便启动jetty -->  
<plugin>  
    <groupId>org.mortbay.jetty</groupId>  
    <artifactId>maven-jetty-plugin</artifactId>  
    <version>6.1.10</version>  
    <configuration>  
        <encoding>UTF-8</encoding>  
        <scanIntervalSeconds>10</scanIntervalSeconds>  
        <stopKey>foo</stopKey>  
        <stopPort>9999</stopPort>  
    </configuration>  
    <executions>  
        <execution>  
            <id>start-jetty</id>  
            <phase>pre-integration-test</phase>  
            <goals>  
                <goal>run</goal>  
            </goals>  
            <configuration>  
                <scanIntervalSeconds>0</scanIntervalSeconds>  
                <daemon>true</daemon>  
            </configuration>  
        </execution>  
        <execution>  
            <id>stop-jetty</id>  
            <phase>post-integration-test</phase>  
            <goals>  
                <goal>stop</goal>  
            </goals>  
        </execution>  
    </executions>  
</plugin>  

启动时可以制定端口:
mvn -Djetty.port=9999 jetty:run

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱美事爱生活

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值