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

Egeria 'platform' definition from gradle isn't usable #7421

Closed
planetf1 opened this issue Feb 24, 2023 · 5 comments · Fixed by #7529
Closed

Egeria 'platform' definition from gradle isn't usable #7421

planetf1 opened this issue Feb 24, 2023 · 5 comments · Fixed by #7529
Assignees
Labels
gradle Gradle build (new initiative)

Comments

@planetf1
Copy link
Member

When building connectors, one useful technique is to set dependency constraints using the versions we have for core egeria.

This helps keep dependencies aligned, and reduces the risk of classpath clashes whilst avoiding having to manual keep versions in place.

This can be done in the consumer of egeria using either

implementation platform org.odpi.egeria:egeria:4.0-SNAPSHOT

or

implementation enforced platform org.odpi.egeria:egeria:4.0-SNAPSHOT

More info at https://docs.gradle.org/current/userguide/platforms.html#sub:platforms-vs-catalog

This is similar to an 'import' scope dependency in maven

With the migration to gradle, an attempt to update the xtdb 4.0 connector to use the platform definition failed with:


* What went wrong:
Could not determine the dependencies of task ':egeria-connector-xtdb:withDependencies'.
> Could not resolve all files for configuration ':egeria-connector-xtdb:runtimeClasspath'.
   > Could not resolve org.odpi.egeria:egeria:4.0-SNAPSHOT.
     Required by:
         project :egeria-connector-xtdb
      > No matching variant of org.odpi.egeria:egeria:4.0-SNAPSHOT:20230221.172710-30 was found. The consumer was configured to find a runtime of a platform compatible with Java 17, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
          - Variant 'apiElements' capability org.odpi.egeria:egeria:4.0-SNAPSHOT declares a component compatible with Java 17, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a library and the consumer needed a runtime of a platform
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
          - Variant 'javadocElements' capability org.odpi.egeria:egeria:4.0-SNAPSHOT declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a platform
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 17)
                  - Doesn't say anything about its elements (required them packaged as a jar)
          - Variant 'runtimeElements' capability org.odpi.egeria:egeria:4.0-SNAPSHOT declares a runtime of a component compatible with Java 17, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a library and the consumer needed a platform
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
          - Variant 'sourcesElements' capability org.odpi.egeria:egeria:4.0-SNAPSHOT declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a platform
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 17)
                  - Doesn't say anything about its elements (required them packaged as a jar)

This needs to be addressed so that we have a good platform definitions that consumers can use, and is a critical need for version 4 release

@planetf1 planetf1 self-assigned this Feb 24, 2023
@planetf1 planetf1 added the gradle Gradle build (new initiative) label Feb 24, 2023
@planetf1
Copy link
Member Author

It looks like some refactoring is needed to make use of the 'java-platform' plugin, and very explicitly create the BOM, then consuming it in subprojects, RATHER than just declaring constraints as is done currently.

@planetf1
Copy link
Member Author

planetf1 commented Mar 1, 2023

fyi @mandy-chessell

planetf1 added a commit to planetf1/egeria that referenced this issue Mar 14, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
planetf1 added a commit to planetf1/egeria that referenced this issue Mar 14, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
planetf1 added a commit to planetf1/egeria that referenced this issue Mar 14, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
planetf1 added a commit to planetf1/egeria that referenced this issue Mar 14, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
planetf1 added a commit to planetf1/egeria that referenced this issue Mar 14, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
planetf1 added a commit to planetf1/egeria that referenced this issue Mar 14, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
planetf1 added a commit to planetf1/egeria that referenced this issue Mar 14, 2023
…with 3.x/maven

Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
@planetf1
Copy link
Member Author

Tested with PR (above)

  • local build of xtdb connector (with ref to oss snapshot rep replaced with local) now appears to pick up the egeria project BOM without error.
  • further tests will be made once merged (it's tricky to get this totally correct in one go, with interdependencies between projects)

@planetf1
Copy link
Member Author

Re-opening as testing is needed now the initial code change is in.

LeeVi3w pushed a commit to LeeVi3w/egeria that referenced this issue Mar 16, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
Signed-off-by: Liviu Enache <eliviu99@gmail.com>
LeeVi3w pushed a commit to LeeVi3w/egeria that referenced this issue Mar 16, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
Signed-off-by: Liviu Enache <eliviu99@gmail.com>
LeeVi3w pushed a commit to LeeVi3w/egeria that referenced this issue Mar 16, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
Signed-off-by: Liviu Enache <eliviu99@gmail.com>
LeeVi3w pushed a commit to LeeVi3w/egeria that referenced this issue Mar 16, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
Signed-off-by: Liviu Enache <eliviu99@gmail.com>
LeeVi3w pushed a commit to LeeVi3w/egeria that referenced this issue Mar 16, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
Signed-off-by: Liviu Enache <eliviu99@gmail.com>
LeeVi3w pushed a commit to LeeVi3w/egeria that referenced this issue Mar 16, 2023
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
Signed-off-by: Liviu Enache <eliviu99@gmail.com>
LeeVi3w pushed a commit to LeeVi3w/egeria that referenced this issue Mar 16, 2023
…with 3.x/maven

Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
Signed-off-by: Liviu Enache <eliviu99@gmail.com>
@planetf1
Copy link
Member Author

The egeria BOM should now be correct. any problems will be raised as new issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gradle Gradle build (new initiative)
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant