If you know your dependency versions are specified in the dependency
or dependencyManagement
blog and the version is not a property you can use use-dep-version:
mvn versions:use-dep-version -Dincludes=io.netty:netty-all -DdepVersion=1.0 -DforceVersion=true
However if the version is specified as a property, the use-dep-version
will not work.
Then you can only use versions:*-property
commands but for this you need to know the name of the property (which could be achieved by having a naming convention for these properties)
mvn versions:set-property -DnewVersion=1.0 -Dproperty=netty-all.version
if you need more safety that the version you will use is valid or to avoid downgrades have a look at update-property.
If you project is mixed with versions and property versions you could just run both commands and one will change it.
UPDATE 2024: Maven goal use-dep-version
now has attribute processProperties, which if set to true
will cause also properties to be changed. There is no need for using versions:*-property
anymore.