可能重复:
您将 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 重用这些凭据?
基本上,我需要知道将设置文件放在哪里,以及其中定义的所有登录 URL/凭据如何<ivy:settings>
与我的 Artifactory 配置相关联。
提前致谢!