Base command line for builds in Maven - maven

I am using apache maven version 3.5.0 in Eclipse. I have problem with this error - "org.apache.maven.plugins:maven-eclipse-plugin:2.10:eclipse". I guess it makes by wrong command in Preferences->Anypoint Studio->Maven->Base command line for builds. Now, I have command - "mvn eclipse:clean eclipse:eclipse -Dwtpversion=2.0".

The maven-eclipse-plugin is deprecated and should not be used. Actually, it can destroy your project.
Newer Eclipse versions (like Mars, Neon, Oxygen) have m2e included, which does all the Maven-Eclipse magic for you.

Related

Not sure whether maven is installed or not

I use intellij for development purpose on my mac. It has support of maven in it. But when I thought of running mvn command via terminal, it was not able to identify and maven on my system. Why?
Maven of your IDE (embedded maven) & Maven of your operating system are Different by default.
If you don't install Maven on your Op.System then you can't use Maven command line in your terminal.
If you have installed maven on your Op.System so probably you fall with 2 different maven version (IDE Embedded maven and Op.system maven)
To evoid this problem install maven on your Op.system (dont forget to configure env variable M2_HOME) and configure your IDE to use this installation of Maven.

Can't determine why maven is downloading a jar file

I am having an issue with log4j-api. I have specified log4j-api:2.8.1 in my pom but when running a mvn clean install command, mvn keeps insisting that I need log4j-api:2.1. If i delete the log4j-api:2.1 directory from my .m2/repository and do the mvn clean install command, it will say it is downloading the 2.1 version.
Here's the weird thing: If I do a mvn dependency:tree there is no mention of version 2.1, only 2.8.1.
Anybody understand why mvn dependency:tree would say my project is NOT dependent on version 2.1 but then downloads the 2.1 version when I run mvn clean install?
Some other versions we are using in case somebody knows that something could be causing this:
Spring Boot 1.2.1
Spring Framework 4.1.6
Elastic Java APIs 5.6.4
Get the dependency tree in verbose mode
mvn dependency:tree -Dverbose
From maven docs
More specifically, in verbose mode the dependency tree shows dependencies that were omitted for: being a duplicate of another; conflicting with another's version and/or scope; and introducing a cycle into the dependency tree.

Install m2e in eclipse without install maven in system

I recently try to use maven in my eclipse project. In maven official website there are several step that I must to accomplish to configure maven side by side with eclipse. But I know there is a m2eclipse plugins if I need to use maven. But I don't know if I can use this plugins with maven installed in system or not.
So can I use this plugins without maven been installed in system or not ?
The m2e plugin brings a copy of Maven 3.0.4 and installs it inside of Eclipse so the plugin can use it. This is enough to build Maven projects inside of Eclipse. No external installation is needed.
You must start Eclipse with a JDK, though. A JRE isn't enough. If you're unsure: Look for the file lib/tools.jar. When it's there: You're good.
This copy isn't accessible from the command line. If you want to build from the command line as well or if you need a newer version of Maven than 3.0, you need to install Maven and configure the plugin accordingly.

IntelliJ cannot find Maven M2_HOME environment variable

I'm trying to make my first step with Maven system. But I cannot understand if I should install it separately or if it comes built-in with IntelliJ 13 Community Edition? My system is Windows 7.
Maven does not come bundled with Intellij. You need to install the version of Maven you'd like to use on your computer.
Intellij has a Maven plugin, which requires that you either set M2_HOME or supply it with the location of your Maven install.
First you should it install it separately cause you will need it on command line. Furthermore it's best to understand maven on command line first and than make the integration step into Maven with an IDE of your choice.

Difference between mvn and mvn3 command

I have latest version of maven installed which is 3.0.4. A test at command line with mvn -version results in confirming this.
For all my maven commands I am using mvn but on several occasion on the internet I have seen people using mvn3 instead what is the difference between the two commands and why I am unable to use mvn3?
Seems like (according to How do I install Maven 3?), default installation of maven 3 on Ubuntu uses mvn3 symlink to mvn.
I can't find mvn3 command neither in 3.0.3 nor in 3.0.4. I believe mvn3 is only used to emphasize that maven 3 should be used as opposed to maven 2 (still popular). These two versions are significantly different so it's worth to make sure newer is used.

Resources