如何将 pom.xml 转换为 build.xml [英] how to convert pom.xml to build.xml

查看:26
本文介绍了如何将 pom.xml 转换为 build.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是这个领域的新蜜蜂.

Am a new bee in this area.

在 pom.xml 中有一个部分,如下所示,我需要在 ant buid.xml 中进行更改.

Got a part in pom.xml like below which i need to change in ant buid.xml.

我该怎么做?我可以从教程中获得任何帮助,或者任何人都可以解释什么

How do i do it? Can i get any help from tutorial or anyone can explain what

<dependency>
    <groupId>com.ask.core</groupId>
    <artifactId>wzlogging</artifactId>
    <version>1.5</version>
    <exclusions>
        <exclusion>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.glassfish.extras</groupId>
            <artifactId>glassfish-embedded-all</artifactId>
        </exclusion>
    </exclusions>
</dependency>

推荐答案

理论上可以生成 ANT 构建文件(使用 XSLT?),但需要了解每个插件实现的逻辑.实际上,只有简单的 Maven 构建才是可行的候选.

In theory it's possible to generate a ANT build file (using XSLT?), but one would need to understand the logic that each plugin implements. In practice only simple Maven builds are feasible candidates.

ANT 和 Maven 是非常不同的构建技术.在 ANT 中,您将所有构建逻辑明确写入build.xml"文件中.另一方面,Maven 具有大部分功能.pom.xml"不包含任何逻辑,而是用于记录有关项目的元信息(例如依赖项列表).

ANT and Maven are very different build technologies. In ANT you explicitly write all the build logic into the "build.xml" file. Maven on the other hand has most of it's functionality baked in. The "pom.xml" contains no logic instead is used to document meta information about the project (for example the list of dependencies).

来自 ANT 世界,这可能会非常令人困惑,尤其是当您想要自定义构建时.在 Maven 中,这是通过声明插件来完成的,这些插件了解标准构建生命周期并能够将自己插入到构建的正确部分.

Coming from an ANT world this can be very confusing, especially when you want to customise your build. In Maven this is done by declaring plugins, which understand the standard build life-cycle and are able to insert themselves at the correct part of your build.

这个长篇大论的解释的目的是要明白,仅仅通过查看 POM 文件是不可能知道你的插件在做什么的.

The purpose of this long-winded explanation is to understand that it's really impossible to know what your plugin is doing by only looking at the POM file.

@Perception 推荐常春藤.以下答案是相关的(从 ANT 转换为 Maven):

@Perception recommended ivy. The following answer is related (Convert from ANT to Maven):

这篇关于如何将 pom.xml 转换为 build.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆