【问题标题】:Does Visual Studio Code support Ivy as a dependency management for Java projects?Visual Studio Code 是否支持 Ivy 作为 Java 项目的依赖项管理?
【发布时间】:2020-02-20 05:21:48
【问题描述】:

我们公司有使用 Spring MVC(非引导)构建的遗留项目,并使用 Ivy 进行依赖管理,以及使用 Artifactory 的 repos。 我找不到任何关于 Ivy / Ant 的教程或支持,只能找到 Maven 类型的项目。

有没有人在使用 Ivy 的项目中使用 VS Code?​​p>

【问题讨论】:

    标签: java spring-mvc visual-studio-code ivy


    【解决方案1】:

    是的,你可以让它工作。您可以通过 Apache Ant 使用 ivy,并且有一个 plugin for Apache Ant available for Visual Studio Code

    这是一个示例 Ant 目标,它使用 Ivy 定义的目标来解决依赖关系。

    <!--override the common resolve task to use Ivy configuration here-->
    <target name="resolve" description="--> resolve and retrieve jar dependencies with ivy for all configurations.">
        <mkdir dir="${lib.dir}" />
        <!-- not usually necessary, ivy creates the directory IF there are dependencies -->
    
        <!-- the call to resolve is not mandatory, retrieve makes an implicit call if we don't -->
        <ivy:resolve file="${ivy.file}" conf="*" />
    
        <ivy:retrieve pattern="${lib.dir}/[conf]/[organisation]/[module]/[type]s/[artifact].[ext]" conf="*" />
    </target>
    

    【讨论】:

    • 它在多根工作空间中不起作用,对吧?收到错误消息“工作区没有 build.xml”
    • 这看起来会 ivy:resolve 进入项目的 lib 目录。好的。好的。但是,vscode 会使用该本地库来解析加载到编辑器中的 java 源代码中的 import 语句吗?这是最难的部分,而不仅仅是获得一个蚂蚁常春藤任务来解决问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-14
    • 1970-01-01
    • 2013-11-09
    相关资源
    最近更新 更多