简体   繁体   English

从自定义的 nexus 存储库制作 Maven 项目

[英]Make maven project from custom nexus repositories

I made my custom nexus repository on remote, and I've already made a custom archetype and deploy it to the repository.我在远程创建了自定义的 nexus 存储库,并且已经创建了一个自定义原型并将其部署到存储库。

Actually, Now I want to make maven project from the archetype which is on that custom nexus repository.实际上,现在我想从该自定义 nexus 存储库上的原型制作 maven 项目。

I've set the remote repository info in .m2/settings.xml.我已经在 .m2/settings.xml 中设置了远程存储库信息。 and I tried "mvn archetype:generate" .我试过 "mvn archetype:generate" 。 But I cannot see my custom archetype in the archetype catalog list.但是我在原型目录列表中看不到我的自定义原型。

If I try -D option ( mvn archetype:generate -DremoteRepositories= http://xxx.xxx.xxx.xxx/nexus/content/releases/ ), I can see the archetype that I made.如果我尝试 -D 选项( mvn archetype:generate -DremoteRepositories= http://xxx.xxx.xxx.xxx/nexus/content/releases/ ),我可以看到我制作的原型。

Is there another way to make maven project from custom remote repositories?有没有另一种方法可以从自定义远程存储库制作 maven 项目?

One more Question, about the url, if I try " http://xxx.xxx.xxx.xxx/nexus/ , the archetype-list can't be found. do I have to inform the exact location where archetype-catalog.xml exists? Actually I want to make several archetypes and inform the location of custom repository to my team members to use the archetype that they want case by case.还有一个问题,关于url,如果我尝试“ http://xxx.xxx.xxx.xxx/nexus/ ,找不到原型列表。我是否必须告知原型目录的确切位置。 xml 存在吗?实际上我想制作几个原型并将自定义存储库的位置通知我的团队成员,以便逐个使用他们想要的原型。

Looking forward to answers.期待答案。 Thank you.谢谢你。

I've looked all around book and found it.我环顾四周,找到了这本书。

Actually, I made a mistake on settings.xml file实际上,我在 settings.xml 文件上犯了一个错误

First I put the tag for my custom remote repository.首先,我为我的自定义远程存储库添加了标签。 in the mirror tag, there is a mirrorOf attribute.在 mirror 标签中,有一个 mirrorOf 属性。 I have to set mirrorOf tag as "*".我必须将 mirrorOf 标签设置为“*”。 ( it means all request should be applied to this mirror tag ) (这意味着所有请求都应应用于此镜像标签)

Second.第二。 I've missed the url.我错过了网址。 http://xxx.xxx.xxx.xxx/nexus/content/releases/ ==> it was wrong. http://xxx.xxx.xxx.xxx/nexus/content/releases/ ==> 这是错误的。 http://xxx.xxx.xxx.xxx/nexus/content/groups/public ==> this is the right url http://xxx.xxx.xxx.xxx/nexus/content/groups/public ==> 这是正确的网址

I posted my question and answer by myself.我自己发布了我的问题和答案。 someone refer to this.有人参考这个。

Thanks.谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM