简体   繁体   English

使用Ivy发布文件时是否遵守[conf]令牌?

[英]Is the [conf] token respected when publishing files using Ivy?

I'm learning Ivy (http://ant.apache.org/ivy/) and integrating it as part of our build process. 我正在学习Ivy(http://ant.apache.org/ivy/),并将其集成为构建过程的一部分。 It's going pretty well, but I'm stuck on something with the Ivy publish task. 一切都很好,但是我在常春藤发布任务上受了限制。 Specifically, I'd like to publish to the local repository with the following pattern (which includes the name of the current configuration): 具体来说,我想使用以下模式(包括当前配置的名称)发布到本地存储库:

${ivy.local.default.root}/[organisation]/[module]/[revision]/[type]s/[conf]/[artifact].[ext] $ {ivy.local.default.root} / [organization] / [module] / [revision] / [type] s / [conf] / [artifact]。[ext]

So I set up my custom resolver: 因此,我设置了自定义解析器:

<filesystem name="modifiedLocalRepo">
    <ivy pattern="${ivy.local.default.root}/[organisation]/[module]/[revision]/[type]s/[conf]/[artifact].[ext]" />
    <artifact pattern="${ivy.local.default.root}/[organisation]/[module]/[revision]/[type]s/[conf]/[artifact].[ext]" />
</filesystem>

And configured the publish task: 并配置了发布任务:

<ivy:publish 
    settingsRef="ivy.ext.settings.custom" <!--Location of definition of modifiedLocalRepo-->
    resolver="modifiedLocalRepo" 
    artifactspattern="bin/Debug/[module].[ext]" 
    pubrevision="1.1-Test" 
    overwrite="true"
    conf="primary"
/>

And have the conf defined in the ivy.xml file: 并在ivy.xml文件中定义conf:

<info organisation="Mine" module="Dependency"/>
<configurations defaultconf="primary"> <!--Don't think defaultconf should be necessary-->
    <conf name="primary"/>
</configurations>
<publications>
    <artifact name="Dependency" ext="dll" type="bin" conf="primary"/>
    <artifact name="Dependency" ext="pdb" type="bin" conf="primary"/>
</publications>

I have the process working, ivy configured, resolved, the project building, and the artifacts published (using my custom resolver above). 我已经完成了该流程的工作,ivy的配置,已解决,项目构建以及已发布的工件(使用上面的自定义解析器)。 But the [conf] token is always resolving to "default." 但是[conf]标记始终解析为“默认”。 So the published directory has the structure: 因此,发布的目录具有以下结构:

\\.ivy2\\local\\Mine\\Dependency\\1.1-Test\\bins\\default\\ \\ .ivy2 \\ local \\ Mine \\ Dependency \\ 1.1-Test \\ bins \\ default \\

instead of the structure 而不是结构

\\.ivy2\\local\\Mine\\Dependency\\1.1-Test\\bins\\primary\\ \\ .ivy2 \\ local \\ Mine \\ Dependency \\ 1.1-Test \\ bins \\ primary \\

I've been tinkering around with it, setting the conf value, defaultconf value, etc. everywhere they are valid but it's always "default." 我一直在修改它,设置conf值,defaultconf值等,只要它们有效,就总是“默认”。

I'm using ant to do the build, and have run in debug mode (-d), inspected the output and noticed nothing useful. 我正在使用ant进行构建,并已在调试模式(-d)中运行,检查了输出并没有发现有用的信息。 I've looked through the output of <echoproperties\\> and noticed nothing useful. 我查看了<echoproperties \\>的输出,发现没有任何用处。 I've read through the Ivy documentation and only found use of [conf] as a token in retrieve and report output. 我已经阅读了Ivy文档,仅在检索和报告输出中发现使用[conf]作为令牌。

I can attach the full xml files I'm using to do my limited test build if it would be useful. 如果有用的话,我可以附加完整的xml文件来进行有限的测试构建。

Is the [conf] token valid/respected in the artifact pattern for an Ivy publish? 常春藤发布的工件模式中[conf]令牌是否有效/受尊重? If so, what am I missing? 如果是这样,我想念什么? Thanks! 谢谢!

Update: Was using Ivy 2.3.0-rc2 and decided to try to roll back and use Ivy 2.0.0. 更新:正在使用Ivy 2.3.0-rc2,并决定尝试回滚并使用Ivy 2.0.0。 Same issue. 同样的问题。

Take a look at my Ivy project in github . 看看我在github中的 Ivy项目。 I set it up, so you can easily add it into an existing Ant project. 我进行了设置,因此您可以轻松地将其添加到现有的Ant项目中。

We use a Maven repository, so I have it setup to create a pom.xml , and then use mvn deploy:deploy-file to deploy it back to the Maven repository. 我们使用Maven存储库,因此我将其设置为创建pom.xml ,然后使用mvn deploy:deploy-file将其部署回Maven存储库。 We use Jenkins for our build, so we use Jenkins to run the mvn deploy-file to do the deployment. 我们使用Jenkins进行构建,因此我们使用Jenkins运行mvn deploy-file进行部署。 I guess we could use <ivy:publish> , but never really tried it. 我猜我们可以使用<ivy:publish> ,但从未真正尝试过。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM