4

I want to upgrade to a newer version of maven. For that I first want to remove the existing version of maven in the computer as told here. I tried:

sudo apt-get remove maven2

but it says:

$ sudo apt-get remove maven2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'maven2' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.

Then I typed mvn -version just to make sure that maven is not present, but to my surprise I found:

$ mvn -version
The program 'mvn' can be found in the following packages:
* maven
* maven2

Unsure of what to do next, I did locate maven and deleted everything that was present in /usr/share/maven-repo. But after this, if i type mvn -version, it shows the same output that was shown above.

How can I automatically remove maven?

Sanchit Jain
  • 150
  • 1
  • 3
  • 13

4 Answers4

3

Actually it shows that you already removed it. You can go ahead and use:

sudo apt-get install maven
Ammar
  • 131
2
sudo apt-get purge maven2 

Run this command and problem will be resolved.

muru
  • 207,228
1

Try

sudo apt-get remove maven

instead of maven2.

Pablo Bianchi
  • 17,371
Deepak N
  • 111
0

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project gamutkart: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.2:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>org.apache.maven.plugins:maven-war-plugin:2.2 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/home/laxman210/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.2/maven-war-plugin-2.2.jar [ERROR] urls[1] = file:/home/laxman210/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar [ERROR] urls[2] = file:/home/laxman210/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar [ERROR] urls[3] = file:/home/laxman210/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar [ERROR] urls[4] = file:/home/laxman210/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar [ERROR] urls[5] = file:/home/laxman210/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar [ERROR] urls[6] = file:/home/laxman210/.m2/repository/org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.jar [ERROR] urls[7] = file:/home/laxman210/.m2/repository/org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar [ERROR] urls[8] = file:/home/laxman210/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar [ERROR] urls[9] = file:/home/laxman210/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar [ERROR] urls[10] = file:/home/laxman210/.m2/repository/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar [ERROR] urls[11] = file:/home/laxman210/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar [ERROR] urls[12] = file:/home/laxman210/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar [ERROR] urls[13] = file:/home/laxman210/.m2/repository/org/apache/maven/shared/maven-filtering/1.0-beta-2/maven-filtering-1.0-beta-2.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]