Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
626 views
in Technique[技术] by (71.8m points)

maven release plugin, git, and the pom's not at the top

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...