shipkit icon indicating copy to clipboard operation
shipkit copied to clipboard

License is always MIT in the generated POM

Open jpkrohling opened this issue 7 years ago • 8 comments

I just realized that no matter what I add as bintray/pkg/licenses, I always end up with MIT as license in the generated POM:

https://github.com/opentracing-contrib/java-interceptors/blob/v0.0.3/gradle/shipkit.gradle#L22

https://dl.bintray.com/opentracing/maven/io/opentracing/contrib/opentracing-interceptors/0.0.3/opentracing-interceptors-0.0.3.pom

This seems to be the relevant code: https://github.com/mockito/shipkit/blob/98b9ff160ff73bf681b72baa6cad6ad99c8822ed/subprojects/shipkit/src/main/groovy/org/shipkit/internal/gradle/util/PomCustomizer.java#L79

jpkrohling avatar Sep 18 '18 08:09 jpkrohling

Thank you for reporting this one! I will work on a fix later on today..

epeee avatar Sep 18 '18 15:09 epeee

I'm currently working on it and will send a PR soon.

jpkrohling avatar Sep 19 '18 07:09 jpkrohling

Unfortunately, it seems that it's more complicated than I initially thought, as the POM customizer belongs to the Shipkit plugin but the licenses information is stored in the Bintray plugin. I'll let the experts fix then :)

jpkrohling avatar Sep 19 '18 07:09 jpkrohling

@epeee, would you be able to provide some insight on the best way to solve this? As this is probably a blocker for us to use it, I'd be willing to give it a shot at fixing it, in case you don't have the time to fix it.

jpkrohling avatar Sep 24 '18 09:09 jpkrohling

@jpkrohling I already thought about how to fix it and it looks like I will be able to spend some time on this one tomorrow. Sounds good?

epeee avatar Sep 25 '18 03:09 epeee

Sounds good to me :)

jpkrohling avatar Sep 25 '18 07:09 jpkrohling

Hey guys! I little bit late to the game due to my knee surgery.

@jpkrohling, I've opened a pull request in our example project to demonstrate how you can customize the pom. In general, Shipkit is a set of plugins on top of standard Gradle plugins. You should be able to override any customizations that Shipkit does. We are here to help figuring it out. Check out this PR for complete file: https://github.com/mockito/shipkit-example/pull/198/files

The most important part:

//shipkit.gradle file:
plugins.withId("org.shipkit.java-publish") {
        publishing.publications.javaLibrary.pom.withXml {
            //refer to Groovy xml Node reference for more info how to manipulate xml
            asNode().licenses.replaceNode {
                licenses {
                    license {
                        name "Eclipse Public License v2.0"
                        url "http://www.eclipse.org/legal/epl-v20.html"
                    }
                }
            }
        }
}

Let us know if it works for you!

mockitoguy avatar Oct 24 '18 15:10 mockitoguy

It looks like it does work, thanks!

jpkrohling avatar Oct 31 '18 15:10 jpkrohling