Skip to content

Package the license and repo with the plugin #288

Open

Description

@mr-thierry

We cannot use this plugin internally because one of our tool flags it because the license is not packaged with the plugin.

For example check Dexcount Gradle Plugin. The license is properly packaged in the POM:

<licenses>
    <license>
        <name>The Apache Software License, Version 2.0</name>
        <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        <distribution>repo</distribution>
    </license>
</licenses>

There is no license in the modules-graph-assert latest POM.

Similarly, the source repo should also be included. Again, for the dexcount-gradle-plugin it's:

<scm>
    <connection>scm:git:git://github.com/KeepSafe/dexcount-gradle-plugin.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/KeepSafe/dexcount-gradle-plugin.git</developerConnection>
    <url>https://github.com/KeepSafe/dexcount-gradle-plugin/</url>
</scm>

I think by just adding vacUrl in the gradlePlugin, the license and the repo URL will be picked up automatically. See https://github.com/KeepSafe/dexcount-gradle-plugin/blob/d17e9cf40fdb6bd8f9740f2900443a660ce932a7/build.gradle#L269C1-L269C13

Activity

  1. mr-thierry commented on Dec 9, 2024

    @mr-thierry
    ContributorAuthor
  2. mr-thierry commented on Dec 9, 2024

    @mr-thierry
    ContributorAuthor

    I'm not sure why this doesn't get picked up by the publishing task?

  3. brentwatson commented on Dec 9, 2024

    @brentwatson

    I think the following are missing from gradle.properties, which should resolve this:

    POM_LICENCE_NAME=The Apache Software License, Version 2.0
    POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
    POM_LICENCE_DIST=repo
  4. jraska commented on Dec 19, 2024

    @jraska
    Owner

    Hey, thanks for raising the issue. Will fix that once I get to it.

  5. jraska commented on Jan 14, 2025

    @jraska
    Owner

    Checking the latest POM, the licenses are still not there, therefore a different fix than #289 is required 🤔

  6. mr-thierry commented on Jan 15, 2025

    @mr-thierry
    ContributorAuthor

    I have another PR that hopefully solves the issue 🤞

  7. jraska commented on Jan 15, 2025

    @jraska
    Owner

    Still no luck :( POM

    Thanks for the efforts, but I guess we would have to ask Gradle folks how to include these into the publication plugin.

  8. mr-thierry commented on Jan 21, 2025

    @mr-thierry
    ContributorAuthor

    I'm closing this issue. I did a quick check in the plugin repo and it seems the vast majority of the plugin don't have license in their POM file. I'll see with our infrastructure team if we can use another way to enable this plugin internally.

    Thank you for your time!

  9. StefMa commented on Jan 30, 2025

    @StefMa

    Super strage, because I just run publishToMavenLocal on https://github.com/jraska/modules-graph-assert/tree/25fc15876e703e519a6b5a8330f26ef6888e09b1 and it seems the license is there:

    Image

    Same for the other one:

    Image

  10. mr-thierry commented on Feb 23, 2026

    @mr-thierry
    ContributorAuthor

    I'm closing this issue. I did a quick check in the plugin repo and it seems the vast majority of the plugin don't have license in their POM file. I'll see with our infrastructure team if we can use another way to enable this plugin internally.

    Bad news, we really need to fix this to be able to use this plugin 😢

    Current status:

    PR #330 proposes a change that should fix the issue.

    I have tested locally with the command:

     ./gradlew :plugin:publishToMavenLocal 
    

    And I now see the license:

    cat ~/.m2/repository/com/jraska/module/graph/assertion/plugin/2.9.0/plugin-2.9.0.pom
    
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <!-- This module was also published with a richer model, Gradle metadata,  -->
      <!-- which should be used instead. Do not delete the following line which  -->
      <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
      <!-- that they should prefer consuming it instead. -->
      <!-- do_not_remove: published-with-gradle-metadata -->
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.jraska.module.graph.assertion</groupId>
      <artifactId>plugin</artifactId>
      <version>2.9.0</version>
      <licenses>
        <license>
          <name>Apache License 2.0</name>
          <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
          <distribution>repo</distribution>
        </license>
      </licenses>
      <dependencies>
        <dependency>
          <groupId>org.jetbrains.kotlin</groupId>
          <artifactId>kotlin-stdlib-jdk8</artifactId>
          <version>2.2.20</version>
          <scope>runtime</scope>
        </dependency>
      </dependencies>
    </project>
    
    
  11. jraska commented on Apr 12, 2026

    @jraska
    Owner

    #330 Released, license is still not there https://plugins.gradle.org/m2/com/jraska/module/graph/assertion/com.jraska.module.graph.assertion.gradle.plugin/2.9.1/com.jraska.module.graph.assertion.gradle.plugin-2.9.1.pom :(

    I will revert #330 commit and look into it once I have more time. perhaps we need an update to Gradle Publish plugin, IDK 🤷 (#336)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions