2016-08-20 69 views

回答

0

虽然这些可能还不够,但我已经编译了一些将模块从ant转换为maven的常用实践。

  1. 完全删除您的build.xml。你不得不再次重写它,因为maven完全不使用它。
  2. 引入新的pom.xml
  3. 使用maven-compiler-plugin定义<mainClass>src.com.test.Main</mainClass>中的主类。请参阅this的答案。
  4. 对于您在build.xml中使用的.jar,请在线搜索其依赖关系,然后在pom.xml中添加。您还可以添加local dependencies in your pom.xml
  5. 将您的图像,文本,音频,视频,文档,pdf,xml传输到资源文件夹。 (另请参阅:What is the purpose for the resource folder?

有关更多最佳实践,请参阅此答案。
Moving onto Maven Anyway...