Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] m2e classloader made from MavenProject.getCompileClasspathElements()?

What are you trying to achieve?

Neither m2e inside Eclipse workspace nor maven on command line create
classloaders for project compile classpath but there may be other ways
to achieve what you need.

--
Regards,
Igor

On 12-02-22 1:24 PM, Andrei Pozolotin wrote:
    *Igor, hello:*

    currently I am duplicating your m2e classloader; can you please clarify:

    1) where can I get m2e classloader made from
    MavenProject.getCompileClasspathElements()?
    (and also test class path elements?)

    I can not see it in any of:

    final IMaven maven = MavenPlugin.getMaven();
    final BuildContext buildContext = getBuildContext();
    final MavenSession session = getSession();
    final MojoExecution execution = getMojoExecution();
    final MavenProject project = session.getCurrentProject();

    2) is this classloader auto-updated on maven pom.xml change?
    if not, how can I force an update?

    the intent is to load newly incrementally built
    target/classes/com/example/SomeComponent.class
    and do some byte instrumentation on it,
    while having access to m2e-already-resolved compile (or test) scope;

    Thank you,

    Andrei.



Back to the top