本文介绍有关Eclipse插件m2e的相关扩展点实现。
- 扩展点 org.eclipse.m2e.launching.mavenLaunchParticipants
[codesyntax lang="xml"]
<extension
point="org.eclipse.m2e.launching.mavenLaunchParticipants">
<mavenLaunchParticipant
class="suren.dev.debugger.MavenLaunchParticipantSuRen"
id="suren.dev.debugger.mavenLaunchParticipant1"
modes="run"
name="suren">
</mavenLaunchParticipant>
</extension>
[/codesyntax] 实现类 [codesyntax lang="java"]
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
import org.eclipse.m2e.internal.launch.IMavenLaunchParticipant;
/**
* @author surenpi.com
* @since jdk1.6
* 2015年8月11日
*/
public class MavenLaunchParticipantSuRen implements IMavenLaunchParticipant {
public MavenLaunchParticipantSuRen() {
}
@Override
public String getProgramArguments(ILaunchConfiguration arg0, ILaunch arg1, IProgressMonitor arg2) {
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, "suren2.dev.debugger", "getProgramArguments"));
return null;
}
@Override
public List<ISourceLookupParticipant> getSourceLookupParticipants(ILaunchConfiguration arg0, ILaunch arg1, IProgressMonitor arg2) {
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, "suren2.dev.debugger", "getSourceLookupParticipants"));
return null;
}
@Override
public String getVMArguments(ILaunchConfiguration arg0, ILaunch arg1, IProgressMonitor arg2) {
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, "suren2.dev.debugger", "getVMArguments"));
return null;
}
}
[/codesyntax]