maven发布插件,git,而且pom不在顶部 [英] maven release plugin, git, and the pom's not at the top

查看:128
本文介绍了maven发布插件,git,而且pom不在顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个git repo,顶层目录中有三个目录:java,COM和csharp。正如你可能猜到的那样,pom.xml存在于java目录中。



一切都很好,直到我运行release插件。它将整个repo克隆到目标/结帐中,然后期望pom在顶部。事实并非如此。结束的故事。



我可以告诉release插件关于额外的目录,还是我必须拆分repro?



   <插件> 
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-release-plugin< / artifactId>
< version> 2.2.1< / version>
<执行次数>
<执行>
< id>预设< / id>
<目标>
< goal>执行< / goal>
< /目标>
<配置>
< pomFileName> subdir / pom.xml< / pomFileName>
< / configuration>
< /执行>
< /执行次数>
< / plugin>

其中subdir是pom.xml所在目录的相对路径。



至少在Maven 3.0.3中这是有效的。可以使用不同的发布插件版本,但这是未经测试。



这适用于Maven 3.0.4和Maven-release-plugin 2.5和git 1.8.x。 p>

I've got a git repo where the top level directory has three directories in it: java, COM, and csharp. As you might guess, the pom.xml lives in the java directory.

All is well until I go to run the release plugin. It clones the entire repo into target/checkout, and then expects the pom to be right there at the top. It ain't. End of story.

Can I tell the release plugin about the extra directory, or do I have to split the repro?

解决方案

Tested: add the following to your build/plugins section:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.2.1</version>
    <executions>
        <execution>
            <id>default</id>
            <goals>
                <goal>perform</goal>
            </goals>
            <configuration>
                <pomFileName>subdir/pom.xml</pomFileName>
            </configuration>
        </execution>
    </executions>
</plugin>

Where "subdir" is the relative path to the directory where the pom.xml resides.

This works, at least with Maven 3.0.3. May work with different release plugin versions, but this is untested.

This works with Maven 3.0.4 and maven-release-plugin 2.5 and git 1.8.x.

这篇关于maven发布插件,git,而且pom不在顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆