我在hudson上使用maven release插件,并将autoVersionSubmodules设置为true以自动增加poms中的开发版本.
我想知道是否有办法让插件增加主要版本而不是次要版本.
目前,当我在版本1.1.0-snapshot时,下一个版本被设置为1.1.1-snapshot,但理想情况下我希望它更改为1.2.0-snapshot.
有关如何实现这一点的任何想法?
谢谢.
我正在使用preparationGoalsMaven发布插件的配置选项来转换其他文件以反映正在发布的项目的版本.这很好用.
问题是,在执行提交时,插件显式指定只pom.xml应包含文件,从而使我的其他文件不受控制:
[INFO] Executing: /bin/sh -c cd /Users/jw/dev/Test && git commit --verbose -F /var/folders/w0/hr1h_7h50f3_pwd_nrk9l808000195/T/maven-scm-114713951.commit pom.xml library/pom.xml sample/pom.xml
有没有办法让我覆盖这种行为并指定要包含在提交中的其他文件或整数?
(我也需要这个行为completionGoals,我已配置为执行相同的转换)
我有一个关于Maven,maven-release-plugin,git integration,pom.xml的问题,并且在repo的本地副本的子目录中而不是在根目录中有pom.xml.
这是设置:
这是我在此过程中遇到的实际错误:
[INFO] --- maven-release-plugin:2.0:perform (default-cli) @ standard_parent_project ---
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd "/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target" && git clone git@github.com:clarafaction/0maven.git '/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target/checkout'
...
/* note, the pom.xml the build should go out of at this point is at
'/Users/___/DEV c8ion …Run Code Online (Sandbox Code Playgroud) 我目前正致力于优化多模块maven项目的maven构建.该项目由大约90个Maven模块组成.通常,有一些交叉的库构成了核心,然后大约有15个"应用程序模块"组成了整个应用程序(然后在WAR中部署)
现在一般情况下整个项目都有一个主要版本"2.5",因此当一个新的主要版本完成时,所有"应用程序模块"都具有相同的版本"2.5.0".到现在为止还挺好.
如果模块有需要修复或需要改进的错误,则应该发布该"应用程序模块"的新版本.因此,例如模块A修复了一个错误,然后A.jar应该是版本"2.5.1",而其余应该仍然是"2.5.0".
父(2.5.0-SNAPSHOT - 模块A(2.5.1-SNAPSHOT) - 模块B(2.5.0-SNAPSHOT) - 模块C(2.5.2-SNAPSHOT) - 战争(2.5.3-SNAPSHOT)< - 3最后,因为C有两个重新发布和一个,并且为了简单起见,在每个模块发布后发布.
我们决定在主pom中管理工件版本,因此我们不需要在释放一个模块后更新每个工件的依赖版本.
所以现在每当更新的"应用程序模块"准备就绪时,我们使用maven发布插件来执行该模块的发布(我们正在发布一个模块,而不是整个项目).因此,假设我们在版本2.5.4中发布模块A,导致A.jar被部署为版本2.5.4,并通过将模块代码更新为2.5.5-SNAPSHOT完成.
完成此操作后,我们需要更新主pom中的版本,以便所有模块继续引用正确的版本.
感谢主pom的dependencyManagement部分,如果我构建War模块,它会自动获取模块A的新版本.
现在是棘手的部分:一旦发布所有模块,就应该发布新版本的Web应用程序.这应该包含所有未更改的模块以及刚刚发布的模块.我目前正在努力如何做到这一点.如果我依赖父poms版本,该版本将包含SNAPSHOT版本(所有版本增量太高),我和发布插件不允许.
这种困境的最佳解决方案是什么?
我有一个想法是将依赖关系管理外包给一个单独的pom,然后使用"import"范围将其导入到主poms dependencyManagement中.
这种szenario是一个愚蠢的想法吗?是否有开发和维护这样的大型多模块应用程序的替代方案?简单地使用整个项目中的发布插件使所有版本同步并不是一个选项,因为应用程序很大并且客户端应用程序必须加载更新的模块版本.我们的一些客户的连接速度非常慢,因此每次推出所有模块都会让他们感到非常不满.
非常感谢,
克里斯
release release-management pom.xml maven maven-release-plugin
我一直在寻找一段时间,在使用嵌套的Git子模块时找不到任何有效的解决方案或指南/教程来发布Maven模块.
我们有一个复杂的公共和私人项目结构,需要特定的订单才能成功构建.我们的目标是执行Maven版本,以便在一个步骤中标记和部署多个Maven工件.
这是简化的Maven项目/模块和Git存储库结构:
parent-public:1.0.0:pom (descriptor only, no Maven modules, public Git repository)
| |
| |- public-module:1.0.0-SNAPSHOT:jar
| (Maven module, child of parent-public, Git submodule, public repository)
|
|- parent-private:1.0.0-SNAPSHOT:pom
(Maven modules, Git submodule, private repository)
|
|- public-module:1.0.0-SNAPSHOT:jar
| (Maven module only, child of parent-public, Git submodule, public repository, released)
|
|- private-module:1.0.0-SNAPSHOT:war
(Maven module, child of parent-private, released)
Run Code Online (Sandbox Code Playgroud)
当前结构允许Maven独立构建和部署项目/模块.
释放时public-module(从parent-public/parent-private/public-module目录),maven-release-plugin执行良好(已标记Git存储库并已部署发布工件).
在发布时parent-private,maven-release-plugin准备并开始执行发布,然后在目标结账期间失败(此问题在此处讨论,但解决方案在我的上下文中不起作用且没有足够的声誉来评论).
这是当前的 …
我正面临连续体发布的问题:准备阶段在scm-check-modification步骤中失败并出现错误:
[错误] org.apache.maven.shared.release.ReleaseFailureException:无法准备发布,因为您有本地修改:[pom.xml:modified]
我做了什么 :
我知道scm-check-modification调用ScmCheckModificationsPhase类来验证与SCM上的内容相比没有本地更改.
我理解,如果我只使用Maven,如果有一些本地更改,或者本地代码和SVN之间的任何差异,例如,release:prepare将不起作用,因为它首先检查修改; 但是使用Continuum,我不知道为什么它应该是本地代码和SVN存储库之间的差异?所以我不知道为什么发布:Continuum的准备目标正面临着这个问题.
我的pom示例:
<build>
<plugins>
...
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<useReleaseProfile>false</useReleaseProfile>
</configuration>
</plugin>
...
</plugins>
</build>
<scm>
<connection>scm:cvs:ext:url:/var/cvs:application_name</connection> <developerConnection>scm:cvs:ext:url:/var/cvs:application_name</developerConnection>
</scm>
.....
</project>
Run Code Online (Sandbox Code Playgroud)
在父pom.xml中:
...
<pluginManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<configuration>
<useReleaseProfile>false</useReleaseProfile>
<goals>deploy</goals>
<arguments>-Prelease</arguments>
</configuration>
</plugin>
.....
Run Code Online (Sandbox Code Playgroud)
有关信息,项目的构建和发布始终正常,直到现在.
有一个绕道解决方案解决了我的问题,但我仍然想了解这个问题的根源.
旁路解决方案:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<configuration>
...
<checkModificationExcludes>
<checkModificationExclude>pom.xml</checkModificationExclude>
</checkModificationExcludes>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud) 是否可以将maven发布插件与多模块项目一起使用,其中一些模块间依赖项是使用父pom中的参数指定的?
当我尝试调用release:prepare我收到以下错误:
[错误]未能执行目标org.apache.maven.plugins:行家释放小插件:2.1:准备(默认CLI)项目森林父母:版本无法更新:$ {some.version} - > [帮助1]
这是我的插件定义:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
<configuration>
<goals>deploy</goals>
<tagBase>https://svn.domain.com/svn/project/tags</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>@{project.version}</tagNameFormat>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
提前致谢!
我正在尝试发布mvn,但由于git问题而失败.在没有这个问题之前我已经多次这样做了,我真的不明白为什么/如何发生这种情况.
我首先得到它做mvn release:prepare,但通过将下面显示的最后一行添加到我的root-pom来解决它:
<artifactId>maven-release-plugin</artifactId>
<configuration>
<preparationGoals>clean install</preparationGoals>
<pushChanges>false</pushChanges>
Run Code Online (Sandbox Code Playgroud)
但是现在,当我尝试执行mvn release:perform时,我再次收到错误消息:
[INFO] Executing: cmd.exe /X /C "git clone file://C\Users\torbjornk\nfr\MyProject/ C:\Users\torbjornk\nfr\MyProject\target\checkout"
[INFO] Working directory: C:\Users\torbjornk\nfr\MyProject\target
[ERROR] The git-clone command failed.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Unable to checkout from SCM
Provider message:
The git-clone command failed.
Command output:
fatal: 'C:/Program Files (x86)/Git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
我不知道我的git-installation-folder应该是一个git存储库!在错误发生之前记录的git clone-command也不包含对此文件夹的引用.
最近从SourceForge将项目的源代码存储库切换到GitHub我需要更新maven发布过程以匹配.我按照此链接配置了pom的"scm"部分.这里显示了 GitHub存储库.其他所有内容都与使用SVN时一样(用于发布到https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-4.MavenRepositories).所以我调用了
mvn clean release:clean release:prepare release:perform
Run Code Online (Sandbox Code Playgroud)
输出如下
[INFO] --- maven-release-plugin:2.1:prepare (default-cli) @ datanucleus-maven-parent ---
[INFO] Verifying that there are no local modifications...
[INFO] ignoring changes on: pom.xml.next, release.properties, pom.xml.releaseBackup, pom.xml.backup, pom.xml.branch, pom.xml.tag
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git status
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent
[INFO] Checking dependencies and plugins for snapshots ...
What is the release version for "DataNucleus Maven parent project"? (org.datanucleus:datanucleus-maven-parent) 3.3: :
What is SCM release tag or label for …Run Code Online (Sandbox Code Playgroud) 最近几天,我尝试使用git配置Maven版本插件。我已经为它设置了一个测试项目,并且尝试了太多配置,以至于我不知道如何将它们全部显示给您...在每种情况下,maven版本插件仅使用分支im。如果我在master分支上启动MRP,则在其上创建标记,如果在develop分支上即时消息,则在此处创建所有东西。我的实际pom看起来像这样:
<project>
...
<scm>
<connection>scm:git:file://D:\Dev\gitremotetest\testpp</connection>
<developerConnection>scm:git:file://D:\Dev\gitremotetest\testpp</developerConnection>
<tag>HEAD</tag>
</scm>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.9.5</version>
</dependency>
</dependencies>
<configuration>
<branchName>develop</branchName>
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
Run Code Online (Sandbox Code Playgroud)
我搜索了很多网站,但找不到git的MRP完整配置。结果应该是,develop分支是发布前的版本0.0.1-SNAPSHOT和发布后的版本0.0.2-SNAPSHOT。Master分支应包含Prerelease版本0.0.0和Post-Release版本0.0.1。
这是冗长的Maven输出:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: D:\Dev\git\testpp\testpp\EMBEDDED
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: C:\Programme\Java\jdk1.8.0_91\jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm …Run Code Online (Sandbox Code Playgroud)