Converting Ant Web Application Project to Maven Project

人盡茶涼 提交于 2019-12-02 20:40:23

问题


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 ??

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 ..


回答1:


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

  • ant2ivy

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...)

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.



来源:https://stackoverflow.com/questions/15083245/converting-ant-web-application-project-to-maven-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!