我在Spotify的docker-clientmvn release:prepare -Darguments="-Dmaven.test.skip=true -DskipTests"的主要结账时运行.但我不能让maven的发布插件跳过测试.为什么maven在这种情况下不尊重CLI标志?
我也很好奇是什么原因导致release插件执行surefire-plugin.没有指定的surefire-plugin pom.xml.
mvn --version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T12:29:23-05:00)
Maven home: /usr/local/Cellar/maven/3.2.5/libexec
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.2", arch: "x86_64", family: "mac"
Run Code Online (Sandbox Code Playgroud) 我们使用Hudson和maven-release-plugin来完成发布版本.现在我有一个项目,其中包含一个程序集,它将所有需要的组件放在一起,然后将它们打包成一个带有所需目录结构的.tar.gz包.
现在我正在尝试使用release-plugin在发布期间将此包部署到我们的Maven存储库:执行目标,但只部署了标准的东西(sources,javadoc,POM).
我已经将汇编目标绑定到maven包阶段,而.tar.gz在发布期间进行构建,但没有上传到存储库.我在这里做错了什么提示?
这是assembly-plugin配置:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-4</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/distribution.xml</descriptor>
</descriptors>
<finalName>${pom.artifactId}-${pom.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<tarLongFileMode>warn</tarLongFileMode>
</configuration>
<executions>
<execution>
<id>dist-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我运行以构建版本的命令是
mvn release:prepare release:perform release:clean
Run Code Online (Sandbox Code Playgroud) deployment maven-2 maven-assembly-plugin maven-release-plugin
我有一个pom与以下GAV
<groupId>com.company.services</groupId>
<artifactId>test-branch-2</artifactId>
<version>1.0.21-SNAPSHOT</version>
Run Code Online (Sandbox Code Playgroud)
我想-SNAPSHOT在批处理模式下使用maven 从中删除,所以我可以使用Jenkins来完成,而不必手动指定任何内容.
我查看了版本的文档:set但是所有选项都为我提供了一个交互式提示,并要求我输入版本的名称.
我更喜欢版本插件,而不是发布插件.
pom.xml maven-3 maven maven-release-plugin versions-maven-plugin
当我的团队使用Mercurial存储库中的源处理给定项目时,存储库的大小明显增加.因此,通过网络克隆存储库变得越来越慢.
是否有任何技术用于修剪旧提交或减少repo的大小以使克隆操作在慢速网络上更快?
(我们使用TortoiseHg作为Mercurial客户端,但是(我猜)我不应该对这个问题的解决方案产生影响.)
mercurial continuous-integration filesize tortoisehg maven-release-plugin
关于接受答案的说明:由于强有力的间接证据,我接受了答案.尽管如此,这是间接的证据,所以要带上一粒盐.
当用户运行插件目标而不是生命周期阶段时,如何触发插件?(之前已经问过,但答案是使用生命周期阶段.)
例证:我需要release:branch调用regex-plugin以生成一个当前版本作为其名称的分支,减去-SNAPSHOT后缀.这就是我所拥有的,它要求开发人员激活配置文件并调用verify阶段.我需要开发人员简单地调用release:branch,这反过来应该导致regex-plugin运行.与Gitflow有点结婚.
<profile>
<id>Release Branch</id>
<build>
<plugins>
<!-- On validate, compute the current version without -SNAPSHOT. -->
<!-- Put the result in a property. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>regex-property</goal>
</goals>
<configuration>
<value>${project.version}</value>
<regex>^(.*)-SNAPSHOT$</regex>
<replacement>$1</replacement>
<name>project.unqualifiedVersion</name>
</configuration>
</execution>
</executions>
</plugin>
<!-- Also on validate, run the branch plugin, and use -->
<!-- the non-SNAPSHOT version thus computed in the …Run Code Online (Sandbox Code Playgroud) 当我尝试运行maven-release-plugin时,它会更改pom.xml文件中的版本.在maven发布之前,每一行结尾都有unix样式,<lf>但在我的windows机器上运行之后,插件会将文件中的每一行都更改为<cr><lf>.
我的问题是:
a)有没有办法告诉maven将所有内容保留原样或使用特定的行结尾
要么
b)是否有通用的方法告诉窗口结束应该是什么?即使是在操作系统中深陷内容的工具也会被认为是有用的.
我看了这个https://issues.jfrog.org/jira/browse/BI-111,它说"已解决",但我使用的是最新版本,但它对我不起作用.
我们正在使用Jenkins,只是从没有身份验证的基于文件的git repo切换到使用GitBlit通过http进行适当的身份验证.
问题是 - maven如何在批处理模式下验证自己?
使用-Dusername和更新每个作业-Dpassword(并因此将密码存储在作业中)似乎不太可行.我已经读过settings.xml应该通过将git服务器指定为id来使用git,但是无论我做什么都没有效果(即发布插件提示输入凭据).
<properties>
<project.scm.id>git</project.scm.id>
</properties>
<scm>
<connection>scm:git:http://myserver:8081/r/gitauthtest.git</connection>
<developerConnection>scm:git:http://myserver:8081/r/gitauthtest.git</developerConnection>
</scm>
Run Code Online (Sandbox Code Playgroud)
<settings>
<servers>
<server>
<id>git</id>
<username>myUser</username>
<password>myPassword</password>
</server>
</servers>
</settings>
Run Code Online (Sandbox Code Playgroud)
有没有办法让这个工作?我无法相信一项简单且极为常见的任务,因为它没有简单的标准解决方案.
我正在使用Jenkins Pipeline自动构建和部署我的Java应用程序.我还使用maven-release-plugin来执行Maven部署到Artifactory.
问题是我的Jenkinsfile(或Jenkins管道配置):
您了解最后一步创建无限循环,即使没有有用的提交.
这是我的Jenkinsfile的有趣部分:
sshagent([git_credential]) {
sh "${maven_bin} --settings ${maven_settings} -DreleaseVersion=${release_version} -DdevelopmentVersion=${development_version} release:prepare release:perform -B"
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能打破循环(当Maven在GIT上提交时,避免Jenkins触发新的构建)?
谢谢
我有一个pom文件,其中一些依赖项的版本号依赖于pom文件的设置中指定的项目版本属性.我可以通过命令行覆盖它吗?如果是这样,怎么样?
这是长篇故事:
我们目前正在将我们的项目转移到maven,但我们还没有完成任何方式.有多个模块仍然没有使用maven构建,因此是我们项目中的依赖项(它们通过ant构建到jar中).发布后,我们希望构建所有这些jar并包含与父项目相同的版本号.对于发布,执行两个步骤(直到我们可以使用maven获取所有内容)
在第二步中,命令行参数用于指定发行版:
mvn release:prepare -DreleaseVersion=12.12.4.0 -DdevelopmentVersion=12.12.4.1-SNAPSHOT -Dtag=iv-12.12.4.0
Run Code Online (Sandbox Code Playgroud)
我想用指定的版本更新pom文件.但是,运行此命令时,仍在使用pom文件(12.12.4.0-SNAPSHOT)中的版本.这无法"检查快照的依赖项和插件"步骤,我需要解析仍然具有maven版本属性使用的12.12.4.0-SNAPSHOT版本的jar.
这让我想到了如何覆盖它的原始问题,以便版本解析为命令行中指定的版本.可以让我解决的其他问题是:如何在此检查之前允许maven发布插件更新pom文件?如何跳过快照检查(不可取)
我可以在pom文件中创建一个我可以覆盖的属性,但是我必须在pom文件中的两个位置维护版本号.
思考?
由于Nexus登台存储库存在问题,我需要重新运行mvn release:perform,理想情况下不需要创建新的Git标记,而是重用第一次运行创建的标记.
我试过了
mvn release:perform
-DconnectionUrl=scm:git:git@github.com:ops4j/org.ops4j.pax.exam2.git
-Dtag=exam-reactor-3.3.0
Run Code Online (Sandbox Code Playgroud)
和
mvn release:perform
-DconnectionUrl=scm:git:git@github.com:ops4j/org.ops4j.pax.exam2.git
-Dscm.tag=exam-reactor-3.3.0
Run Code Online (Sandbox Code Playgroud)
但在这两种情况下,克隆都会失败,因为标记/分支参数不会转发给Git:
[INFO] --- maven-release-plugin:2.4:perform (default-cli) @ exam-reactor ---
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd /home/hwellmann/work/org.ops4j.pax.exam2/target && git clone --branch git@github.com:ops4j/org.ops4j.pax.exam2.git /home/hwellmann/work/org.ops4j.pax.exam2/target/checkout
Run Code Online (Sandbox Code Playgroud)
注意:release.properties和其他创建的东西mvn release:prepare不再可用.
maven ×7
git ×3
deployment ×1
filesize ×1
git-flow ×1
jenkins ×1
line-endings ×1
maven-2 ×1
maven-3 ×1
mercurial ×1
pom.xml ×1
tortoisehg ×1