Question about creating a maven build for library

Hi - Looking at switching over our build system from Maven to Gradle and wanted to be sure the output of my deploy would be functionally identical to the standard maven POM currently available. Chatted with eng over the phone, but wanted here for records and discussion.

The script in question is at https://github.com/stripe/stripe-java/pull/413/files#diff-207ff80abbb657b69bcff4bf5f439582, and the pom can be found by including stripe-java v 5.21

Hi Michael,

Could you please state your question? It’s a bit unclear what you are looking for in this post.

When I use that script, there are a few changes from the Maven build that I’m uncertain of the consequences of.

  1. No <build> section. I know this isn’t applicable with Gradle. I assume this has no effect on the output artifact? (I’m not familiar with maven builds in general - I’m converting a library for a different project than I usually work on)

  2. No <parent> section. Now, all my dependencies have explicit versions, so I’m not relying on a dependencyManagement section in a parent POM. Can other items in that section have an effect on the consumers of the published artifact, particularly if those users are building with Maven?

My main concern is that the output artifact is not different from the current artifact generated by Maven, which is difficult for me to determine since I don’t generally write server-side Java (I’m an Android dev). While I can and have put up an example project using the new output, built (the sample) in Maven, and verified that it works, I’m unsure about whether/why I should be confident that any other project using that artifact would be similarly unaffected.

@bmuschko? Just checking – is my question clearer now?

  1. The <build> section is irrelevant for consumers. In Maven this only available because there’s no distinction between the pom.xml for building a project and the ones used for consuming the project.

  2. Gradle uses the resolved version in the published POM and does not publish any parent POMs. dependencyManagement won’t exist in the POM published by Gradle. Maven consumers will just resolve the dependencies in the POM.

While I can and have put up an example project using the new output, built (the sample) in Maven, and verified that it works, I’m unsure about whether/why I should be confident that any other project using that artifact would be similarly unaffected.

If you would like to gain confidence then it might make sense to publish a SNAPSHOT version first so consumers can try it out.