CCNA
CCNA

Reputation: 387

migration an Maven projet from eclipse to a command line environment

I got an Maven project which is compiled in Eclipse. Now I need to migrate it to a Linux environment, and there won't be GUI interface I can use. I wonder what I should do to migrate it?

Currently , under Eclipse project folder I have the files/folders as the below:

I figure all those .* folders are Eclipse meta data. so I can remove them. Then I can use the rest to form a Maven project that I can build using Maven command lines?

Upvotes: 1

Views: 216

Answers (2)

Jigar Joshi
Jigar Joshi

Reputation: 240928

mvn clean
  • then remove .project .classpath

  • if you want to lose eclipse project settings while migrating delete .settings (assuming it doesn't have machine specific path/settings)

  • copy rest to new linux environment

  • open eclipse, import project as maven project (assuming you have new eclipse with maven plugin setup on linux environment)

Note:

  • make sure you still have a backup before you successfully migrate over
  • .classpath contains references to local .m2 when used with eclipse and maven so the path would differ in linux and would create issue
  • .project contains some configuration that is eclipse maven plugin dependent, so it is good to loose it once and let new environment create new one

Upvotes: 1

adarshr
adarshr

Reputation: 62603

For a maven project to work command line, all you need is

  1. Maven is installed and correctly exported in the $PATH variable
  2. The pom.xml in your workspace.

Just go to the project directory and run mvn install.

Upvotes: 1

Related Questions