ivy:publish 如何运作? [英] How does ivy:publish work?

查看:23
本文介绍了ivy:publish 如何运作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完全不知道 ant 任务 ivy:publish 应该如何工作.

I'm completely at loss how the ant task ivy:publish is supposed to work.

我希望我进行正常构建,这会创建一堆 jar 文件,然后我会将这些 jar 推送到(本地)存储库.

I would expect that I do my normal build, which creates a bunch of jar files, then I would push those jars to the (local) repository.

如何指定从何处检索构建的 jar,以及它们将如何在存储库中结束?

How can I specify from where to retrieve the built jars, and how would those end up in the repository?

更新:

<target name="publish-local" description="--> Publish Local">
    <ivy:retrieve />
    <ivy:publish resolver="local" pubrevision="${release.version}" status="release" update="true" overwrite="true">
        <artifacts pattern="${dist.dir}/[organisation]-[module].[ext]" />
    </ivy:publish>
</target>

这确实有效,我之前没有包括检索.

this actually works, I didn't include the retrieve before.

但是我仍然有一些问题,假设我想发布 3 个 jar,openscada-utils.jar、openscada-utils-sources.jar 和 openscada-utils-javadocs.jar 作为 openscada-utils-0.9.2.jar,openscada-utils-0.9.2-sources.jar 和 openscada-utils-0.9.2-javadocs.jar

But I still have some problems, suppose I want to publish 3 jars, openscada-utils.jar, openscada-utils-sources.jar and openscada-utils-javadocs.jar as openscada-utils-0.9.2.jar, openscada-utils-0.9.2-sources.jar and openscada-utils-0.9.2-javadocs.jar

我并不完全清楚实际名称是如何组合的,以及我可以在哪里指定它们应该获得哪些名称.(使用上面的片段,jar 总是只被称为 utils.jar).

It isn't entirely clear to me, how the actual names are assembled, and where I can specify which names they should get. (Using the fragment above, the jars are always called only utils.jar).

更新 1:

我让它工作(有点),但仍然感觉不对.不知何故,所有教程都侧重于来自 3rd 方项目的依赖项,但对我来说同样重要的一点是处理特定于项目的依赖项.

I got it to work (a bit), but it still doesn't feel right. Somehow all tutorials focus on dependencies from 3rd party projects, but an equally important point for me is to handle project specific dependencies.

我有一堆子项目,它们以各种方式相互依赖.考虑 ivy:publish 我不清楚如何开始.

I have a bunch of sub projects which depend on each other in various ways. Considering ivy:publish it is not clear to me how to start.

  1. 我如何处理第一个版本?我有所有子项目的通用版本号,以表明它们属于一起(比方说 0.9).因此,第一个修订版应该是 0.9.0,但到目前为止,我的存储库中没有任何项目.我如何让 Ivy 分配此修订号.

  1. How do I handle the first version? I have a common version number for all sub projects to indicate that they belong together (lets say 0.9). Therefore the first revision should be 0.9.0, but so far nothing of my projects is in my repository. How do I get Ivy to assign this revision number.

在开发过程中,我想再次发布构建的文件,目前为止不更改修订号.

In the course of developing I want to publish the built files again, without changing the revision number so far.

如果我完成了我的工作,我想将其推送到共享存储库(并将修订号从 0.9.0 增加到 0.9.1),推荐的方法是什么?

If I'm finished with my work I want to push it to a shared repository (and increase the revision number lets say from 0.9.0 to 0.9.1), what is the recommended approach to do so?

对于实际发布,我想制作有依赖项和没有依赖项的发行版,不知何故我想我可以为此使用不同的配置.我该如何利用它?

For an actual release, I want to make distributions with dependencies and without, somehow I guess I can use different configurations for that. How can I use that to my advantage?

推荐答案

您需要指定解析器".类似的东西:

You need to specify the "resolver". Something like:

<ivy:publish resolver="local" pubrevision="1.0"/>

它是由模式控制的.这个页面 很好地涵盖了它.看起来你想要你的:

It's controlled by the pattern. This page covers it pretty well. It looks like you want yours to be:

<artifacts pattern="${dist.dir}/[organisation]-[module]-[revision]-[type].[ext]" />

并且您需要将这三个 jar 标识为 ivy.xml 文件中的工件.像这样:

And you'll need to identify the three jars as artifacts in the ivy.xml file. Something like this:

<publications>
    <artifact name="utils"/>
    <artifact name="utils" type="source"/>
    <artifact name="utils" type="javadocs"/>
</publications>

这篇关于ivy:publish 如何运作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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