Maven版本插件-tagbase配置-项目中包含的tags文件夹 [英] Maven release plugin - tagbase configuration - tags folder included in project

查看:744
本文介绍了Maven版本插件-tagbase配置-项目中包含的tags文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每发布一个新版本,我都会添加标签,最终导致这种结构:

With each new release I make the tags are included, which eventually leads to this structure:

...VersionExperimentation/tags/VersionExperimentation-0.0.7/tags/VersionExperimentation-0.0.6/tags/VersionExperimentation-0.0.5/tags/VersionExperimentation-0.0.4/tags/VersionExperimentation-0.0.3/tags/VersionExperimentation-0.0.2-beta/tags/VersionExperimentation-0.0.2-alpha/src/main/java

我的POM看起来像这样:

My POM looks like this:

    <scm>
    <developerConnection>scm:svn:https://[..root svn folder]/VersionExperimentation</developerConnection>
</scm>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <configuration>
                <tagBase>[..root svn folder]/VersionExperimentation/tags</tagBase>
            </configuration>
        </plugin>
    </plugins>
</build>

显然,标签应位于项目的根目录中,而不是位于developerConnection中定义的项目所在的VersionExperimentation文件夹中.

Obviously the tags should be in the root, not in VersionExperimentation folder, where the project is, which is defined in the developerConnection.

这里的最佳做法是什么?我们是否应该在SVN根目录下的某个文件夹内有一个项目,并且在同一路径下的标签位于项目文件夹所在的位置?

What is the best practice here? Should we have a project within some folder within the SVN root and tags in the same path, where the project folder is?

赞:

./projectFolder
./tagsFolder

DeveloperConnection将指向projectFolder,将发布tagbase标签配置为tagsFolder吗?

where DeveloperConnection is going to point to projectFolder and configuration of release tagbase tag to the tagsFolder?

这似乎遵循svn book推荐的存储库布局,可以在

This would seem to follow the recommended repository layout by svn book, which can be found here

$ svn list file:///var/svn/single-project-repo
trunk/
branches/
tags/

如果是,如果有项目,该怎么办?不幸的是,这些项目却立即将项目存储在根文件夹中?

If yes, what should we do, if we have projects, which, unfortunately store the project immediately in the root folder?

我们应该创建文件夹,将数据移动到正确的位置并适当配置pom,以将标签存储在tags文件夹中并提交到trunk/projectFolder吗?

Should we create the folders, move the data to the right place and configure the pom appropriately, to store the tags in tags folder and to commit to the trunk/projectFolder?

推荐答案

您应遵循最佳做法,因为它们并非毫无用处,称为best practice.我建议做这样的事情:

You should follow the best practices, cause they are not for nothing called best practice. I would suggest to have things like:

 repository-root
    +-- project1
    +-- project2
    +-- project3

如果需要,您可以在存储库的根目录级别上向项目(组织资料等)插入补充文件夹,但在每个项目中,我建议遵循Subversion的TTB结构,这意味着要拥有每个项目:

On the root level in your repository you can insert supplemental folder to your project (organization stuff etc.) if you need but within every project i would recommend to follow the TTB structure of subversion which means having each project:

  +-- project1
       +--- trunk
       +--- tags
       +--- branchs

这将因此消除了在Maven中进行配置的需要(配置约定).

which in consequence will remove the need of configuration in Maven (Convention over configuration).

除了上述建议之外,不建议将单个项目存储在单个存储库中,因为在Subversion中,与运行不同的Git相矛盾,它不是必需的. 因此,在Subversion中,在单个Subversion存储库中存储数百或数千个项目完全没有问题...

Apart from the above storing a single project in a single repository is not recommend cause in Subversion it is not neccesary in contradiction to Git where the things are running different. So in Subversion there is no problem at all storing hundreds or thousands of projects within a single Subversion repository...

另一方面,如果您有充分的理由不采用默认值,则应详细说明为什么需要采用不同的方法.

On the other hand if you have a really good reason not to go with the defaults you should explain in detail why you need to go different paths.

这篇关于Maven版本插件-tagbase配置-项目中包含的tags文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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