Maven:从 TeamCity 运行时从 SVN 获取父项目

发布于 2024-08-20 23:55:01 字数 297 浏览 6 评论 0原文

我有 3 个兄弟项目,它们有一个共同的父项目,我使用 Maven 进行管理。这些项目共享同一个父项目,且父项目向上一级。父 POM 不了解任何子项,它只包含样板文件、存储库定义和通用插件。一切正常,直到我尝试将其放在 TeamCity 上。下面是我现在的做法:为

  1. 每个分支创建一个配置,
  2. 基于签入,彼此独立地触发

,现在问题来了:因为我有一个比项目高一级的父 POM,所以当签出子代码时,它不会被拉出,并且构建很快就会失败。我想我可以创建另一个构建配置来拉取父级(POM 类型),但是我缺少更好的方法吗?

I have 3 sibling projects that have a common parent that I'm managing with Maven. The projects share same parent which is one level up. The parent POM has no knowledge of any of the children it simply contains boilerplate, repo definitions and common plugins. Everything works fine until I try to put this on TeamCity. Here's how I do it now

  1. Create one configuration per branch
  2. Trigger independently of each other based on check-ins

And now comes the problem: since I have a parent POM one level above the project it's not getting pulled when the child code is checked out and the build quickly fails. I suppose I can create another build configuration just to pull the parent (which is of type POM) but is there a better way that I'm missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫罗兰の梦幻 2024-08-27 23:55:01

所以我继续创建父配置。唯一的问题是:我必须创建另一个文件夹并将父 POM 移入其中,否则 SVN 将提取所有嵌套文件夹而不是单个 POM(签出规则效果不太好)。现在我有 4 个同一级别的项目,其中一个仅包含一个父 POM。在我运行父级的 mvn install 后,一切正常,因为其他项目现在将从本地存储库中提取配置。

任何人都可以提供更好的方法 - 我将不胜感激

So I went ahead and created parent configuration. The only catch is: I had to create another folder and move parent POM into it otherwise SVN would pull all the nested folder instead of single POM (checkout rules didn't work too well). So now I have 4 projects on the same level and one of these simply hold a parent POM. After I run parent's mvn install once everything works since other projects now would pull configuration from the local repo.

Anyone can provide a better way - I'll greatly appreciate it

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文