简体   繁体   中英

Can I convert Eclipse Project to maven using command line?

The issue I have is that I have to work in an Eclipse version that doesn't allow any additional Plugins and hence, installing maven is not an option.

However, I am wondering whether I can still use command line to create my maven project.

If I create a maven project from command line, Eclipse -> File -> Import didn't work. I tried to create my maven project inside eclipse project folders and I got a maven folder structure inside my original eclipse project. Using the eclipse IDE I renamed the src folder and instead called the Maven created structure 'src'. That created a mess because I cannot create packages instead these folders.

Best Regards,

The M2e plugin Eclipse is strongly recommended to work on a Maven project in Eclipse.
If you have network constraints to install it from classic Eclipse plugin installation, you may still install it by building the source code of the plugin .

As an alternative, you could use the Apache Maven Eclipse Plugin that relies on Maven only and not Eclipse. Using it allows to generate Eclipse classpath according to the pom dependencies.
Particularly : mvn eclipse:eclipse that generates the Eclipse configuration files.

The Maven Eclipse Plugin is used to generate Eclipse IDE files (*.classpath, *.project, *.wtpmodules and the .settings folder) for use with a project.

But it is deprecated and is not maintained any longer. So I cannot recommend it.

Disclaimer: Users are advised to use m2e, the Eclipse Maven Integration instead of this plugin, as it can more closely resemble the actual build and runtime classpaths as described in the project pom.xml - among other advantages. However, there are project setups and workflows that still work more efficiently with statically generated Eclipse metadata - for example when there is a large number of projects in a reactor. That's where the Maven Eclipse Plugin can still help you.

Which version of Eclipse you are using ? You can apply plugin. Also, make sure your proxy should not block the eclipse to download the plugins. For proxy settings, refer setting.xml in conf folder of maven.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM