Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle cannot build effective model because of failure in pom.xml #180

Open
de-jcup opened this issue Sep 19, 2022 · 14 comments
Open

Gradle cannot build effective model because of failure in pom.xml #180

de-jcup opened this issue Sep 19, 2022 · 14 comments

Comments

@de-jcup
Copy link

de-jcup commented Sep 19, 2022

Situation

Our build had some errors outputs from Gradle at at mercedes-benz/sechub#1658.
The reason was the usage of spotless which relies on JDT parts for automated eclipse formatting.

Following output was shown multiple times:

Errors occurred while build effective model from /home/runner/.gradle/caches/modules-2/files-2.1/org.eclipse.platform/org.eclipse.core.expressions/3.8.200/eb159f34083b0135459745f934a6ad5eb61b61c/org.eclipse.core.expressions-3.8.200.pom:
	'modelVersion' must be one of [4.0.0] but is '4.0'. in org.eclipse.platform:org.eclipse.core.expressions:3.8.200

Looking at
https://repo1.maven.org/maven2/org/eclipse/platform/org.eclipse.core.expressions/3.8.200/org.eclipse.core.expressions-3.8.200.pom

The pom.xml contains
<modelVersion>4.0</modelVersion>

The older version (3.8.100) https://repo1.maven.org/maven2/org/eclipse/platform/org.eclipse.core.expressions/3.8.100/org.eclipse.core.expressions-3.8.100.pom contains correctly:
<modelVersion>4.0.0</modelVersion>

Wanted

A gradle build shall have not those warnings when there is a gradle/maven dependency to org.eclipse.core.expressions

Suggested solution

  • Change the pom model settings (sorry I did not find the part inside the sources) so next releases have 4.0.0 inside
  • Maybe change the existing deployed pom.xml at maven central to correct version in pom.xml for org.eclipse.core.expressions-3.8.200 - if possible
@mickaelistria
Copy link
Contributor

@merks Can it be something changed in the CBI pom generator?
@de-jcup While not perfect, this model version is working with Maven, accepted by Maven Central, so I believe it's correct enough in practice and it's more Gradle that should be changed to better tolerate it. I don't think we'll redeploy all those artifacts as Maven Central usually doesn't allow re-deploying artifacts with already deployed GAVs, and we'll most likely won't spin a new build stream just for this issue.

@merks
Copy link
Contributor

merks commented Sep 20, 2022

@mickaelistria

Yes, it looks like you changed that with this commit:

eclipse-cbi/p2repo-aggregator@ca23f07

Previously it used POM.MODEL_VERSION:

image

which is defined like this:

public static final String MODEL_VERSION = "4.0.0";

I suppose I should change that part back to how it was before, right?

@mickaelistria
Copy link
Contributor

Definitely my bad then!

I suppose I should change that part back to how it was before, right?

If you're ok, that would be welcome; but if you prefer, I can deal with it.

merks added a commit to eclipse-cbi/p2repo-aggregator that referenced this issue Sep 20, 2022
@merks
Copy link
Contributor

merks commented Sep 20, 2022

No problem, It's fixed by this:

eclipse-cbi/p2repo-aggregator@512016e

It will be available in a build shortly...

I'm not sure what can be done to fix the published poms after the fact now though...

@mokamoto12
Copy link

We also have the same experience and are interested if there is any update 👀

@merks
Copy link
Contributor

merks commented Oct 23, 2022

@mokamoto12

Maybe you could try the snapshots?

https://repo.eclipse.org/content/repositories/eclipse-snapshots/

Otherwise, this issue won't be fixed until December with the 2022-12/4.26 release...

@mokamoto12
Copy link

@merks
Thank you very much!😊 We have tried what we could but could not make it work. (This is probably because we don't understand gradle properly.)
We are not personally in a hurry, so we will try again after the December release or use another formatter.

@Lucas3oo
Copy link

Seems like a bunch of Eclipse artefacts are having this issue.
Same issue with org.eclipse.equinox.registry-3.11.200, org.eclipse.equinox.preferences-3.10.100, org.eclipse.equinox.app-1.6.200, org.eclipse.core.contenttype-3.8.200

@merks
Copy link
Contributor

merks commented Mar 13, 2023

Updates are only published to Maven central only if the version changes and unfortunately some of these things do no have version changes. 😢

@de-jcup
Copy link
Author

de-jcup commented Mar 27, 2023

@merks: When looking at https://repo1.maven.org/maven2/org/eclipse/platform/org.eclipse.core.expressions/ there is no new version available - and I created this issue here 6 month before.

Reading https://central.sonatype.org/faq/can-i-change-a-component/ it is impossible to change something which is released at maven central (for good reasons).

As far as a I understood: Your cange eclipse-cbi/p2repo-aggregator@512016e is now available for the builds and newer versions of the libraries should automatically have the correct model version?

I tried out to find milestones for org.eclipse.core.expressions on GitHub. But I did not found them.
Are there any, or something like a release planning which is public?

@merks
Copy link
Contributor

merks commented Mar 27, 2023

The platform's release plans are public, though I'm not sure exactly where it is but it's discussed here:

eclipse-platform/eclipse.platform.releng#200

It closely follows the SimRel plan:

https://wiki.eclipse.org/Category:SimRel-2023-06

Yes, the newer versions will be fixed:

https://repo.eclipse.org/content/repositories/eclipse-snapshots/

I think there will be mostly newer versions because the platform is changing the BREE to Java 17 so basically changing all versions...

@catostrophe
Copy link

Now this issue conflicts with the new Gradle Dependency Management Plugin and leads to a build failure:

Cannot invoke "io.spring.gradle.dependencymanagement.org.apache.maven.model.Model.getGroupId()" because "effectiveModel" is null
Errors occurred while build effective model from /.gradle/caches/modules-2/files-2.1/org.eclipse.platform/org.eclipse.equinox.preferences/3.10.100/43fe3c49d5a6a30090b7081015e4a57bd0a6cb98/org.eclipse.equinox.preferences-3.10.100.pom:
Errors occurred while build effective model from /.gradle/caches/modules-2/files-2.1/org.eclipse.platform/org.eclipse.core.contenttype/3.8.200/e2fdb068262514474d73f236adaa821d9c861786/org.eclipse.core.contenttype-3.8.200.pom:

@merks
Copy link
Contributor

merks commented Jul 15, 2023

@candrews
Copy link

I submitted an issue to Maven requesting that the error message when this occurs be improved: https://issues.apache.org/jira/browse/MNG-7851

And I also submitted a PR to do that: apache/maven#1210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants