Remove broken `exec` build target, replace with something better.

Currently this target is "yet another way" to run elasticsearch,
which we can't maintain. It also has the problem that it doesnt
ensure its running on the latest source code, doesn't configure
any scratch space properly, won't work with securitymanager, list
goes on.

Even if we made it work, it would break every day, since its untested.

Instead, `mvn package -Drun -DskipTests` will run packaging, and then
startup bin/elasticsearch (like integration tests, but in foreground).

It also enables debugger socket on port 8000, for people that like
IDE debuggers and not system.out.println.

Its a little slower to get started because of all the shading/RPM/DEB
building going on in `package` but that is just what it is right now
until that stuff is moved out.
This commit is contained in:
Robert Muir 2015-07-17 00:03:33 -04:00
parent b1e3914461
commit 48bc49c093
2 changed files with 32 additions and 34 deletions

View File

@ -299,39 +299,6 @@
</testResources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${jvm.executable}</executable>
<arguments>
<argument>-Des.security.manager.enabled=false</argument>
<argument>-classpath</argument>
<classpath/>
<argument>org.elasticsearch.bootstrap.Bootstrap</argument>
<argument>-Xms256m</argument>
<argument>-Xmx1g</argument>
<argument>-Djava.awt.headless=true</argument>
<argument>-XX:+UseParNewGC</argument>
<argument>-XX:+UseConcMarkSweepGC</argument>
<argument>-XX:CMSInitiatingOccupancyFraction=75</argument>
<argument>-XX:+UseCMSInitiatingOccupancyOnly</argument>
<argument>-XX:+HeapDumpOnOutOfMemoryError</argument>
<argument>-XX:+DisableExplicitGC</argument>
<argument>-Dfile.encoding=UTF-8</argument>
<argument>-Djna.nosys=true</argument>
<argument>-Delasticsearch</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
@ -1025,11 +992,24 @@
</execution>
</executions>
</plugin>
<!-- integration tests -->
<!-- execution and integration tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- start up elasticsearch in foreground -->
<execution>
<id>execute</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target if="${run}">
<ant antfile="${elasticsearch.integ.antfile}" target="start-foreground"/>
</target>
</configuration>
</execution>
<!-- start up external cluster -->
<execution>
<id>integ-setup</id>

View File

@ -24,6 +24,7 @@
<attribute name="dir"/>
<attribute name="args"/>
<attribute name="spawn" default="false"/>
<element name="nested" optional="true"/>
<sequential>
<local name="failonerror"/>
<condition property="failonerror">
@ -34,11 +35,13 @@
<arg value="/c"/>
<arg value="@{dir}/@{script}.bat"/>
<arg line="@{args}"/>
<nested/>
</exec>
<exec executable="sh" osfamily="unix" dir="@{dir}" failonerror="${failonerror}" spawn="@{spawn}">
<arg value="@{dir}/@{script}"/>
<arg line="@{args}"/>
<nested/>
</exec>
</sequential>
</macrodef>
@ -134,6 +137,21 @@
</sequential>
</target>
<!-- run elasticsearch in the foreground (for debugging etc) -->
<!-- TODO: doesn't belong here, but we will figure it out -->
<target name="start-foreground" depends="stop-external-cluster">
<delete dir="${integ.scratch}"/>
<unzip src="${project.build.directory}/releases/${project.artifactId}-${project.version}.zip" dest="${integ.scratch}"/>
<local name="home"/>
<property name="home" location="${integ.scratch}/elasticsearch-${elasticsearch.version}"/>
<run-script dir="${home}" script="bin/elasticsearch" spawn="false"
args="${integ.args} -Des.path.repo=${home}/repo">
<nested>
<env key="JAVA_OPTS" value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"/>
</nested>
</run-script>
</target>
<!-- unzip core release artifact and start ES -->
<target name="start-external-cluster" depends="setup-workspace" unless="${shouldskip}">
<startup-elasticsearch/>