Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@ publishing {
url = "https://github.com/opensearch-project/ml-commons"
}
}
// Add a dependencies section to signal that consumers of the client need to provide these
withXml {
def dependencies = asNode().appendNode('dependencies')

def addProvidedDependency = { group, artifact, version ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this issue. Have you verified this? Any impact to other plugins using ml-commons clients like neural-search?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really only changes the POM which wouuld in theory add transitive dependencies, ecxept:

  • we don't do transitive dependencies in OpenSearch (the source of the problem!)
  • it's in scope <provided> which means it wouldn't be imported transitively if it did. This is purely a user documentation change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did test it with flow framework by deleting those imports (and getting runtime errors) even with the new snapshot containing the new values in the pom in my maven local repository, so it confirms these imports aren't included.

def dependency = dependencies.appendNode('dependency')
dependency.appendNode('groupId', group)
dependency.appendNode('artifactId', artifact)
dependency.appendNode('version', version)
dependency.appendNode('scope', 'provided')
}

addProvidedDependency('org.json', 'json', '20231013')
addProvidedDependency('com.jayway.jsonpath', 'json-path', '2.9.0')
addProvidedDependency('org.apache.commons', 'commons-text', '1.10.0')
}
}
}

Expand Down
Loading