No description, website, or topics provided.
Latest commit 542c2ce Aug 31, 2016 @ifedorenko added missing m2e-tycho p2 repository
Signed-off-by: Igor Fedorenko <>

Overview and mode of operation

Allows Eclipse Java debugger lookup sources of Java classes dynamically loaded by Maven, such as Maven plugins. Supports multiple versions of the same class loaded by the Maven VM. Sources are looked up among Eclipse workspace projects or resolved from Maven repositories as necessary.

Implementation uses -javaagent to instrument classes loaded by the target JVM with informtation about actual classes folder or jar file the classes are being loaded from. This information is captured in new JSR-45 SMAP stratum and retrived by Eclipse JDT debugger over JDWP.

Maven support

The class folders and jar files are scanned for META-INF/maven/**/ to identify m2e project location and Maven artifact (groupId,artifactId,version) tuple or "GAV" for short. Enabled Maven (Nexus) indexes are also consulted to identify jar file GAV.

The search for sources is performed in the following order

  • m2e workspace project name and location, if present, are matched to existing workspace projects
  • artifact GAV is matched to existing workspace projects
  • sources jar artifact corresponding to the GAV is resolved from Maven repositories.

PDE/Equinox support

In addition to Maven-specific source code lookup, implementation also supports Equinox-based runtimes, which is particularly useful for debugging Tycho builds where Equinox is embedded in Maven runtime.


Use for Maven launch configuration

Dynamic Sources Lookup m2e extension does not require any special configuration and is enabled by default for all debug Maven launches.

Manual configuration of Dynamic Sources Lookup

Dynamic Sources Lookup can be enabled for Java Application, Remote Java Application, JUnit and likely all other java launch configuration types.

  • Add -javaagent to VM arguments using launch configuration dialog
  • Add <stringAttribute/> element to .launch file

Source Lookup workspace preference page can be used to copy&paste exact values.

New in 1.2.0.<TBD>

Major rewrite, the goal is to separate general "core" source lookup functionality and support for specific project types and artifact repository layouts.

  • New ISourceContainerResolver and AbstractProjectSourceDescriber APIs
    • refactored Maven and Maven Binary Project to use the new APIs
    • reimplemented PDE/Equinox support to use the new APIs
  • New launch configuration types support
    • PDE Eclipse Application and JUnit Plugin-in Test
    • JDT Remote Java Application
  • Fixes first source lookup can lock UI thread for extended period of time for larger workspaces
  • Fixes first breakpoint condition evaluation fails in some cases
  • Changed supported Equinox version to 3.9+ and dropped support for earlier versions
  • Changed minimal required java runtime to 8

New in

  • M2E 1.6/Mars compatibility
  • ${sourcelookup_agent_path} dynamic string variable, for portable custom launch configurations

New in

  • Use Sonatype Central Repository REST API to identify artifacts
  • Harder, but not impossible, to install on Eclipse 4.3.x

New in

  • asm 5.0.3, java 8 should be fully supported now

New in

  • Equinox classloading hook can now be used instead of javaagent to instrument classes

New in

  • Ability to manually enable Dynamic Sources Lookup for any java launch configuration

New in version

  • Preliminary java 8 support

New in version

  • Maven 3.1.x and Tesla 3.1.x compatibility

New in version 1.1

  • Requires m2e 1.3 and Eclipse 4.3 (Kepler) M5
  • [new] Maven (Nexus) indexes are now used to identify jar files GAV.
  • [new] Ability to import artifacts as "Maven Binary" projects. Binary projects allow conditional breakpoints and other operations that require java project.
  • [fix] Source editor should more reliably refresh after sources jar download.
  • [fix] Exception stack traces do not show source file names

Known limitations

  • Sources resolution uses repositories and pluginRepositories configured in Maven User settings.xml but not the actual repository or snapshot repository from of the artifact the class was loaded from.
  • javaagent implementation will not instrument classes that have existing JSR-45 SMAP.