Git Product home page Git Product logo

com.ifedorenko.m2e.sourcelookup's Introduction

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.

The class folders and jar files are scanned for META-INF/maven/**/pom.properties 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.

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.

Installation

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.1.0.201402131627

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

New in 1.1.0.201402120526

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

New in version 1.1.0.201401182304

  • Preliminary java 8 support

New in version 1.1.0.201309291737

  • 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 the artifact the class was loaded from.
  • javaagent implementation will not instrument classes that have existing JSR-45 SMAP.

com.ifedorenko.m2e.sourcelookup's People

Contributors

ifedorenko avatar

Watchers

 avatar

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.