Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Steps to "Mavenize" a Eclipse or NetBeans project with the help of Subversion?

The process of mavenizing Eclipse and NetBeans projects usually takes a lot of manual work, if all files are under revision control.

So I am thinking of writing an Ant script which uses svn commands to rearrange the files in the working copy according the standard Maven directory layout. This would keep all file revision histories intact. If all files have been moved to the correct places, the new directory structure would be committed together. (Instead of invoking many small move commands in the repository).

Do you know resources which could help me to find the correct 'migration' strategy for standard Eclipse or NetBeans projects (including web projects)?

For example, an overview of Eclipse and NetBeans directory structures for standard Java and Web / EJB projects would be helpful.

like image 599
mjn Avatar asked Dec 05 '09 10:12

mjn


2 Answers

I have written a tool which should get you some of the way. It's called 'mavenize'. This will scan any number of existing projects and generate a mavenized version of any 'src' directories it finds. It will create the directory structure and drop java files under 'java' and anything else under 'resources'. I've used it a fair bit and it's a good time saver. Get it here:

http://code.google.com/p/mavenize-tool/

like image 186
alrutherford Avatar answered Nov 13 '22 04:11

alrutherford


I don't know any tools/scripts that do what you want, but some my tips maybe help you to alleviate pain.

  1. I recommend m2eclipse plugin for eclipse Maven integration. It is very helpful and has very good documentation.
  2. Try first create a working Maven project, but don't change project structure. POM and lot of maven plugins have plenty of configuration params for projects thouse not adhere to default maven project conventions.
  3. If it will be working and you still will want change project structure, that won't be a problem to remove additional configuration and perform VCS move/rename operations.

To see "Build" tab you have to switch to "Advanced tab view"

alt text http://img189.imageshack.us/img189/7041/m2eclipse.png

like image 40
cetnar Avatar answered Nov 13 '22 02:11

cetnar