【问题标题】:Maven2 release plugin doens't want to tagMaven 发布插件不想标记
【发布时间】:2011-05-02 08:54:36
【问题描述】:

我们有一个多模块项目,我想在其上使用发布插件。

subversion 中的设置是

 /svn/repo/project
 -- branches
 -- tags
 -- trunk
 -- -- project
 -- -- pom.xml
 -- -- module1
 -- -- -- pom.xml
 -- -- module2
 -- -- -- pom.xml
 -- -- module3
 -- -- -- pom.xml
 -- -- module4
 -- -- -- pom.xml

该项目已从主干中签出,因此在我的文件系统上我没有任何标签或分支文件夹。当我使用命令:mvn release:prepare,我得到错误:

[INFO] ------------------------------------------------------------------------
 [ERROR] BUILD FAILURE
 [INFO] ------------------------------------------------------------------------
 [INFO] Unable to tag SCM
 Provider message:
 The svn tag command failed.
 Command output:
 svn: Commit failed (details follow):
 svn: File '/svn/repo/project/tags/project-1.0/module1/pom.xml' already exists

当我在调试模式下运行命令时,我确实得到以下信息:

[DEBUG] WARNING: A dependency of the current project (or of one the plugins used 
 in its build) was found in the reactor,
 but had not been built at the time it was requested. It will be resolved from 
 the repository instead.

 Current Project: module2
 Requested Dependency: com.mycompany:module2:jar:1.0

 NOTE: You may need to run this build to the 'compile' lifecycle phase, 
 or farther, in order to build the dependency artifact.

当然,svn中不存在该标签。

有人有什么想法吗?

【问题讨论】:

    标签: svn maven-2 maven-release-plugin


    【解决方案1】:

    通过如下设置插件解决了这个问题。默认设置显然不好。

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
            <version>1.0-beta-4</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>create</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <doCheck>false</doCheck>
                <doUpdate>false</doUpdate>
            </configuration>
    </plugin>
    

    【讨论】:

      猜你喜欢
      • 2017-06-04
      • 1970-01-01
      • 1970-01-01
      • 2020-05-07
      • 1970-01-01
      • 2014-07-09
      • 2014-09-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多