[GRADLE-2916] How do I place the POM generated from the maven-publish plugin inside the jar? Created: 04/Oct/13 Updated: 01/Feb/17 Resolved: 24/Jan/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Task | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 0 |
Description |
I am trying out FUSE bundles ([1]http://fuse.fusesource.org/bundle/faq...). To use them, I have to place the POM for a jar inside the jar in the directory: "META-INF/maven/groupId/artifactId/pom.xml" How would I go about placing the pom generated by that plugin inside the jar at the location described by the groupID/artifactID that was put in the pom? Thanks |
Comments |
Comment by Gradle Forums [ 04/Oct/13 ] |
Assuming your publication is named `main`, the following should work. You may have to adapt `groupId` and `artifactId` as needed. jar { |
Comment by Gradle Forums [ 04/Oct/13 ] |
I thought it was something like that, but I get this (the publication is mavenJava):
|
Comment by Gradle Forums [ 04/Oct/13 ] |
This might be related to the new configuration approach used for the `maven-publish` plugin. I recommend to try with the latest nightly build. |
Comment by Gradle Forums [ 04/Oct/13 ] |
Ok, I will give that a shot when I come in tomorrow. Thanks for the replies! |
Comment by Gradle Forums [ 04/Oct/13 ] |
Still doesn't work with the nightly. $ gr :example:clean :example:jar FAILURE: Build failed with an exception.
BUILD FAILED Total time: 5.898 secs $ gr --version ------------------------------------------------------------ Build time: 2013-10-03 22:00:19 UTC Groovy: 1.8.6 |
Comment by Gradle Forums [ 04/Oct/13 ] |
Here is the jist of my build script (The line number will not match with above because this is actually a multiproject build with some of this in 'subprojects sections of the main build.gradle) apply plugin: 'maven-publish' publishing { jar { dependencies { |
Comment by Gradle Forums [ 04/Oct/13 ] |
Have you verified that you can run `gradle generatePomFileForMavenJavaPublication`? |
Comment by Gradle Forums [ 04/Oct/13 ] |
Yes, and it generates the pom I would expect. I did notice this in the documentation: >The “maven-publish” plugin leverages some experimental support for late plugin configuration, and any GenerateMavenPom tasks will not be constructed until the publishing extension is configured. The simplest way to ensure that the publishing plugin is configured when you attempt to access the GenerateMavenPom task is to place the access inside a publishing block, as the above example demonstrates. Do I have to wrap this jar part in a publishing block? Would that even work? |
Comment by Gradle Forums [ 04/Oct/13 ] |
I guess it would. |
Comment by Gradle Forums [ 04/Oct/13 ] |
I tried wrapping the jar part in a publishing block, did not help, same error. |
Comment by Thad Humphries [ 22/May/14 ] |
Is there a work-around that can add "build/publications/mavenJav/pom-default.xml" to "META-INF/maven/$project.group/$project.name" as pom.xml? What about the pom.properties file? |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 24/Jan/17 ] |
Judging from the comments the user found a "workaround" for the issue. |
Comment by Alexei Osipov [ 31/Jan/17 ] |
It doesn't look like there any workaround in comments for this issue. |
Comment by Benjamin Muschko [ 01/Feb/17 ] |
Further discussion here: https://github.com/gradle/gradle/issues/1278 |