maven转java项目,如何将Java项目转换为Maven项目或类似项目

I am currently creating an application for compiling multiple java projects in one go for programming assignments. As there are many different ways to submit java projects(e.g. as eclipse project, as netbeans project, as jar file) is there a plugin of something similar that you can easily import or use in a project that will convert a java project to a maven project so they can all be compiled in the same way rather then having to create functionality to allow the program to compile all different types of java projects?

If not to maven projects, is there another way to accomplish what i am trying to do?

解决方案

In my opinion, there is no such tool to mavenize just freestyle Java project just like that. Maven is based on some own conventions that are not necessarily common. It's not just about where Java files are, but also where the resources are (e.g. they can be at a same directory with Java files), where other assets are (e.g. WSDL files), what are these assets, how to handle them and how to use all this stuff to successfully build final package. I think there's no chance to have such universal tool that can do this.

I think the best scenario one can imagine here is to figure out some common assumptions about projects you have to build, e.g. they can only contain Java sources and just regular resources. Then you can implement some script or program that scans such simplified Java project to know where all these files are. And even then, what about dependencies? Should you scan Eclipse/Netbeans/IDEA specific files for them? It's really hard to even create these assumptions that make projects simple enough to auto-mavenize.

As I said, I really don't believe you can do something better than just enforce projects to be already Maven-managed.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值