- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 build.xml
中有一个任务:
<target name="init" depends="init-ivy">
...
<ivy:cachepath
inline="true"
module="jersey-container-servlet"
organisation="org.glassfish.jersey.containers"
pathid="jersey.classpath"
revision="2.23.2" />
...
</target>
此任务会在必要时下载 ivy(init-ivy
实际上会这样做),然后调用 ivy 来下载依赖项。它将 jersey.classpath
设置为结果。
现在我的build
任务依赖于init
任务。所以每次我构建时,它都会检查是否需要安装依赖项。我想避免每次都检查依赖关系,并将 build
与 init
分开。但是 init
设置 jersey.classpath
并且 build
使用它。
有没有办法从 ivy 获取 jersey.classpath
而不要求它检查依赖关系?在这种情况下不检查依赖项甚至是一个好习惯吗?
最佳答案
如本回答中所述,ivy 不会在每次运行时都下载 jar。它在“~/.ivy2/cache”下本地缓存它们:
其次,您在内联模式下使用 ivy,大概是为了避免创建 ivy file ? Ivy cachepath分类为 post resolve任务,这意味着它将自动调用 resolve任务,在后台。内联模式所做的是告诉 ivy 每次执行新的解析,如果您要管理多个类路径,这是一种浪费。
最后你考虑过使用 ivy 文件吗?一次调用 resolve task 可以处理项目的所有依赖项,在本地缓存此信息,然后确定是否需要下载文件。我建议始终解决依赖关系。它的成本不高,并且构建之间可能发生了变化(例如,如果您使用的是动态依赖项或 Maven 快照)。
这是我的 Ivy 标准 Ant 目标:
<available classname="org.apache.ivy.Main" property="ivy.installed"/>
<target name="resolve" depends="install-ivy">
<ivy:resolve/>
<ivy:report todir='${ivy.reports.dir}' graph='false' xml='false'/>
<ivy:cachepath pathid="compile.path" conf="compile"/>
<ivy:cachepath pathid="runtime.path" conf="runtime"/>
<ivy:cachepath pathid="test.path" conf="test"/>
</target>
<target name="install-ivy" unless="ivy.installed">
<mkdir dir="${user.home}/.ant/lib"/>
<get dest="${user.home}/.ant/lib/ivy.jar" src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar"/>
<fail message="Ivy has been installed. Run the build again"/>
</target>
注意事项:
关于java - 如何获得 Ivy :cachepath location without checking if dependencies downloaded,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39313778/
我正在为 Google Chrome 制作一个使用 Downloads API 的扩展程序。我想从网站下载 .jpg 文件。 我已在 list 中使用了这些权限: "permissions": ["d
在函数 chrome.downloads.download 的文件名参数中使用某些字符开始下载时导致“文件名无效”错误。我在文档中找不到任何信息并替换例如:使用 %3A 或 : ;不起作用。 有问题的
我正在尝试创建一个可以一次下载多个文件的扩展程序。 为了实现这一点,我正在使用 chrome 下载 api,这是代码(使用 AngularJS): var fileDownloadProperties
我在 Android 9 中没有遇到这个问题,在 Android 10 中我选择退出 Legacy Storage。但是在 Android 11 中,我无法打开从下载管理器下载的文件。但是,可以从文件
当我尝试在我的应用程序中使用它时,Chrome 告诉我 chrome.downloads 未定义。 这是一个我尝试下载图像的简单示例... list : { "manifest_version":
我正在客户端生成一些内容,我想使用 chrome.downloads.download 下载生成的内容。请注意,下载工作正常,但不知何故下载的文件不包括新行(我使用添加新行 lineContent +
当我执行 chrome.downloads.download 时, 它下载文件并弹出底部的下载栏并显示它,我可以抑制它吗? 例子: /* some code to suppress download
我正在处理超过 100 000 行的表,并使用 DT 包(开发版本 0.1.56)在 Shiny 应用程序中将其可视化。 此外,我使用 DT 扩展作为:按钮,以下载不同格式的数据。然而,虽然 Scro
我想从我的 Google Chrome 扩展程序中完全保存一个网页。我添加了 "downloads", ""权限并确认以下代码将 Google 页面保存到 google.html . chrome
chrome.downloads.download 的默认行为是下载到默认下载文件夹。如果您更改文件夹,它不会记住它。我们可以保存下一次调用的下载位置吗? 引用文献:https://developer
我正在开发 chrome 扩展,我想为可下载文件设置下载位置。所以我正在使用 chrome.downloads.download API saveAs:true。它在 Windows 操作系统中工作正
在 Android 中使用 StorageReference.getStream() 和在 iOS 中使用 FIRStorageReference.dataWithMaxSize 完成的存储文件下载是
更新 我已经通过使用 Blob URL/Object-URL ( URL.createObjectURL(blob) )解决了这个问题(感谢 @DanielHerr ),但是我仍然很好奇为什么在使用
我正在使用 HTML、CSS 和 JS 构建一个小型网站示例项目。 我有一个按钮,点击后应该下载 PDF 示例数据(现在不需要将文档保存在哪里)。 问题:如何使用 HTML 下载 PDF 文档按钮?
我正在从 data.gov 网站下载数据,在此过程中出现以下两种类型的错误: fileUrl = 8 x64 (build 9200) 你必须切换你的 R,从 32-bit至 64-bit避免'cur
我想检查使用 Selenide download() 方法下载文件,但捕获 FileNotFoundException 和错误“拦截 1 个响应”,尽管文件已下载。 我有按钮,点击它会下载一个 zip
“下载管道工件”和“下载构建工件”之间有什么区别?应该使用哪一个?何时使用? 最佳答案 管道工件: 提供一种在管道中的阶段之间或不同管道之间共享文件的方法。它们通常是构建过程的输出,需要由另一个作业使
我们正在尝试从chrome://webrtc-internals下载日志,该方法是在接受调用后在 Electron 后台打开chrome://webrtc-internals,并在 Electron
好吧,所以我前段时间写了这个函数,它运行良好。 基本上我正在下载一个文件,然后检查 chrome://downloads/中是否有 n 个项目以及文件名是否匹配 this.checkDownload
我正在使用 Node + Express 开发一个简单的网络服务器。让我解释一下我遇到奇怪问题的部分。 使用外部脚本(dropbearkey)我生成一个 key 对,生成的私钥存储在服务器的文件系统上
我是一名优秀的程序员,十分优秀!