Is there any order in which maven deploying artifacts? From what i see i can say that it uploads all artifacts and at last it updates maven-medata.xml files
http://localhost:8000/mavenrepository/test1/com/mypackage/mavenproject1/1.0-SNAPSHOT/maven-metadata.xml http://localhost:8000/mavenrepository/test1/com/mypackage/mavenproject1/maven-metadata.xml
Now is it guaranteed that maven always upload this 2 files at last, after uploading other artifacts?
Maven always deploys the artifact files in the same sequence. It usually looks something like this:
As you can see, the first thing it does is it attempts to resolve the
maven-metadata.xmlfile at the artifact level in order to figure out, if this artifact has other versions and whether to generate a brand newmaven-metadata.xmlfile, or update the existing one, (if there is such), with the new version that it's deploying. Themaven-metadata.xmlfile is always generated, or updated at the very end of the deployment.There are three levels at which
maven-metadata.xmlfiles can be located:groupId/artifactIdlevel, (for example, if yourgroupIdisorg.foo.examplesand yourartifactIdishello-world, the path will beorg/foo/examples/hello-world/maven-metadata.xml). This is used for the management of base, or release versions.groupId/artifactId/versionlevel, (for example, if yourgroupIdisorg.foo.examplesand yourartifactIdishello-worldand version is1.0-SNAPSHOT, the path will beorg/foo/examples/hello-world/1.0-SNAPSHOT/maven-metadata.xml). This is used for the management of timestamped snapshots.groupIdlevel and is used for the management of different plugins under the same plugin group.For a very detailed explanation of how Maven metadata works, have a look at this article I've put together.