Maven 3.0的"mvn版本:执行"不喜欢不在其git repo的根目录中的pom.xml [英] Maven 3.0's "mvn release:perform" doesn't like a pom.xml that isn't in its git repo's root directory
本文介绍了Maven 3.0的"mvn版本:执行"不喜欢不在其git repo的根目录中的pom.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对Maven,maven-release-plugin,git集成,pom.xml以及在存储库本地副本的子目录中而不是在根目录中具有pom.xml存有疑问.
I have a question about Maven, the maven-release-plugin, git integration, pom.xml's, and having pom.xml's in subdirectories of the repo's local copy rather than in the root.
这是设置:
- 我的github帐户的私有存储库数量有限
- 我想(只是学习)使用Maven来组织我的构建/发行版
- 我可能需要创建多个Maven项目",每个git存储库都创建多个项目
- 每个maven项目都需要一个"pom.xml"来定义其特征
- 我不能或至少不方便将所有项目pom.xml文件放在git信息库的根目录中
- 因此,我最终得到了项目的以下文件夹布局:
- git_repo_root_dir
- project_A 文件夹
- pom.xml
- other_code
- I have a github account with a limited number of private repositories
- I want to (am just learning to) use Maven to organize my builds/releases
- I might need to create many Maven "projects", several projects per git repository
- Each maven project requires a "pom.xml" to define its characteristics
- I can't, or at least it's not convenient to, put all project pom.xml files in the root of the git repository
- So I end up with this folder layout for projects:
- git_repo_root_dir
- project_A folder
- pom.xml
- other_code
- pom.xml
- other_code
- 问题似乎是,已将git标记的代码成功签出到git_repo_root_dir/project_A/target/checkout/project_A,以准备发布版本,但是在签出之后,"maven-release"插件将转到目录git_repo_root_dir/project_A/target/checkout/.而不是git_repo_root_dir/project_A/target/checkout/project_A/.进行实际的构建,并且在尝试弄乱pom.xml之前,没有办法告诉"maven-release"插件进入源代码的特殊标记副本的子目录中.
这是我在此过程中遇到的实际错误:
Here's the actual error I get during this process:
[INFO] --- maven-release-plugin:2.0:perform (default-cli) @ standard_parent_project --- [INFO] Checking out the project to perform the release ... [INFO] Executing: /bin/sh -c cd "/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target" && git clone git@github.com:clarafaction/0maven.git '/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target/checkout' ... /* note, the pom.xml the build should go out of at this point is at '/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target/checkout/standard_parent_project/pom.xml' */ ... [INFO] [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target/checkout). Please verify you invoked Maven from the correct directory. -> [Help 1]
谢谢.
推荐答案
这应该可以解决问题:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.3.2</version> <executions> <execution> <id>default</id> <goals> <goal>perform</goal> </goals> <configuration> <pomFileName>your_path/your_pom.xml</pomFileName> </configuration> </execution> </executions> </plugin>
这篇关于Maven 3.0的"mvn版本:执行"不喜欢不在其git repo的根目录中的pom.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- project_A folder
- git_repo_root_dir
- project_A 文件夹
- git_repo_root_dir
查看全文