Mark Lybarger
Mark Lybarger

Reputation: 463

how to get maven to update a specific version dependency

i'm kinda new to maven after coming from a simple yet uncouth ant world.

<dependencies>
    <dependency>
        <groupId>com.foo.bar.EPT</groupId>
        <artifactId>EPTUtils</artifactId>
        <version>1.2.9-SNAPSHOT</version>
        <scope>compile</scope>
    </dependency>

I'm looking for a maven command to specifically update this version to 1.2.14-SNAPSHOT. I've tried

mvn -DallowSnapshots=true versions:use-latest-snapshots -Dincludes=com.foo.bar.*

but that didn't update what i had in my local repo.

Upvotes: 1

Views: 1463

Answers (1)

user1907906
user1907906

Reputation:

Change

<version>1.2.9-SNAPSHOT</version>

to

<version>1.2.14-SNAPSHOT</version>

in the pom.xml of your Maven project. Then build the project.

mvn clean test package

Maven will download the dependency and store it in your local ~/.m2 repository.

Edit: Also see How do I tell Maven to use the latest version of a dependency? for more information about Maven and latest versions.

Edit 2: You can use the Versions Maven Plugin that as goals that can help you with that.

Upvotes: 1

Related Questions