mockito / shipkit

Toolkit for shipping it used by Mockito library
http://shipkit.org
MIT License
158 stars 35 forks source link

License is always MIT in the generated POM #755

Open jpkrohling opened 6 years ago

jpkrohling commented 6 years ago

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

epeee commented 6 years ago

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

jpkrohling commented 6 years ago

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

jpkrohling commented 6 years ago

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 commented 6 years ago

@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.

epeee commented 6 years ago

@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?

jpkrohling commented 6 years ago

Sounds good to me :)

mockitoguy commented 5 years ago

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!

jpkrohling commented 5 years ago

It looks like it does work, thanks!