简体   繁体   English

更改gitlab CI的根目录

[英]Change root directory for gitlab CI

I want to implement Gitlab CI on my repository. 我想在我的存储库上实现Gitlab CI。 I have already set up the runner on Windows and configure the .yml to work with a Maven project. 我已经在Windows上设置了跑步者并配置.yml以使用Maven项目。 The problem is that I have the folders Domain and Front-end in the root of the repository. 问题是我在存储库的根目录中有DomainFront-end文件夹。 Is there a way to change the root so the .yml could be able to find the pom.XML file which is in the domain folder? 有没有办法更改根目录,以便.yml能够找到域文件夹中的pom.XML文件?

When I run it, it says that it couldn't find the pom files. 当我运行它时,它说它无法找到pom文件。

[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/builds/motomine/web). [错误]您指定的目标需要执行项目,但此目录中没有POM(/ builds / motomine / web)。 Please verify you invoked Maven from the correct directory. 请验证您是否从正确的目录中调用了Maven。

So I think changing the root folder might solve the problem. 所以我认为更改根文件夹可能会解决问题。

You don't necessarily need to change the directory. 您不一定需要更改目录。 You can point maven to the directory which contains the pom. 您可以将maven指向包含pom的目​​录。 In your .yml file: .yml文件中:

...
- mvn -f Domain

From the maven documentation: 从maven文档:

-f,--file : Force the use of an alternate POM file (or directory with pom.xml) -f, - file:强制使用备用POM文件(或带有pom.xml的目录)

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

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