Skip to content

4.0.0.M1 / gradle 5 - global configuration excludes leak into plugin maven pom #11257

@zyro23

Description

@zyro23

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. create a plugin
  2. add a dependency (e.g. compile "org.springframework:spring-messaging:5.1.5.RELEASE")
  3. run gradle(w) generatePomFileForMavenPublication
  4. check build/publications/maven/pom-default.xml

Expected Behaviour

the dependency should not have any exclusions in the pom file, i.e.:

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-messaging</artifactId>
  <version>5.1.5.RELEASE</version>
  <scope>compile</scope>
</dependency>

Actual Behaviour

the dependency has grails-specific exclusions that are not related to the actual dependency:

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-messaging</artifactId>
  <version>5.1.5.RELEASE</version>
  <scope>compile</scope>
  <exclusions>
    <exclusion>
      <artifactId>grails-plugin-async</artifactId>
      <groupId>org.grails</groupId>
    </exclusion>
    <exclusion>
      <artifactId>grails-plugin-events</artifactId>
      <groupId>org.grails</groupId>
    </exclusion>
    <exclusion>
      <artifactId>grails-plugin-converters</artifactId>
      <groupId>org.grails</groupId>
    </exclusion>
    <exclusion>
      <artifactId>grails-plugin-gsp</artifactId>
      <groupId>org.grails</groupId>
    </exclusion>
    <exclusion>
      <artifactId>grails-plugin-testing</artifactId>
      <groupId>org.grails</groupId>
    </exclusion>
  </exclusions>
</dependency>

possible cause

i think the exclusions are defined here: https://github.com/grails/grails-core/blob/v4.0.0.M1/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy#L186-L189

and i would guess this is likely due to a change of behavior by gradle(-5)?

workaround

what i am currently doing is this (build.gradle) :(

publishing {
    publications.first().pom.withXml {
        asNode().dependencies.dependency.exclusions*.replaceNode {}
    }
}

Environment Information

  • Operating System: win x64
  • Grails Version: 4.0.0.M1
  • JDK Version: 8u131
  • Container Version (If Applicable): n/a

Example Application

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions