Add external libraries to elasticsearch

I would want to add org.apache.http libraries to the gradle file .how do i do that

thanks

What for? Where?

I have added the authentication in RestController.java ,after successful authentication i want to create and send cookie in response header.
So i need to use org.apache.http libraries.
is there any other way to send the response header.

Thanks

It's in core? In a plugin?

core

We don't support this. But if I had to add something in core I'd probably add it here:

Hey @MKU, you've asked a lot of questions over the last several months that strongly suggest you're trying to develop your own security functionality rather than using the one that's already included in Elasticsearch. Security is hard to get right even with a great deal of skill and experience. Also, running a nonstandard and unsupported build of Elasticsearch is likely to cause you serious problems, possibly including data loss, that we won't be able to help you diagnose or fix. Furthermore, you may not have heard, but recently Elastic upgraded the functionality available with the free basic licence to include security. I think you should reconsider the path you're following.

3 Likes

Hi @DavidTurner ,
I was not aware of those things i will definitely check them out.

This is my build.gradle now at lib/core.
dependencies {
testCompile "com.carrotsearch.randomizedtesting:randomizedtestingrunner:{versions.randomizedrunne}" testCompile "junit:junit:{versions.junit}"
testCompile "org.hamcrest:hamcrest-all:{versions.hamcrest}" testCompile "org.apache.http.HeaderIterator:{versions.http}"
testCompile "org.apache.http.HttpResponse:{versions.http}" testCompile "org.apache.http.HttpStatus:{versions.http}"
testCompile "org.apache.http.HttpVersion:{versions.http}" testCompile "org.apache.http.impl.client.CloseableHttpClient:{versions.http}"
testCompile "org.apache.http.impl.client.HttpClients:{versions.http}" testCompile "org.apache.http.message.BasicHttpResponse:{versions.http}"

if (!isEclipse && !isIdea) {
    java9Compile sourceSets.main.output
}

if (isEclipse == false || project.path == ":libs:core-tests") {
    testCompile("org.elasticsearch.test:framework:${version}") {
        exclude group: 'org.elasticsearch', module: 'elasticsearch-core'
    }
}

}
but it throws mepackage org.apache.http does not exist.
how do i solve this

That's a gradle question not an elasticsearch one.
You don't include classes in a build but a library. So just include the http client lib.

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