0

i have a maven project where i am using versions-maven-plugin to ensure that for few artifacts only the latest version will be used. These artifacts are included via <include>....</include> tag.

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>update-versions</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>use-latest-versions</goal>
                        </goals>
                    </execution>
                </executions>
                <!-- add your Mosaiq dependencies here to stay up to date -->
                <configuration>
                    <includes>
                        <include>mygroupid:myartifactid</include>
                    </includes>
                </configuration>
            </plugin>

My question is do i need to mention above artifact in <dependency>..</dependency> as well or versions-maven-plugin will automatically take care of that and will download the latest version.

rohit
  • 177
  • 4
  • 12

1 Answers1

1

Yes, you have to add them as a dependency first.

The task versions-maven-plugin:use-latest-versions will update the versions of existing dependencies only.

There are no maven plugins that magically add dependencies AFAIK.

GeertPt
  • 16,398
  • 2
  • 37
  • 61
  • Thanks for the response. i believe same will happen in case of versions-maven-plugin:use-latest-releases as well ? – rohit Sep 16 '20 at 12:08