根据配置文件更改部署的工件名称
我在 Web 应用程序的 pom 文件中有一个构建配置文件,它为 qa 测试做了一些必要的事情(在我的代码中)。
我在 svn 上有这段代码,这段代码是在 Hudson 中编译的,它在 nexus 中部署工件。Hudson
有两项工作,一项用于 qa 配置文件 (-P qa),一项用于客户。
我需要的是在部署阶段在我的 qa 配置文件中更改工件的名称,以便 Nexus 有两个不同的 war 文件,一个用于 qa,一个用于客户。
我使用(谷歌搜索后)以下内容,看起来它在 hudshon 中没有任何作用!
<profile>
<id>qa</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
<configuration>
<classifier>qa</classifier>
</configuration>
</plugin>
</plugins>
</build>
</profile>
有人有什么想法吗?
I have in a web application's pom file, a build profile, which does some necessary things (in my code) for qa testing.
I have this code on svn and this code is compiled in Hudson, which deploys artifacts in nexus..
Hudson has two jobs, one for qa profile (-P qa) and one for customers.
What i need is that i change in my qa profile the artifact's name during deploy phase, so that nexus has two different war files, one for qa and one for customer.
I use (after Google search) the following which looks like it does nothing in hudshon!
<profile>
<id>qa</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
<configuration>
<classifier>qa</classifier>
</configuration>
</plugin>
</plugins>
</build>
</profile>
any ideas someone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您实际上需要在构建正在部署的包的插件上设置“分类器”配置选项:maven-(ear|ejb|jar|rar|war|shade)-plugin:
例如,使用 qa 构建 WAR 操作:
此外,您可以设置以下任何一项,而不是设置分类器(大多数默认为project.build.finalName,因此设置该属性会更新其中的许多项):
最后一点:我以前从未意识到这一点,但查看文档,看起来 RAR 插件不支持“分类”选项。 Shade 确实支持分类器概念,但通过“shadedClassifierName”属性来实现。
You actually need to set the "classifier" configuration option on the plugin that's building the package that's being deployed: maven-(ear|ejb|jar|rar|war|shade)-plugin:
For instance, to build a WAR with a qa classifier, you would do the following:
Also, instead of setting the classifier you could set any of the following (most default to project.build.finalName, so setting that property updates many of these):
One final note: I never realized this before, but looking over the documentation, it looks like the RAR plugin doesn't support the "classification" option. Shade does support the classifier concept, but does it via the "shadedClassifierName" property.