英文:
IvySettings.xml file is not read by Ant during build
问题
我想要从我的内部仓库下载我的Ant项目中的所有依赖项/ JAR文件(在Netbeans上运行)。
-
我已经安装了Ivy JAR,并将其放置在我的Apache Ant的lib文件夹中。
-
我已经将ivysettings.xml文件放置在我的根文件夹中(也就是我有build.xml文件的地方)。
2.i. 我的ivysettings.xml文件如下:
<ivysettings>
<properties file="${ivy.settings.dir}/ivysettings-file.properties"/>
<settings defaultResolver="https://my-internal-repo.com/artifactory"/>
<caches defaultCacheDir="${cache.dir}" checkUpToDate="false"/>
<credentials host="https://my-internal-repo.com/artifactory" realm="Artifactory Realm" username="usrname" passwd="ABCD"/>
<resolvers>
<url name="https://my-internal-repo.com/artifactory">
<ivy pattern="https://my-internal-repo.com/artifactory/webapp/#/artifacts/browse/tree/General/Maven-JCentral-cache/org/apache/ivy/ivy/2.2.0/ivy-2.2.0-sources.jar"/>
<artifact pattern="https://my-internal-repo.com/npm-remote-cache/mongodb/-/mongodb-3.1.13.tgz"/>
</url>
<filesystem name="internal">
<ivy pattern="${repository.dir}"/>
<artifact pattern="${repository.dir}"/>
</filesystem>
</resolvers>
<modules>
<module organisation="com.myOrg.*" name=".*" resolver="internal"/>
</modules>
</ivysettings>
2.ii. 我的ivysettings-file.properties文件如下:
ivy.settings.dir=C:\Users\Documents\NetBeansProjects\ANTProject\JavaApplication1,
cache.dir=C:\Users\Downloads\IVYCache,
repository.dir=C:\Users\Downloads\repodir
2.iii. 我的build.xml文件如下:
-
我已经在系统的环境变量中添加了IVY_HOME。
-
现在,当我从命令行输入"ant"命令时,从我的根文件夹(也就是我有build.xml文件的地方)执行构建成功,但在构建日志中,我看不到关于Ivy的任何信息。我认为它没有读取我的ivy设置。我应该如何修复它,并且我如何验证我的ivysettings.xml是否被读取,因为我必须限制Netbeans从我的内部仓库下载所有依赖项。
英文:
I want to download all dependencies/jars in my Ant project (Running on Netbeans) from my internal repository.
-
I have installed ivy jar and placed it in my Apache ant's lib folder.
-
I have kept ivysettings.xml in my root folder (where I have my build.xml)
2.i. My ivysettings.xml file is:
<ivysettings>
<properties file="${ivy.settings.dir}/ivysettings-file.properties"/>
<settings defaultResolver="https://my-internal-repo.com/artifactory"/>
<caches defaultCacheDir="${cache.dir}" checkUpToDate="false"/>
<credentials host="https://my-internal-repo.com/artifactory" realm="Artifactory Realm" username="usrname" passwd="ABCD"/>
<resolvers>
<url name="https://my-internal-repo.com/artifactory">
<ivy pattern="https://my-internal-repo.com/artifactory/webapp/#/artifacts/browse/tree/General/Maven-JCentral-cache/org/apache/ivy/ivy/2.2.0/ivy-2.2.0-sources.jar"/>
<artifact pattern="https://my-internal-repo.com/npm-remote-cache/mongodb/-/mongodb-3.1.13.tgz"/>
</url>
<filesystem name="internal">
<ivy pattern="${repository.dir}"/>
<artifact pattern="${repository.dir}"/>
</filesystem>
</resolvers>
<modules>
<module organisation="com.myOrg.*" name=".*" resolver="internal"/>
</modules>
</ivysettings>
2.ii. My ivysettings-file.properties is:<br/>
ivy.settings.dir=C:\Users\Documents\NetBeansProjects\ANTProject\JavaApplication1,<br/>
cache.dir=C:\Users\Downloads\IVYCache,<br/>
repository.dir=C:\Users\Downloads\repodir<br/>
-
Now when I am entering command "ant" from my root folder (where I have my build.xml) from cmd the build is successful but I cant see a word about Ivy on cmd in build logs. I think its not reading my ivy settings. how can I fix it and how will I verify that my ivysettings.xml is read bcoz I have to restrict my netbeans to download all dependencies from my-internal-repository.
Please do let me know what else I am missing ?
答案1
得分: 2
你的 ivy-2.2.0-sources.jar 可能只包含了 Ivy 的源代码,而没有编译后的类文件,你或者 Ant 可能需要尝试下载 ivy-2.2.0.jar。
英文:
your ivy-2.2.0-sources.jar might only contain the sources of ivy not the compiled classes you or ant would need, try to download ivy-2.2.0.jar.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论