I have a very simple Gradle project which generates a jar file, and I am applying the maven-publish plugin and calling the publish
task to publish artifacts to Artifactory:
build.gradle:
apply plugin: 'maven-publish'
command:
./gradlew :my-test-project:publish
This works fine and it publishes the artifact to Artifactory, however I see that the latest
tag in the metadata xml is updated only intermittently:
maven-metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>com.test.group</groupId>
<artifactId>my-test-project</artifactId>
<versioning>
<latest>0.0.3</latest>
<release>0.0.7</release>
<versions>
<version>0.0.1</version>
<version>0.0.2</version>
<version>0.0.3</version>
<version>0.0.4</version>
<version>0.0.5</version>
<version>0.0.6</version>
<version>0.0.7</version>
</versions>
<lastUpdated>20181027171631</lastUpdated>
</versioning>
</metadata>
Gradle version is 4.10.2. How can I ensure that the latest tag reflects the latest version? How is the publish plugin deciding that the current version is not latest? I am stuck on this.