Search code examples
mavenrepository

How to cache specific maven artifact into local repository?


Suppose I have some Maven coordinates, like

org.ow2.asm:asm:5.0.3

How would I cache these artifact into (existing) local maven repository?


Solution

  • In your pom.xml add under <dependencies> the following :

    <dependency>
        <groupId>org.ow2.asm</groupId>
        <artifactId>asm</artifactId>
        <version>5.0.3</version>
    </dependency>
    

    and use the command

    mvn clean verify
    

    at your project level to build the project and its dependencies to find the artifact in the corresponding .m2/repository folder.