本文整理汇总了Java中org.jetbrains.idea.maven.tasks.TasksBundle类的典型用法代码示例。如果您正苦于以下问题:Java TasksBundle类的具体用法?Java TasksBundle怎么用?Java TasksBundle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TasksBundle类属于org.jetbrains.idea.maven.tasks包,在下文中一共展示了TasksBundle类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeTask
import org.jetbrains.idea.maven.tasks.TasksBundle; //导入依赖的package包/类
@Override
public boolean executeTask(DataContext dataContext, RunConfiguration runConfiguration, ExecutionEnvironment executionEnvironment, MuleBeforeRunTask muleBeforeRunTask)
{
final Semaphore targetDone = new Semaphore();
final List<Boolean> results = new ArrayList<>();
final Project project = executionEnvironment.getProject();
MuleConfiguration muleConfiguration = (MuleConfiguration) runConfiguration;
Module[] modules = muleConfiguration.getModules();
for (Module nextModule : modules) {
//final MavenProject mavenProject = getMavenProject(runConfiguration, project);
final MavenProject mavenProject = getMavenProject(nextModule);
try {
ApplicationManager.getApplication().invokeAndWait(new Runnable() {
public void run() {
if (!project.isDisposed() && mavenProject != null) {
FileDocumentManager.getInstance().saveAllDocuments();
final MavenExplicitProfiles explicitProfiles = MavenProjectsManager.getInstance(project).getExplicitProfiles();
final MavenRunner mavenRunner = MavenRunner.getInstance(project);
targetDone.down();
(new Task.Backgroundable(project, TasksBundle.message("maven.tasks.executing"), true) {
public void run(@NotNull ProgressIndicator indicator) {
try {
MavenRunnerParameters params =
new MavenRunnerParameters(true, mavenProject.getDirectory(), ParametersListUtil.parse("package"), explicitProfiles.getEnabledProfiles(),
explicitProfiles.getDisabledProfiles());
boolean result = mavenRunner.runBatch(Collections.singletonList(params), null, null, TasksBundle.message("maven.tasks.executing"), indicator);
results.add(result);
} finally {
targetDone.up();
}
}
public boolean shouldStartInBackground() {
return MavenRunner.getInstance(project).getSettings().isRunMavenInBackground();
}
public void processSentToBackground() {
MavenRunner.getInstance(project).getSettings().setRunMavenInBackground(true);
}
}).queue();
}
}
}, ModalityState.NON_MODAL);
} catch (Exception exeception) {
return false;
}
targetDone.waitFor();
}
boolean endResult = true;
for (Boolean nextResult : results) {
endResult = endResult && nextResult;
}
return endResult;
}
示例2: getTargetDisplayString
import org.jetbrains.idea.maven.tasks.TasksBundle; //导入依赖的package包/类
@Override
protected String getTargetDisplayString() {
return TasksBundle.message("maven.tasks.goal");
}