1

I am trying to run following command line

mvn clean package -DskipTests

Reference: https://github.com/forcedotcom/dataloader/

I am getting this error message:

BUILD ERROR
Error resolving version for 'org.apache.maven.plugins:maven-shade-plugin': 
Plugin requires Maven version 3.0

How do I install Maven version 3.0 or is there way to modify file like POM.XML?

Java
  • 1,208
  • 3
  • 15
  • 29

3 Answers3

2

Without modifying your pom.xml, you can simply install and use mvn 3.x instead of mvn 2.x

Follow "Installing Apache Maven", and make sure your PATH reference that new version.
For instance, on Linux:

export PATH=/opt/apache-maven-3.5.0/bin:$PATH

If mvn --version does return the right version, try again your mvn clean package -DskipTests command.

With that approach (download and unzip an archive) you don't even need sudo apt-get install that you tried yesterday. Just download apache-maven-3.5.0-bin.zip.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Hi VonC, Thanks for comment. I have two questions. Do I have to follow all first section of "Installing Apache Maven" or just dive into "Unix-based Operating System (Linux, Solaris and Mac OS X) Tips"? Also, I am not sure what to do on this line "/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home". Do I just type this on the Command Line? – Java Jul 02 '17 at 12:57
  • @KingJava Yes, you can follow the first section, knowing that you can actually extract the `tar.gz` file anywhere you want, as long as you add the resulting folder to your `PATH` (in your `.profile`: https://stackoverflow.com/a/14638025/6309) – VonC Jul 02 '17 at 15:26
  • @KingJava The `/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/‌​Home` is just an example of what `echo $JAVA_HOME` could return: the goal of this section is to make sure you have a `$JAVA_HOME` already set, and that it is added to the `PATH` – VonC Jul 02 '17 at 15:27
0

If you are using Ubuntu it is enough to uninstall maven2 and install maven (which is version 3 currently):

sudo apt remove maven2

sudo apt install maven

Check your version with

mvn --version
Jacob Nordfalk
  • 3,533
  • 1
  • 21
  • 21
0

Package 'maven2' is not installed, so not removed

Bernt
  • 11
  • 1