X-pack-5.5.0.jar download location

Hi,
I'm trying to upgrade my application to version 5.5.0. I have a dependency to x-pack.jar, somebody know where to download the newest jar, x-pack.jar ?

maybe a litte bit more context. I need following imports to test watcher queries:

import org.elasticsearch.xpack.watcher.client.WatcherClient;
import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchRequest;
import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchResponse;
import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchRequestBuilder;
import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse;

Thanks

pts0

I believe you're looking for these instructions.

Hi @TimV,
I already got that jar. So you mean all the class i need are now encapsulated there. I will try to rewrite, adjust my test.
By the way the link https://www.elastic.co/guide/en/x-pack/current/installing-xpack.html#xpack-installing-offline is broken in dokumentation 5.5.0.

thanks

pts0

Hmm,

I have some trouble or missing dependencies. The doc at https://www.elastic.co/guide/en/x-pack/5.5/api-java.html#_obtaining_the_literal_watcherclient_literal bring the example, but it use following inports:

import org.elasticsearch.xpack.client.PreBuiltXPackTransportClient;
import org.elasticsearch.xpack.XPackClient;
import org.elasticsearch.xpack.XPackPlugin;
import org.elasticsearch.watcher.client.WatcherClient;

Where are this class included ? In x-pack-transport.java are not there .

Thanks

pts0

can you share more about your setup? Is it mvn? Is it gradle? Are you downloading transitive dependencies?

Hi,
Yes sure I can.
Is maven, I have following ( elastic related ) dependecies:

<dependency>
      <groupId>org.elasticsearch.client</groupId>
      <artifactId>rest</artifactId>
</dependency>
<dependency>
      <groupId>org.elasticsearch.test</groupId>
      <artifactId>framework</artifactId>
 </dependency>
<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>x-pack-transport</artifactId>
</dependency>
<dependency>
      <groupId>org.elasticsearch.plugin</groupId>
      <artifactId>lang-mustache-client</artifactId>
</dependency>

and in parent

  <dependency>
       <groupId>org.elasticsearch</groupId>
       <artifactId>elasticsearch</artifactId>
  </dependency>

<dependency>
        <groupId>org.elasticsearch.test</groupId>
        <artifactId>framework</artifactId>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

I m really missing alle the x-pack client stuff, to execure the alerting queries. This is the class i was using and was working with 5.4.0 x-pack jar.

public abstract class AbstractWatcherTest extends ESSingleNodeTestCase {
...
 void executeWatcher(String watcherId) {
    WatcherClient watcherClient = new WatcherClient(client());
    PutWatchRequestBuilder putWatchRequestBuilder = watcherClient.preparePutWatch(watcherId);
    putWatchRequestBuilder.setSource(this.watcherBytesReference.get(watcherId)).setActive(false);
    PutWatchResponse putWatchResponse = putWatchRequestBuilder.get();
    assertNotNull(putWatchResponse.getId());
    ExecuteWatchRequest executeWatchRequest = new ExecuteWatchRequest(watcherId);
    ExecuteWatchResponse executeWatchResponse = watcherClient.executeWatch(executeWatchRequest).actionGet();
    assertNotNull(executeWatchResponse.getRecordId());
    flushAllIndexes();
  }

when you run mvn dependency:tree, can you spot org.elasticsearch.plugin:x-pack-api? If not can you try to include it?

Hi,

tnx, i don't get it as dependency. If I added then I need artifact org.elasticsearch.plugin:x-pack-api:jar:5.5.0 , that i can't find in my repo :slight_smile: Can I get it from somewhere ?

Yes, we've rearranged our documentation in 5.5 and some old links may not be valid anymore.

That JAR is available from the same repository as the x-pack-transport JAR, and is a listed dependency in the POM for x-pack-transport.

If it's not working for you, then something strange is going on with your maven dependencies, because the POM and JAR files are definitely there.

The POM for x-pack-api is here: https://artifacts.elastic.co/maven/org/elasticsearch/plugin/x-pack-api/5.5.0/x-pack-api-5.5.0.pom

You can get the JAR from the same location, but you really do want to sort out whatever is going on in maven, because the API has a bunch of dependencies, and you probably don't want to be downloading them all by hand.

Hi @TimV,

thanks I got the jar. I will now trz out if it work.
Problem with my "maven" ist that I m behind a proxy and no access to maven repo from elastic. Just keep in mind offline people ... some company are very restrictive about which repo can be directly connected.

Now I got all I need to run my Java tests on x-pack painless scripts.

Thanks

pts0

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.