-3

I'd like to know the rational order of the commands mvn eclipse:eclipse & mvn clean install in order to successfully build a project for Eclipse.

Which one should be ran first?

EDIT: The commands are an obligation of my software company, I can't use any other procedure than the one already implemented, thus any plugin like M2Eclipse.

Mikahel
  • 81
  • 1
  • 15
  • Possible duplicate of [Maven in Eclipse: step by step installation](http://stackoverflow.com/questions/8620127/maven-in-eclipse-step-by-step-installation) – Tunaki Oct 12 '16 at 08:57
  • Don't use `mvn eclipse:eclipse`. The plugin is retired and doesn't interact well with other Eclipse's features. Use M2E, check the linked question. – Tunaki Oct 12 '16 at 08:58
  • @Tunaki it's a completly different issue. I'm not asking about the installation of Maven plugins, but about building a project for Eclipse. – Mikahel Oct 12 '16 at 09:17
  • Yes, and to do that in Eclipse, you need a declared Maven project in Eclipse. Which is done with the help of the M2Eclipse plugin. – Tunaki Oct 12 '16 at 09:19
  • @Tunaki please don't downvote my question when the term clean install doesn't exist in your QA issue. I red thoroughly your issue and I'm insisting that my need is different than yours. – Mikahel Oct 12 '16 at 09:25
  • 1
    Do you know what `eclipse:eclipse` is doing? It doesn't build anything. – Tunaki Oct 12 '16 at 09:27
  • What do you mean by "build a project **for** eclipse"? eclipse:eclipse only sets up metadata so eclipse can resolve dependencies in the sources. clean install builds the project **without** any eclipse things. Clarification would be great! – Florian Albrecht Oct 12 '16 at 09:27
  • @FlorianAlbrecht `eclipse:eclipse` sets the metadata and make the project readible (built) for Eclipse, `clean install` builds the Java code. My question is, which one to run first. That's all. – Mikahel Oct 12 '16 at 09:33
  • Yes, that's **exactly** what I wrote. If you want to build the project, you do not need to call eclipse:eclipse at all. Run mvn clean install and you are done. That's why I asked what you mean with "build for eclipse". Either you build on console, or you build **with** eclipse, or you set up metadata **for** eclipse, but you do not build for eclipse, except for eclipse plugins... – Florian Albrecht Oct 12 '16 at 09:35
  • `mvn clean install` has absolutely no link with Eclipse _at all_. It is a Maven command. Not an Eclipse thing. Those two commands, `mvn eclipse:eclipse` and `mvn clean install` are completely unrelated, the first one is a hack to get things working _for Eclipse_, while the other is a standard Maven command that works with Maven alone on the command line. So it is unclear what you're asking. – Tunaki Oct 12 '16 at 09:36

1 Answers1

2

You should not use eclipse:eclipse these days for Eclipse. The m2eclipse plugin provides decent Maven support directly inside Eclipse and I highly recommend using that instead.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347