Let's take this example:
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
</dependencies>
I know want to set <version>
to be something of my choosing.
Something like
mvn dependency:set-version <groupId>:<artifactId> <version-number>
Specifically for slf4j, I might want:
mvn dependency:set-version org.slf4j:slf4j-api 1.7.24
I know I can use various auto-update methods/plugins to "bump" the version, but I don't want that. I want to set a specific version. The command should be flexible enough to accept anything as a version, or at least it should accept versions that can't currently be retrieved by Maven.
Note that I also want to avoid extracting the dependency version into a property that I set by other means.
I'm not looking for any solutions that involve the usage of the parent POM, or anything like that.
Simply stated, the solution should be a mvn
specific command that would replace, say, an invoication of sed
to simply force the dependency version.