gpt4 book ai didi

java - Ant、Ivy 和 Artifactory 如何使用设置文件

转载 作者:行者123 更新时间:2023-11-30 09:32:57 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
where do you put ivysettings.xml?

我已将 Artifactory 设置为在我的机器上本地运行:

http://localhost:8080/artifactory/myRepo

该存储库目前只有 1 个它为我管理的依赖项 Google Guice (3.0):

myRepo/
google/
guice/
3.0/
guice-3.0/
guice-3.0.jar
guive-3.0-ivy.xml

我现在已经配置了我的 Ant 构建以立即启动 Ivy 解析:

<project name="myapp-build default="audit" basedir=".." xmlns:ivy="antlib:org.apache.ivy.ant">
<path id="ant.lib.path">
<fileset dir="${env.ANT_HOME}/lib" includes="*.jar"/>
</path>

<!-- I have ivy.jar and its dependencies installed under ${ANT_HOME}lib. -->
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ant.lib.path"/>
<target name="resolve">
<!-- Initialize Ivy and connect to host repository. -->
<echo message="Initializing Apache Ivy and connecting to the host repository."/>
<ivy:settings url="${ivy.std.repo.settings.url}" realm="${ivy.std.repo.realm}"
username="${ivy.std.repo.username}" passwd="${ivy.std.repo.password}"/>

<!-- Clear/flush the Ivy cache. -->
<echo message="Cleaning the local Ivy cache for the current build."/>
<ivy:cleancache/>

<!-- Resolve ivy.xml against the standard repository (all configurations) -->
<echo message="Resolving ivy.xml dependencies against the host repository."/>
<ivy:resolve file="./ivy.xml"/>

<!-- Retrieve compile dependencies from local Ivy cache and place them into the gen/lib/main. -->
<echo message="Retrieving compile-time dependencies."/>
<ivy:retrieve ivypattern="${gen.lib.main.dir}/[artifact].[ext]" conf="compile"/>

<!-- Retrieve test dependencies from local Ivy cache and place them into the gen/lib/test. -->
<echo message="Retrieving testing dependencies."/>
<ivy:retrieve ivypattern="${gen.lib.test.dir}/[artifact].[ext]" conf="test"/>
</target>

...

</project>

我还写了一个ivy.xml我的模块的描述符。

我正在挣扎的是 ivysettings.xml文件,特别是:

  • 我应该把它放在哪里(在我的文件系统上),或者 Artifactory 是否以某种方式“上传”它?如果是这样,在哪里/如何?
  • 用户名/密码(在 <ivy:settings> 任务中提供)用于基本 HTTP 身份验证,我假设 Artifactory 会重复使用这些凭据?

基本上,我需要知道将设置文件放在哪里,以及如何在 <ivy:settings> 中定义所有登录 URL/凭证。与我的 Artifactory 配置有关。

提前致谢!

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com