- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正忙着用 Ivy 弄湿我的脚。我在本地 PC 上运行了一个现有的 nexus 存储库,以及一个现有的 ant 构建脚本。
两者都工作正常。
部分构建脚本有一些文件可以从网络共享中检索我们的 3rdparty jar 文件(log4j、xmlbeans、junit、pdf 等)——这充其量是 klunky。
我想使用 ivy 的依赖机制从一个 nexus 存储库中检索这些文件并在构建中使用它。每个 3rdparty 库都有一个名称和一组任意文件(jar、dll、license.dat、xml 等)。
由于我们有大量这些 3rdparty 库并且每个库都有多个文件 - 手动上传到 nexus 不是一种选择 - 我需要一些可以用来获取一组文件的东西,给它们一个库名称,一个版本号和将结果上传到nexus。那么我需要能够从 Ivy 中检索它。
我设法让上传部分工作,但检索过程不起作用。使用我们的 xmlbeans lib 作为起点,我创建了以下 ivy.xml 文件
<ivy-module version="1.0">
<info organisation="thirdparty_tools" module="xmlbeans" status="integration">
<publications>
<artifact name="jsr173_api" type="jar" ext="jar"/>
<artifact name="saxon-dom" type="jar" ext="jar"/>
<artifact name="saxon-xpath" type="jar" ext="jar"/>
<artifact name="saxon" type="jar" ext="jar"/>
<artifact name="xbean" type="jar" ext="jar"/>
<artifact name="xbean_xpath" type="jar" ext="jar"/>
<artifact name="xmlpublic" type="jar" ext="jar"/>
</publications>
</ivy-module>
<ivy:resolve/>
<ivy:publish <ivy:publish resolver="thirdparty" forcedeliver="true" update="true" revision="${version}" overwrite="true">
<artifacts pattern="[artifact].[ext]"/>
<ivy:publish/>
<ivy-module version="1.0">
<info organisation="myCompany" module="GLB_Data"/>
<dependencies>
<dependency org="thirdparty_tools" name="xmlbeans" rev="2.2.0"/>
</dependencies>
</ivy-module>
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: thirdparty_tools#jsr173_api;2.2.0: not found
:: thirdparty_tools#saxon-dom;2.2.0: not found
:: thirdparty_tools#saxon-xpath;2.2.0: not found
:: thirdparty_tools#saxon;2.2.0: not found
:: thirdparty_tools#xbean;2.2.0: not found
:: thirdparty_tools#xbean_xpath;2.2.0: not found
:: thirdparty_tools#xmlpublic;2.2.0: not found
::::::::::::::::::::::::::::::::::::::::::::::
WARN: ==== public: tried
WARN: http //localhost:8081/nexus/content/groups/public/thirdparty_tools/jsr173_api/2.2.0/jsr173_api-2.2.0.pom
WARN: -- artifact thirdparty_tools#jsr173_api;2.2.0!jsr173_api.jar:
WARN: http //localhost:8081/nexus/content/groups/public/thirdparty_tools/jsr173_api/2.2.0/jsr173_api-2.2.0.jar
ivy seems to be looking for the jsr173_api artifact under its own name, rather than under the xmlbeans folder where it was published to:
[ivy:publish] published jsr173_api to http //localhost:8081/nexus/content/repositories/thirdparty/thirdparty_tools/xmlbeans/2.2.0/jsr173_api-2.2.0.jar
最佳答案
Nexus 主要是一个 Maven 存储库,这意味着必须适应 Maven 构建工件的方式。
由于您专注于批量加载 Nexus,我建议您查看以下问题的答案:
Upload artifacts to Nexus, without Maven
如果您想坚持使用 Ivy ,请继续阅读......
背景
需要一个 Maven POM
您的第一个问题是您的 Maven 模块将需要一个 POM 文件。这个文件描述了 maven 模块,可以很容易地从你的 的内容中生成。 Ivy .xml 文件(参见下面的解决方案)。
其次,Maven 假设有 一个 正在构建的主要工件。例如:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.myspotontheweb</groupId>
<artifactId>donaldduck</artifactId>
<version>1.0.1</version>
<packaging>txt</packaging>
</project>
http://<host>/<repo>/com/myspotontheweb/donaldduck/1.0.1/donaldduck-1.0.1.txt
<dependency>
<groupId>com.myspotontheweb</groupId>
<artifactId>donaldduck</artifactId>
<version>1.0.1</version>
<classifier>metadata</classifier>
<type>n3</type>
</dependency>
http://<host>/<repo>/com/myspotontheweb/donaldduck/1.0.1/donaldduck-1.0.1-metadata.n3
<ivy-module version='2.0' xmlns:e="http://ant.apache.org/ivy/extra">
<info organisation="com.myspotonontheweb" module="donaldduck" revision="1.0.1"/>
<publications>
<artifact name="donaldduck" type="txt"/>
<artifact name="donaldduck" type="pom"/>
<artifact name="donaldduck" type="n3" e:classifier="metadata"/>
<artifact name="donaldduck" type="zip" e:classifier="disto"/>
</publications>
</ivy-module>
<target name="prepare" description="Generate POM">
<!-- Optional: Intermediate file containing resolved version numbers -->
<ivy:deliver deliverpattern="${build.dir}/ivy.xml" pubrevision="${publish.revision}" status="release"/>
<!-- Generate the Maven POM -->
<ivy:makepom ivyfile="${build.dir}/ivy.xml" pomfile="${build.dir}/donaldduck.pom"/>
</target>
<target name="publish" depends="init,prepare" description="Upload to Nexus">
<ivy:publish resolver="nexus-deploy" pubrevision="${publish.revision}" overwrite="true" publishivy="false" >
<artifacts pattern="${build.dir}/[artifact](-[classifier]).[ext]"/>
</ivy:publish>
</target>
<ivysettings>
<settings defaultResolver="nexus-central"/>
<credentials host="somehost" realm="Sonatype Nexus Repository Manager" username="????" passwd="????"/>
<resolvers>
<ibiblio name="nexus-central" root="http://somehost/nexus/content/repositories/central/" m2compatible="true"/>
<ibiblio name="nexus-deploy" root="http://somehost/nexus/content/repositories/repo" m2compatible="true"/>
</resolvers>
</ivysettings>
<dependency org="com.myspotontheweb" name="donaldduck" rev="1.0.1">
<artifact name="donaldduck" type="txt"/>
<artifact name="donaldduck" type="n3" e:classifier="metadata"/>
<artifact name="donaldduck" type="zip" e:classifier="distro"/>
</dependency>
<dependency>
<groupId>com.myspotontheweb</groupId>
<artifactId>donaldduck</artifactId>
<version>1.0.1</version>
<type>txt</type>
</dependency>
<dependency>
<groupId>com.myspotontheweb</groupId>
<artifactId>donaldduck</artifactId>
<version>1.0.1</version>
<classifier>metadata</classifier>
<type>n3</type>
</dependency>
<dependency>
<groupId>com.myspotontheweb</groupId>
<artifactId>donaldduck</artifactId>
<version>1.0.1</version>
<classifier>distro</classifier>
<type>zip</type>
</dependency>
关于ant - 如何使用 ivy 和 nexus 发布 3rdparty 工件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5111831/
我有一个主 Ivy 项目,其他人通过 svn:externals 属性将其包含在他们的项目中。该项目包含 Ivy jar,连接到我们项目的默认 ivysettings.xml 文件,以及一些允许我标准
我正在尝试将文件库添加到 Ivy ,但它不起作用。 以下是使用的文件: Ivy .xml ivysettings.xml 构建文件
我以为我不需要问这个,但我没有任何进展。 这个问题的解决方案: How are maven scopes mapped to ivy configurations by ivy实际上解决了问题,但在其
考虑如下 ivy.xml: 当我运行 Ivy 时,它会获取 EHCache 的所有依赖项
我来自 Maven 背景。我正在从事的项目不是基于 Java 的。但是,需要使用独立的 Ivy 进行依赖管理。存储库管理器是 Nexus。 该项目产生了几个 zip 工件,需要通过独立的 Ivy 将它
似乎没有 ivy:unpublish 任务(例如,参见 here)。 所以,我认为应该在文件系统级别手动或通过删除 ~/.ivy2/local 子文件夹的 Ant 任务执行取消发布? (当目标是从本地
有没有人有使用 Ivy 的具体例子或 与 delivertarget 的任务属性做递归交付?官方文档相当......稀疏。是否有关于何时使用它而不是正常的 Ant“父”构建机制(例如, )来进行递归
我正在使用 ivy,我工作的公司有一些有趣的小 ivy 和 ant 教程。 当在依赖项部分使用时,每个教程都有助于完全绕过箭头在 ivy 构建 xml 文件中的作用。 因此,鉴于此设置:
有关 Apache Ivy 的三个简单问题: (1) 在我们的项目中,我们使用了 100 多个“通用”JAR(log4j、junit、commons-cli 等)。我们是否必须为所有这些文件编写 iv
我正在使用 ivy,我工作的公司有一些有趣的小 ivy 和 ant 教程。 当在依赖项部分使用时,每个教程都有助于完全绕过箭头在 ivy 构建 xml 文件中的作用。 因此,鉴于此设置:
是否有人测试过如何在启用安全性的 Archiva 中部署工件。我有以下配置 我的ivysettings.xml 我的build.xml
解析了我的 ivy.xml 文件后,我想创建一个新的 resolved-ivy.xml 文件,其中包含所有传递依赖项 在解析中找到。 这有可能吗? 这与交付不同,交付(我相信)只从您的 ivy.xml
我有一个本地 Artifactory 存储库,其中有两个用于 commons-logging 的 jar 。 : 一个给 version 1.0.4一个用于 version 1.1.1 .我正在尝试使
我正在使用 ~/.sbt/repositories文件告诉 sbt 0.13.5 要从哪些存储库中检索。该文件仅包含 local和 file://具有与标准 sbt 非常相似的自定义布局的存储库,具有
在 Gradle 中,我们配置了一个本地 Maven 存储库,并将工件上传到那里以用于我在其他项目的本地构建中使用。 我更喜欢使用 Ivy 存储库(因此我可以为工件名称使用自定义模式)。 您如何配置
更新快照依赖项时,我无法让 Ivy 更新缓存。解析器(具有以下设置: 一个示例 Artifactory 文件名(在 Artifactory 中)是: my-jar-1.999-SNAPSHOT.ja
我在设置 sbt 时遇到了问题。我下载了一个“zip”并展开它,但是当我运行 sbt 命令时,发生了错误。 module not found: org.scala-sbt#sbt;0.13.8
Maven 存储库,例如 Maven Repository提供最广泛的依赖管理项目。 Ivy 提供了访问 maven 存储库并从那里下载 Artifact 的可能性。这些存储库中只有 pom 文件,没
有没有办法在我调用 ivy:retrieve 时选择使用哪个 ivy.xml 文件? 寻找 at the documentation看来我可以使用 settingsRef 属性来选择要使用的 IVY
这是我的 ivy.xml 的示例: 使用 ivy 1.0,我可以下载这两个工件 当我将版本升级到 ivy-2.0.0 时,仅下载其中一个工件。 Ivy 设置中是否有我必须指定的内容
我是一名优秀的程序员,十分优秀!