Glory to Russia
Glory to Russia

Reputation: 18712

How to clear Maven 3 cache

I develop an Android application using Maven.

I removed several depdendencies from the pom.xml file, then ran mvn clean install and noticed that the removed dependencies are still used in dex invocation (android-maven-plugin:3.5.0:dex).

I deleted .m2/cache directory and put following code in my settings file as an attempt to fix this problem:

<settings>
    <profiles>
      <repositories>
        <repository>
          <releases>
            <enabled/>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy/>
          </releases>
          <snapshots>
            <enabled/>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy/>
          </snapshots>
          <id/>
          <name/>
          <url/>
          <layout/>
        </repository>
      </repositories>       
    </profiles>
</settings>

But it didn't help.

How can make Maven aware of the fact that the old dependencies (which I removed from the POM) should not be used in compilation of the application?

Upvotes: 0

Views: 3093

Answers (1)

Alex Yarmula
Alex Yarmula

Reputation: 10667

I suggest running mvn dependency:tree and making sure that the dependencies you expect to be removed aren't pulled by something else.

Upvotes: 1

Related Questions