How to update maven in ubuntu using command

I am using Ubuntu 11.10 and I have Maven 3.0.3 installed. Now I want to upgrade it to Maven 3.0.4 due to some problem with the surefire plugin. But I do not know how to do this from the command line.

Does anyone have any ideas?

+8
maven ubuntu
source share
4 answers

You can simply define the maven-surefire-plugin version in the pluginManagement section of your pom or better at pom.

<build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12.3</version> </plugin> ... </plugin> </pluginManagmenet> </build> 

If you do not already have a company, your assembly will not play, which means that if you change the version of your maven, your assembly will use a different version of the plugin, which is true for all plugins. In addition, it is best to determine the version of the plugins in the assembly. No need to update Maven. You can if you have problems with Maven, but not for plugins.

+4
source share

I just did this .... I am exchanging Maven 3.0.3 at the moment Maven 3.2.1 I have taken the following steps:

  • Uninstall the old version of maven:

     > sudo apt-get remove maven > sudo apt-get update 
  • Installing the new version: Now I have improved my knowledge of Linux. I prefer to install the software manually;)
    So ... I followed the instructions for installing Apache at http://maven.apache.org/download.cgi , and then I added these lines in the .baschrc file:

      export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.1 export M2=$M2_HOME/bin export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m" export PATH=$PATH:$M2 

I hope this will be helpful to someone.

+13
source share

Why do you need to do this from the command line? Even if your distribution does not provide the update you need, installing Maven only requires downloading the archive, unpacking it in a suitable folder, and setting a couple of environment variables.

You can find official installation instructions here.

+1
source share

you're right, you could use both or more, and switch the M2_HOME setting to .profile, but I don't need the old one, and I think there is only one clearer. In any case, thanks, maybe someone needs more than one version, and may find this post interesting.

0
source share

All Articles