标签: maven-scm-plugin

mvn release:执行失败,因为pom文件不在存储库的根目录下

我正在尝试执行mvn release:perform,但该命令假定pom文件位于存储库的根目录.是否有我可以设置的系统属性或首选项来覆盖默认值?

调用mvn release:prepare似乎已成功,因为所有发布工件都位于目标目录中,并且存储库已正确标记.

如果重要,这是一个git项目.


编辑这是我做的:

cd /path/to/git/root/path/to/mvn/project
mvn -DdevelopmentVersion=1.2.0-SNAPSHOT -DreleaseVersion=1.1.0 release:prepare
...enter correct passphrase and choose all default options...
mvn release:perform
Run Code Online (Sandbox Code Playgroud)

然后克隆target/checkout目录中的远程仓库,并在一些搅拌并推送到远程git仓库后,发生以下错误:

[ERROR]   
[ERROR]   The project  (/path/to/git/root/path/to/mvn/project/target/checkout/pom.xml) has 1 error
[ERROR]     Non-readable POM /path/to/git/root/path/to/mvn/project/target/checkout/pom.xml: /path/to/git/root/path/to/mvn/project/target/checkout/pom.xml (No such file or directory)
Run Code Online (Sandbox Code Playgroud)

因此,maven正在target/checkout目录的根目录中寻找pom文件,而不是它所在的位置.

maven maven-release-plugin maven-scm-plugin

7
推荐指数
2
解决办法
5426
查看次数

将Perforce scm配置为maven项目以获取最新的更改列表

我正在将项目迁移到Maven,因为我们习惯于通过Perforce SCM存储库中的最新更改编号引用我们的构建,我希望能够提取此信息

我试图通过以下资源配置Maven scm插件:

首先,我不明白如何使它工作,所以如果有人有一个完整的例子,我会很高兴,在我这边我尝试添加我的pom:

<scm>
    <connection>
        scm:perforce:localhost:1666://depot/
        <my_project>
            /
            <version>
    </connection>
    <developerConnection>
        scm:perforce:localhost:1666:/depot/
        <my_project>
            /
            <version>
    </developerConnection>
    <url>http://somerepository.com/view.cvs</url>
</scm>
...
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-plugin</artifactId>
        <version>1.6</version>
        <dependencies>
            <!-- P4Maven -->
            <dependency>
                <groupId>com.perforce</groupId>
                <artifactId>p4maven</artifactId>
                <version>[2011,2012)</version>
            </dependency>
        </dependencies>
        <configuration>
            <connectionType>//depot/proto/kernel/kernel/04.00/maven2</connectionType>
            <username>my local username</username>
            <password>xxxxxx</password>
            <includes>**</includes>
        </configuration>
    </plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)

这导致我:

[INFO] --- maven-scm-plugin:1.6:checkout (default-cli) @ kernel ---
mars 27, 2012 9:54:08 AM org.sonatype.guice.bean.reflect.Logs$JULSink warn
Avertissement: Error injecting: org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider
java.lang.NoClassDefFoundError: org/apache/maven/scm/command/info/InfoScmResult
Run Code Online (Sandbox Code Playgroud)

肯定忘了什么,我会再次阅读说明,看看我想念的,但是如果有人知道的话......

无论如何,我的问题是:是否值得尝试?我没有在scm插件的可用操作中看到任何可以帮助我获取最后更改信息并将其集成到引用构建号中的内容.我应该为此开发自己的插件吗?

提前致谢.

perforce maven maven-scm-plugin

6
推荐指数
1
解决办法
4535
查看次数

When using maven-release-plugin, why not just detect scm info from local repo?

As far as I am aware, in order to use the maven-release-plugin, you have to drop in an scm section into your POM file. E.g.:

<scm>
    <connection>scm:hg:ssh://hg@bitbucket.org/my_account/my_project</connection>
    <developerConnection>scm:hg:ssh://hg@bitbucket.org/my_account/my_project</developerConnection>
    <url>ssh://hg@bitbucket.org/my_account/my_project</url>
    <tag>HEAD</tag>
</scm>
Run Code Online (Sandbox Code Playgroud)

I understand this data is used to determine what to tag and where to push changes. But isn't this information already available if you have the code cloned/checked-out? I'm struggling a bit with the concept that I need to tell maven what code it needs to tag when it …

maven maven-release-plugin maven-scm-plugin

5
推荐指数
1
解决办法
1335
查看次数