本文整理汇总了Java中org.apache.maven.execution.ExecutionEvent.Type方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionEvent.Type方法的具体用法?Java ExecutionEvent.Type怎么用?Java ExecutionEvent.Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.execution.ExecutionEvent
的用法示例。
在下文中一共展示了ExecutionEvent.Type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
public static ExecutionEventObject create(JSONObject obj, ExecutionEvent.Type t) {
Long count = (Long) obj.get("prjcount");
int prjCount = -1;
if (count != null) {
prjCount = count.intValue();
}
ExecSession toRet = new ExecSession(prjCount, t);
JSONArray arr = (JSONArray) obj.get("mvncoreurls");
if (arr != null) {
List<URL> urlList = new ArrayList<URL>();
Iterator it = arr.iterator();
while (it.hasNext()) {
String url = (String) it.next();
try {
urlList.add(new URL(url));
} catch (MalformedURLException ex) {
Exceptions.printStackTrace(ex);
}
}
toRet.setMnvcoreurls(urlList.toArray(new URL[0]));
}
return toRet;
}
示例2: createEndForStart
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
private ExecutionEventObject createEndForStart(ExecutionEventObject start) {
ExecutionEventObject toRet;
if (start instanceof ExecMojo) {
ExecMojo startEx = (ExecMojo) start;
toRet = new ExecMojo(startEx.goal, startEx.plugin, startEx.phase, startEx.executionId, ExecutionEvent.Type.MojoFailed);
} else if (start instanceof ExecProject) {
ExecProject startPrj = (ExecProject) start;
toRet = new ExecProject(startPrj.gav, startPrj.currentProjectLocation, ExecutionEvent.Type.ProjectFailed);
} else if (start instanceof ExecSession) {
ExecSession ss = (ExecSession) start;
toRet = new ExecSession(ss.projectCount, ExecutionEvent.Type.SessionEnded);
} else {
ExecutionEvent.Type endType;
if (start.type.equals(ExecutionEvent.Type.ForkStarted)) {
endType = ExecutionEvent.Type.ForkFailed;
} else if (start.type.equals(ExecutionEvent.Type.ForkedProjectStarted)) {
endType = ExecutionEvent.Type.ForkedProjectFailed;
} else {
throw new RuntimeException("unknown event type: " + start.type);
}
toRet = new ExecutionEventObject(endType);
}
return toRet;
}
示例3: ExecMojo
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
public ExecMojo(String goal, GAV plugin, String phase, String executionId, ExecutionEvent.Type type) {
super(type);
this.goal = goal;
this.plugin = plugin;
this.phase = phase;
this.executionId = executionId;
}
示例4: create
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
public static ExecutionEventObject create(JSONObject obj) {
String s = (String) obj.get("type");
ExecutionEvent.Type t = ExecutionEvent.Type.valueOf(s);
if (mojo_types.contains(t)) {
return ExecMojo.create(obj, t);
}
if (project_types.contains(t)) {
return ExecProject.create(obj, t);
}
if (session_types.contains(t)) {
return ExecSession.create(obj, t);
}
return new ExecutionEventObject(t);
}
示例5: findParentNodeOfType
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
public ExecutionEventObject.Tree findParentNodeOfType(ExecutionEvent.Type startType) {
if (parentNode == null) {
return null;
}
ExecutionEventObject event = parentNode.getStartEvent();
if (event == null) {
return null;
}
if (startType.equals(event.type)) {
return parentNode;
}
return parentNode.findParentNodeOfType(startType);
}
示例6: create
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
public static ExecutionEventObject create(JSONObject obj, ExecutionEvent.Type t) {
JSONObject prj = (JSONObject) obj.get("prj");
String id = (String) prj.get("id");
String[] ids = id.split(":");
GAV prjGav = new GAV(ids[0], ids[1], ids[2]);
File prjFile = null;
String file = (String) prj.get("file");
if (file != null) {
prjFile = FileUtil.normalizeFile(new File(file));
}
return new ExecProject(prjGav, prjFile, t);
}
示例7: handle
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
public boolean handle(@Nonnull Object event) {
if (!(event instanceof ExecutionEvent)) {
return false;
}
ExecutionEvent executionEvent = (ExecutionEvent) event;
ExecutionEvent.Type supportedType = getSupportedType();
if (supportedType != null && !(supportedType.equals(executionEvent.getType()))) {
return false;
}
String supportedGoal = getSupportedPluginGoal();
if (supportedGoal == null) {
return _handle(executionEvent);
} else {
String[] gag = supportedGoal.split(":");
if (gag.length == 3) {
MojoExecution execution = executionEvent.getMojoExecution();
if (execution.getGroupId().equals(gag[0]) && execution.getArtifactId().equals(gag[1]) && execution.getGoal().equals(gag[2])) {
_handle(executionEvent);
return true;
} else {
return false;
}
} else {
reporter.print(toString() + " - unsupported supportedPluginGoal:" + supportedGoal);
return false;
}
}
}
示例8: matchingEvents
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
private boolean matchingEvents(ExecutionEvent.Type typeEnd, ExecutionEvent.Type typeStart) {
ExecutionEvent.Type match = END_TO_START_Mappings.get(typeEnd);
assert match != null : "unknown event type:" + typeEnd;
return typeStart.equals(match);
}
示例9: ExecutionEventObject
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
public ExecutionEventObject(ExecutionEvent.Type type) {
this.type = type;
}
示例10: ExecSession
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
public ExecSession(int projectCount, ExecutionEvent.Type type) {
super(type);
this.projectCount = projectCount;
}
示例11: ExecProject
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
public ExecProject(GAV currentProject, File currentProjectLocation, ExecutionEvent.Type type) {
super(type);
this.gav = currentProject;
this.currentProjectLocation = currentProjectLocation;
}
示例12: getSupportedType
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
@Nullable
@Override
protected ExecutionEvent.Type getSupportedType() {
return ExecutionEvent.Type.MojoSucceeded;
}
示例13: getSupportedType
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
@Nullable
protected ExecutionEvent.Type getSupportedType() {
return ExecutionEvent.Type.MojoSucceeded;
}
示例14: getSupportedType
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
@Nullable
protected abstract ExecutionEvent.Type getSupportedType();
示例15: getSupportedType
import org.apache.maven.execution.ExecutionEvent; //导入方法依赖的package包/类
@Override
protected ExecutionEvent.Type getSupportedType() {
return ExecutionEvent.Type.ProjectStarted;
}