无标题文章

## 本地maven的setting.xml文件中servers节点中加入

``` xmlreleasesadminadmin123snapshotsadminadmin123``` 

## 本地maven的setting.xml文件中profiles节点中加入repository

``` xmlnexusProfilenexusprivate nexushttp://xx.xx.xx.xx:8081/nexus/content/groups/public/truetrue``` ## Idea配置

mavenSetting->Maven,配置maven的主目录,配置文件地址以及本地repository地址## 在Idea配置maven命令并执行``` bash-X deploy:deploy-file -DgroupId=com.monitor -DartifactId=sdk -Dversion=0.0.3-SNAPSHOT -Dpackaging=jar -Dfile=./target/sdk-0.0.3-SNAPSHOT.jar -Durl=http://xx.xx.xx.xx:8081/nexus/content/repositories/snapshots -DrepositoryId=snapshots``` ## 常见问题### 发布时出现400错误- 出错异常``` bashCaused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://xxx.xxx.xxx.xxx:8081/nexus/content/repositories/releases/com/wm/open-falcon-client/1.0/open-falcon-client-1.0.jar. Return code is: 400, ReasonPhrase: Bad Request.``` - 原因> 已存在的包的时候出现400错误> release 默认库是不允许重复部署的- 解决方法> 在仓库管理界面中,选择Repositories->选择相应Reposity->选择Configuration->修改Deployment Policy为Allow Redeploy

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • ## 新建项目 >新建一个maven quickstart项目: ![image](https://raw.git...
    yyplocalhost阅读 313评论 0 0
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 137,172评论 19 139
  • Maven编译代码的相关命令 第一、main目录下的主代码编写完毕后,使用Maven进行编译,在项目根目录下运行命...
    加油小杜阅读 1,465评论 0 2
  • spring官方文档:http://docs.spring.io/spring/docs/current/spri...
    牛马风情阅读 1,875评论 0 3
  • jHipster - 微服务搭建 CC_简书[https://www.jianshu.com/u/be0d56c4...
    quanjj阅读 958评论 0 2

友情链接更多精彩内容