@geissld the metadata should only carry the information about what is needed to build/run the component. By default, the war packages the dependencies, so no external dependencies are needed. I think in general the current behavior is correct.
I am not sure I completely understand your use case. But if I read it correctly, you are using a “war” similar to a “jar”. I.e. you do not need/use the packaged dependencies, but you want the dependency information in the pom instead.
If that is correct, I would suggest to not use the war plugin, but instead use the java-library plugin and just change the extension of the jars to war. Something like:
plugins {
id 'java-library'
id 'maven-publish'
}
jar.archiveExtension.set("war")
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom.packaging = "war"
}
}
}