将 Ant Web 应用程序项目转换为 Maven 项目 [英] Converting Ant Web Application Project to Maven Project

查看:28
本文介绍了将 Ant Web 应用程序项目转换为 Maven 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在使用 Ant 构建的正在运行的代码项目,现在我需要将它转换为 maven,我浏览了解决方案,我所做的只是创建一个新的 maven web 项目并将我的所有 src 文件添加到 src/main/java 和所有 xml 文件(例如 security.xml、tiles-config.xml、web.xml、properties 文件、jsp 文件夹等)到 webapp/web-inf/文件夹.到目前为止,这是正确的吗??

Hi I have a running code project build using Ant now what i need is to convert it to maven , i browse for the solution and what i done is simply creating a new maven web project and added all my src files to src/main/java and all the xml files (e.g security.xml,tiles-config.xml,web.xml,properties files,jsp folder etc) to webapp/web-inf/ folder. Is that correct so far ??

主要问题是如何创建 pom 文件,我的意思是因为我使用了很多 jar 来支持代码,如何在我的 pom 文件中提及它..我必须为每个文件提及吗?请给出一个想法..

The main question how to create a pom file , I mean as I used a lot of jar to support the code , how to mention that in my pom file ..Did I have to mention for each one of them ?? Please give an idea ..

推荐答案

我开发了一个脚本来将遗留的 ANT 项目转换为 Maven 基础设施:

I developed a script to transition legacy ANT projects to a Maven infrastructure:

它专注于生成依赖项列表,Apache ivy 插件从 Maven 存储库下载.它还能够为那 5-10% 永远无法识别的 jar 文件创建一个本地存储库(没有人记得是谁将它们添加到项目中...)

It focuses on generating a list of dependencies, which the Apache ivy plugin downloads from Maven repositories. It is also able to create a local repo for those 5-10% of jar files that can never be identified (nobody remembers who added them into the project...)

此代码可用于生成 Maven POM,这是我一直在考虑的一项工作.问题在于,以无缝方式将 ANT 项目切换到 Maven 真的很困难……Maven 具有一组标准化的生命周期操作,而 ANT 构建脚本是自由格式的.这就解释了为什么我专注于依赖管理.

This code could be adapted to generate a Maven POM, a piece of work I've been considering. The problem is that it's really hard to switch ANT projects over to Maven in a seamless manner.... Maven has a standardized set of life-cycle actions, whereas ANT build scripts are free-form. This explains why I concentrated on dependency management.

这篇关于将 Ant Web 应用程序项目转换为 Maven 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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