Elasticsearch 'Hello world' plugin - elasticsearch

I did some research, this is my second time I try to tackle this problem and still couldn't find a proper tutorial for ES plugin writing.
https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugin-authors.html
I found this page that shows some plugin structure and links some plugin examples, but when I try and create those java projects I get a load of errors in it and I get nowhere.
Some other pages show maven project examples but none have been clear enough, either I got errors or some steps were missing.
Does anyone know a step-by-step tutorial page for ES plugin writing? I have Java coding knowledge and a few months of ES experience in smaller environment.

Related

Understanding how to read maven central indexes/ and when to use luke tools

I am currently working on a small project to read the entire details of artifacts on maven central.
I came across this particular website https://maven.apache.org/repository/central-index.html
It lists essentially a 3 step:
downloading the index
using index-cli project to unpack the index.gz
and then using a lucene viewer step such as Luke to export the index as an xml
However I was going through the index-reader examples and unit tests (https://maven.apache.org/maven-indexer/indexer-reader/index.html) and it is very clear that simply using ChunkReader.splitIterator is sufficient to get all the details that we get after the 3 step output above.
Infact even the link suggests the same.
Verbatim - "Indexer Reader is a dependency-less library that is able to read published (remote) index with incremental update support, making usable to integrate published Maven Indexes into any engine without depending on maven-indexer-core and its transitive dependencies."
Question 1:
The confusion and the question : why does this https://maven.apache.org/repository/central-index.html suggest a 3 step workflow to achieve the same.
Question 2:
Is there any additional clarity somewhere which explains how and when the incrementals and the full upload happens? I found this blog post from 2009, just wanted to ensure it is still valid https://blog.sonatype.com/2009/05/nexus-indexer-20-incremental-downloading/
Regards

Why am I getting `java.lang.AssertionError: Built-in class kotlin.Any is not found` when using `copy` in TeamCity DSL?

Background
I'm trying to create some Teamcity configuration using Kotlin. I'm using a Maven in Intellij when testing the generation of the Teamcity, although I get the same result by using the command line.
Problem
A minimum example: https://gist.github.com/3761e6f3847db9f8f772c9e16663aaa9
To recreate the issue, use the command:
mvn teamcity-configs:generate
The error is:
[ERROR] Runtime error RootProjectId: kotlin.reflect.jvm.internal.impl.builtins.KotlinBuiltIns$3[113]: java.lang.AssertionError: Built-in class kotlin.Any is not found
Although I've taken steps to minimise the provided example, I'm no Maven expert and I'm not sure what else could have been shaved off the pom.xml file.
The problem seems to stem from an attempted use to copy (cf., docs) which seems to trip up Kotlin with some reflection issue. Remove the copy and the generation of the config works fine.
Research
There are a few places around where this is discussed (e.g. here and here), but I can't find any that match the issue I'm experiencing or suggest a solution which fixes it for me.
The most interesting one is this one, which is not relevant as it's regarding moving from Kotlin versions 1.3.x to 1.4.x, however, the discussion has a little on the interdependence of kotlin-stdlib[...], kotlin-reflect and Java itself, from JetBrain developer "Udalov" (direct link to comment). The details are over my head and may not be relevant here, but it's the most technical answer I've seen addressing this issue.
What I've tried
I've tried adding kotlin-reflect as an explicit dependency and making sure that kotlin-stdlib-jdk8 is present and correct. I've tried varying the Kotlin version from 1.3.70 to 1.3.72 to 1.4.32 with no change to the result.
Any help or insight on this would be appreciated, even if it's just to advance my understanding of this software stack.

Ant to Gradle Build Project - Help/Assistance Needed

Nice to be in this channel.
I have a specific need that I'm hoping some of you might be able to help with.
We have a large project where we are migrating from ant to Gradle. The Java code has been built up over the past 15 years so there is a lot of it.
We are struggling with this migration as we don't know gradle at a deep level. We know how it works & have used it lots of times to build java projects. However, this is different as the projects are so large, we need somebody with a deep understanding of how gradle works at a low level.
So, I'm putting this message out there, asking if anybody is interested in working with us on this for 3,6,9+ months. If you know of anybody who could help us then I would really appreciate an intro.
Thanks in advance, John.

Where is the Elasticsearch Plugin API Documentation?

The closest thing I've found is their Elasticsearch Plugins and Integrations
page, which doesn't help. I was following their out of date tutorial to make a "hello world" plugin, but I can't find any documentation on the classes used. Is there a page with information on what each class does, or do I have to look at the code to figure it out on my own?
To quote elastic search developer Adrien Grand(jpountz) "No, there is no guide about writing plugins and the API is actually quite unstable. The plugin API is mainly a way for us to provide additional functionality through plugins so that we do not have to fold everything into a single release artifact that would be quite huge. Some community membors have writter plugins by taking inspiration of existing plugins but we do not want to commit on a stable API for plugins as this might prevent us from improving other areas of elasticsearch."
The only real way of learning about developing a plugin is trying to find something similar and modifying it to suite your needs. Developing anything remotely complex will require an extensive knowledge of the ES codebase. I suggest you look into some plugins developed by jprante to get started.

Creating a Maven-like project documentation website with gradle

Maven provides a way to generate a project documentation site. Does Gradle provide a similar plugin?
The only site plugin that I am aware of is this one. I personally I haven't tried it so I can't tell you about its feature set or quality.
I had to move on to something else soon after commenting, then forgot about checking out the plugin Benjamin mentioned. I had a little time this evening so I looked at it. The plugin hasn't been updated in 3 years, so it appears abandoned/dead. I couldn't find a place to download the artifact, so I cloned the Git repo and built it.
I spent a little time trying to get it to work, but gave up. I looked around a little to see what else is out there. A couple of options that look promising are Gradle's TestReport task:
http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.testing.TestReport.html
and the Gradle Site Plugin:
https://bitbucket.org/davidmc24/gradle-site-plugin
but I only played around with them for an hour and haven't used them in a real project.

Resources