I am currently writing a plugin to download some jars from a 3rd party vendor site, extract some information from their manifest, enrich with handcrafted dependency metadata and publish as Maven artifacts to our repo.
My problem is that I don’t know the version of the publication until I actually download the jar, as I need to get it from the manifest (the jars always have the same name). I also extract from the manifest a few more tidbits like the org name and description.
As the MavenPublication
does not let me specify closure to lazy-evaluate all these properties, what I do currently is that I check the StartParameters
and only add the publications if the ‘publish’ task is explicitly requested.
That feels quite hacky, especially as I have most of the information about the publication, except these few details coming from the manifest.