[GRADLE-3004] uploadArchives creates incorrect pom.xml on jdk8 ? Created: 23/Jan/14  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Won't Fix Votes: 0


We have a project where running "uploadArchives" with jdk7 generates a pom with class path elements in one order. Switching to jdk8 emits a pom with elements in a different order. According to my understanding of maven, the pom elements should never have random order; is this a known problem ?

Comment by Gradle Forums [ 23/Jan/14 ]

I'm not sure I understand this;

org.gradle.api.publication.maven.internal.ant.DefaultPomDependenciesConverter#convert seems to produce a "List" of dependencies largely by iterating hash maps. Am I missing something ???

Comment by Gradle Forums [ 23/Jan/14 ]

Please post a concrete POM snippet showing the differences. If you are talking about order of `dependency` elements, the order is irrelevant.

Comment by Gradle Forums [ 23/Jan/14 ]

No, you are wrong about this, pom.xml order also defines class path order, and ordering may be important, in particular for resource loading. This was fixed in [1]http://jira.codehaus.org/browse/MNG-1412 and [2]http://jira.codehaus.org/browse/MNG-3111 and has been this way since maven 2.0.9.

The gradle code I found matches your misunderstanding of how pom.xml works, and there is no point in posting any kind of sample for this.
[1] http://jira.codehaus.org/browse/MNG-1412
[2] http://jira.codehaus.org/browse/MNG-3111

Comment by Gradle Forums [ 23/Jan/14 ]

I was asking for a sample to clarify what you mean by "generates a pom with class path elements in one order". (Dependency declarations aren't class path elements.) Thanks for pointing out [1]http://jira.codehaus.org/browse/MNG-3111. Perhaps we should switch to ordered collections. Would you be interested in contributing such a change?
[1] http://jira.codehaus.org/browse/MNG-3111

Comment by Gradle Forums [ 23/Jan/14 ]

Originally I bumped into this because we were trying to find out why our build was failing. We discovered the mutating pom.xml file because we were deploying with jdk7/8 while trying to identify our primary problem; it would appear that hash map iteration order is (once again) different in jdk8 - which caused large variations in as-deployed pom.xml files. Since I am intimately familiar with the maven pom parsing logic, I thought I would raise this issue.

Now it would appear the root cause of our problem is a different bug, which is actually far more evil. We're still working on zooming in on that problem. I think we'll try to fix that problem first....

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:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:37:17 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.