Skip to content
Muhammad Gelbana edited this page Mar 19, 2017 · 5 revisions

Development Tips

Eclipse and Maven Plugin Dependencies

Eclipse is not able to invoke all the many Maven tasks that Drill uses. There is a two-part workaround.

To ignore unsupported Maven plugins in Eclipse:

In eclipse Luna 4.4.0, you can chose to ignore this error in preferences

Eclipse > Preferences > Maven > Errors/Warnings > Plugin executiuon not covered by lifecycle configuration. Select Ignore / Warning / Error as you wish.

This is a cleaner way, as it doesn't modify your pom.xml.

You will need to do a Maven > "Update project" to fix the same error in any other project as well.

It appears that certain projects contain known issues:

  • drill-storage-hive-core refers to unknown packages.
  • drill-kudu-storage refers to unknown classes.

Simply closing these projects in Eclipse seems to be fine when working on the core Drill.

Doing the above removes the all the red error indicators from your Drill projects in Eclipse.

Preparing a Build for Eclipse

Since Eclipse cannot do the full Drill build, you must help it. When you switch branches in Git, to a full build:

mvn clean install -DskipTests

Doing the above builds the parts of Drill that Eclipse cannot. Then, switch to Eclipse which can do incremental Java builds from there on out.

Running JMockit-based Tests in Eclipse

You can waste vast amounts of time trying to get JMockit-based tests to run in Eclipse. You may encounter cryptic errors such as:

NoClassdefFoundError org.junit.runner.Runner
...
java.lang.UnsupportedClassVersionError: com/sun/tools/attach/spi/AttachProvider :
      Unsupported major.minor version 52.0

The first error says that JUnit could not find the test runner defined within JMockit. This is sometimes due to a class path error. But, it can also be due to the second error (which is hidden by JUnit and reported as the first error.) The error is telling you that you compiled the code for Java 8 (Major version 52) but was being run by an earlier version (the one that Eclipse helpfully chose.)

To solve these errors, you must have a consistent version of Java used by Maven and Eclipse. Drill still builds with Java 7, though Java 8 has been the current version for quite some time. To get everything to build, choose one version. Here, I chose Java 8.

  • Ensure that the target version of Java is installed on your machine. (Here I assume a Mac.)
  • Ensure that Eclipse runs with that version. Follow these instructions. (I found I had to use the full class path.)
  • Ensure that Eclipse has that JDK version set as the default version in Eclipse -> Preferences -> Java -> Installed JREs.
  • In the drill-root/pom.xml, select the JDK version of your choice:
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
  • Select the Drill root project in the Package Explorer and, from the context menu, choose Maven -> Update Project.

If you still encounter the errors, figure out which part of the build/run process uses the wrong Java version.

  • In the Debug view, select the test that failed and choose Properties from the context menu. Look at the launch command. Ensure that it used the selected JDK version.

Once you have everything working, you may still occasionally get the following error when debugging tests that use JMockit:

JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): on getting class status [util.c:1285]

This is a known bug in the JVM that you can ignore.

Clone this wiki locally