Dependencies of type pom do not work consistently

In a project at our company one team uses a maven project of type pom to group a couple of other dependencies. When using maven, one can use this dependency with

<dependency>
        <groupId>group</groupId>
        <artifactId>artifact</artifactId>
        <version>version</version>
        <type>pom</type>
    </dependency>

but in gradle, using

compile "group:artifact:version@pom"

does not work. I have to use

compile "group:artifact:version"

But when I define a dependency to another maven project, which does also have a dependency on the pom-type project, things go strange. Configurations.compile does not only contain jars, but also the pom

Example:

pom.xml:

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>gradlepomdependency</groupId>
    <artifactId>gradlepomdependency</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <dependencies>
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>all</artifactId>
            <version>1.5.0</version>
            <type>pom</type>
        </dependency>
    </dependencies>
</project>

build.gradle:

apply plugin: 'java'
apply plugin: 'maven-publish'
repositories {
    jcenter()
    mavenLocal()
}
dependencies {
    compile 'gradlepomdependency:gradlepomdependency:0.0.1-SNAPSHOT' // @pom does not work
}
  task listDependencies << {
    configurations.runtime.each System.out.&println
}
publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java
        }
    }
}

=> gradle listDependencies does list one pom and one jar, it should only contain the jar.

=> The generated maven pom file in generatePomFileForMavenJavaPublication does not define pom. The dependency will most probably not work when used from maven.

I think the issue is with the pom.xml. Does it work correctly if you remove pom from the definition? The point of using "@pom"is to override the default type of “@jar”.

If you remove

<type>pom</type>

from the dependency in the pom.xml, maven projects depending on it will not work anymore. The only way would be to also set

<packaging>jar</packaging>

in the pom.xml (or remove that line, as that is the default). But that would result in an empty jar, which might not be desired.