Maven publish pom.xml dependencies?

I can’t understand why the publish plugin did not output any dependencies.

This structure publishes the jar but there is no dependencies in the pom.

zips(MavenPublication) {
            artifact jar
}

When I changed to

zips(MavenPublication) {
            componets.java
}

I got the expected dependencies in the pom.

What causes the difference?

Well, the difference is in what you say you want. In the first case you say “just publish this artifact without any further information” which almost always is a bad idea. I’m the second case you tell to publish the Java component which has the information about artifacts to publish - including sources jar, JavaDoc jar, feature variant jars, … -, the dependencies to put in the pom, and so on.