[GRADLE-2945] maven-publish plugin does not add excludes to generated pom Created: 01/Nov/13  Updated: 03/Jul/14  Resolved: 02/Jul/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 2.1-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 12


 Description   

I build a gradle project with:

gradle clean publishToMavenLocal

In the build.gradle file I need to exclude all transitive dependencies for 'commons-jxpath'

dependencies {
compile("commons-jxpath:commons-jxpath:1.2") {
exclude group: '*'
}

But in the generated pom nothing is set to exclude:

<dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
<version>1.2</version>
<scope>runtime</scope>
</dependency>

I would expect:

<dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
<version>1.2</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>

Do I specify the exclusion for the dependency incorrectly or is it not supported in the maven-publish plugin (worked with the maven plugin)



 Comments   
Comment by Gradle Forums [ 01/Nov/13 ]

Excludes are not (yet) supported by the maven-publish plugin. You'll need to use `pom.withXml`.

Comment by Gradle Forums [ 01/Nov/13 ]

Is there a feature issue for this eg. GRADLE-XYZ/Fix version?

Comment by Gradle Forums [ 01/Nov/13 ]

Any updates on this? Is there a JIRA ticket for this we can watch and vote for? Thanks.

Comment by Fedor Belov [ 16/Dec/13 ]

This bug makes `maven-publish` plugin totally useless

Comment by Maarten Dirkse [ 03/Jul/14 ]

Thanks Biswa!

Generated at Wed Jun 30 12:35:39 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.