I am trying to follow the guide linked below for creating a WatchSource using WatchSourceBuilder following the instructions.
I have setup the Maven repository and through trial and error (looking at github repositories) I have learned that this documentation is not accurate and that i will also need the following jars in my pom.xml file:
Version i am using is 6.5.4
Following is the error i am receiving:
[ERROR] Failed to execute goal on project : Could not resolve dependencies for project: Failure to find org.elasticsearch.plugin:x-pack-watcher:jar:6.5.4 in http://nexus-dev/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR] After correcting the problems, you can resume the build with the command
Note: My company does have the premium license
From that doc, it looks like you need the transport dependency:
You tried that and it didn't work?
I have tried that and it does not solve the problem.
What i have pinpointed to is that we require this jar:
And I do not see the jar in the maven repository: https://mvnrepository.com/artifact/org.elasticsearch.plugin
- Without a license, you won't have the Watcher/Alerting plugin within Elasticsearch with which your code can interact. Watcher is a commercial feature. Are you building this for use with clusters that have a license?
- Since 5.0, the WatcherClient class is packaged in the
x-pack-transport artifact hosted on Elastic's maven repo as described in the Configuring X-Pack Java Clients documentation. In other words, it's not in Maven central.
Ok, a third thing: the transport client is deprecated and will not support the next major version of Elasticsearch (8.0). Moving the the high-level REST client is recommended...it also comes packaged with the Watcher classes. We have a migration guide to help with the migration
Gotcha, and apologies for reading your previous note as saying, "My company does not have a premium license"
First, we no longer build the x-pack-watcher artifact, which is why you're not finding it for v6.5.4. It's been replaced by x-pack-core.
However, there might be an issue with your specific version. See this GitHub issue detailing an bug with the x-pack-core Maven artifact. The fix was made in 6.6.1, so you'll likely need to bump up to that version, I'm afraid.
You can see all the watcher-related code in 6.6.1 here
should mention that you can verify that the watcher classes are all in that x-pack-core artifact by downloading it from our maven repo and grepping the contents:
jar -tf x-pack-core-6.6.1.jar | grep -i watch
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.