Giter VIP home page Giter VIP logo

Comments (3)

alexcojocaru avatar alexcojocaru commented on July 17, 2024

It appears that the issue you are describing is in the bin/elasticsearch shell script. The plugin starts a new process using the arguments listed on the last INFO line in your output (ie. the last [INFO] Elasticsearch[0]: Executing command ...). From here on the ES startup script takes over and builds the java command to execute.

Off the top, I would suggest one of the following:

  • download the ES distribution, unzip and start ES; or simply go to ${your_mvn_proj}/target/elasticsearch0 (this is where the ES distro gets downloaded and unpacked by the plugin) and run $ bin/elasticsearch; I would expect this to fail as well
  • upgrade the ES version in the plugin config; I just checked the bin/elasticsearch in 5.0.0 and it uses this to execute java (note the double quotes around the cp): $ exec "$JAVA" $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" org.elasticsearch.bootstrap.Elasticsearch "$@"

You didn't say what the plugin config is. I am interested in the plugin version and the ES version.

from elasticsearch-maven-plugin.

jmrodriguez avatar jmrodriguez commented on July 17, 2024

Here's the full plugin config

          <plugin>
            <groupId>com.github.alexcojocaru</groupId>
            <artifactId>elasticsearch-maven-plugin</artifactId>
            <version>${maven.plugin.elasticsearch.version}</version>
            <configuration>
              <clusterName>esDevCluster</clusterName>
              <httpPort>${es.httpPort}</httpPort>
              <transportPort>${es.tcpPort}</transportPort>
              <version>${maven.plugin.elasticsearch.configuration.version}</version>
              <keepExistingData>true</keepExistingData>
              <timeout>60</timeout>
              <skip>${es.skip.start}</skip>
              <pathConf>elasticsearch/conf</pathConf>
              <logLevel>DEBUG</logLevel>
            </configuration>
            <executions>
              <execution>
                <id>start-elasticsearch</id>
                <phase>validate</phase>
                <goals>
                  <goal>runforked</goal>
                </goals>
              </execution>
              <execution>
                <id>stop-elasticsearch</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

where

<maven.plugin.elasticsearch.version>6.4</maven.plugin.elasticsearch.version>
<maven.plugin.elasticsearch.configuration.version>5.6.8</maven.plugin.elasticsearch.configuration.version>

As you mentioned in your comment, running bin/elastic throws the exact same error.

I tried editing the bin/elasticsearch script to add quotes to the -cp parameter, but when I run the project with the respective mvn command, the target/elasticsearch0/bin/elasticsearch script is re-generated by the mvn process, so any changes I do are overwritten.

I might have found a workaround for the issue though.

If I set the ES_JVM_OPTIONS env variable to -cp "./target/elasticsearch0/lib/*" in my IDE's (IntelliJ) run configuration (or in the terminal before executing the run command), the project runs nicely, but took quite some time to figure that out.

Perhaps worth adding that to the README file for other OSX users?

from elasticsearch-maven-plugin.

alexcojocaru avatar alexcojocaru commented on July 17, 2024

Thanks for the additional details and for describing the workaround. I will add a note about this to the README.

from elasticsearch-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.