本文整理汇总了Java中org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectConfigurationRequest.getProject方法的具体用法?Java ProjectConfigurationRequest.getProject怎么用?Java ProjectConfigurationRequest.getProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest
的用法示例。
在下文中一共展示了ProjectConfigurationRequest.getProject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest; //导入方法依赖的package包/类
/**
* {@inheritDoc} In the case of a non-GWT project, we do nothing.
*/
@Override
public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor)
throws CoreException {
Activator.log("AbstractMavenProjectConfigurator.configure request=" + request);
// Sometimes M2Eclipse calls this method with request == null. Why?
if (request != null) {
MavenProject mavenProject = request.getMavenProject();
Activator.log("AbstractMavenProjectConfigurator.configure mavenProject=" + mavenProject
+ " getGWtMavenPlugin=" + getGwtMavenPlugin(mavenProject));
if (mavenProject != null && getGwtMavenPlugin(mavenProject) != null) {
IProject project = request.getProject();
// Make sure it is a java project, GWT Maven Plugin 2 gwt-app will not auto configure as one
NatureUtils.addNature(project, JavaCore.NATURE_ID);
doConfigure(mavenProject, project, request, monitor);
}
}
}
示例2: configure
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest; //导入方法依赖的package包/类
@Override
public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
GwtWtpPlugin.logMessage("WtpMavenProjectConfigurator.doConfigure() invoked");
// Given a pom.xml configuration
Model pom = request.getMavenProject().getModel();
// When the GWT plugin exists in POM
if (isGwtProject(pom)) {
IProject eclipseProject = request.getProject();
IFacetedProject facetedProject = ProjectFacetsManager.create(eclipseProject);
// Then add GWT facet
new GwtMavenFacetManager().addGwtFacet(pom, facetedProject, monitor);
}
}
示例3: configure
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest; //导入方法依赖的package包/类
@Override
public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor)
throws CoreException {
IProject project = request.getProject();
IFacetedProject facetedProject = ProjectFacetsManager.create(project);
if (facetedProject == null || facetedProject.hasProjectFacet(AppEngineStandardFacet.FACET)) {
return;
}
IFile appEngineWebXml = WebProjectUtil.findInWebInf(project, new Path("appengine-web.xml"));
if (appEngineWebXml == null || !appEngineWebXml.exists()) {
return;
}
AppEngineStandardFacet.installAppEngineFacet(facetedProject, true, monitor);
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:15,代码来源:AppEngineStandardProjectDetector.java
示例4: configure
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest; //导入方法依赖的package包/类
@Override
public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
final ConfiguratorContext context = new ConfiguratorContext(maven, projectManager);
IProject project = request.getProject();
monitor.setTaskName(Messages.CProjectConfigurator_task_name + project.getName());
logger.info("configure");
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
// Set the first created configuration as active.
boolean setActive = true;
final IMavenProjectFacade facade = request.getMavenProjectFacade();
List<NarExecution> narExecutions = MavenUtils.buildCompileNarExecutions(context, facade, monitor);
narExecutions.addAll(MavenUtils.buildTestCompileNarExecutions(context, facade, monitor));
for (NarExecution narSettings : narExecutions) {
if (!narSettings.isSkip()) {
final String os = narSettings.getOS();
final String linkerName = narSettings.getLinkerName();
final AbstractSettingsSynchroniser synchro = SynchroniserFactory.getSettingsSynchroniser(os, linkerName);
final String toolchain = synchro.getToolchain();
for (NarBuildArtifact artifactSettings : narSettings.getArtifactSettings()) {
final String configName = artifactSettings.getConfigName();
final String cdtArtefactType = CdtUtils.convertArtefactType(artifactSettings.getType());
IToolChain tc = getToolChain(toolchain, cdtArtefactType);
ICProjectDescription desc = getCdtProject(project, tc, cdtArtefactType, monitor);
ICConfigurationDescription cfg = getCdtMavenConfig(project, desc, tc, cdtArtefactType, configName, setActive, monitor);
setActive = false;
synchro.fullSync(cfg, artifactSettings);
mngr.setProjectDescription(project, desc);
}
}
}
AbstractProjectConfigurator jConfig = LifecycleMappingFactory.createProjectConfigurator(JAVA_CONFIGURATOR_ID);
jConfig.configure(request, monitor);
// ensure CDT builder is after the Maven one
boolean changed = false;
IProjectDescription description = project.getDescription();
ICommand cdtBuilder = null;
ICommand mavenBuilder = null;
ArrayList<ICommand> newSpec = new ArrayList<ICommand>();
for (ICommand command : description.getBuildSpec()) {
if (ManagedCProjectNature.getBuilderID().equals(command.getBuilderName()) && mavenBuilder == null) {
cdtBuilder = command;
} else {
newSpec.add(command);
}
if (IMavenConstants.BUILDER_ID.equals(command.getBuilderName())) {
mavenBuilder = command;
if (cdtBuilder != null) {
newSpec.add(cdtBuilder);
changed = true;
}
}
}
if (changed) {
description.setBuildSpec(newSpec.toArray(new ICommand[newSpec.size()]));
project.setDescription(description, monitor);
}
}
示例5: configure
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest; //导入方法依赖的package包/类
@Override
public void configure(ProjectConfigurationRequest request,
IProgressMonitor monitor) throws CoreException {
IProject eclipseProject = request.getProject();
if (eclipseProject.hasNature(JavaCore.NATURE_ID)) {
IJavaProject javaProject = JavaCore.create(eclipseProject);
IMavenProjectFacade mavenProject = request.getMavenProjectFacade();
List<MojoExecution> executions = mavenProject.getMojoExecutions(
"com.marvinformatics.formatter", "formatter-maven-plugin",
monitor, "validate");
MojoExecution execution = executions.get(0);
Xpp3Dom cfg = execution.getConfiguration();
String javaConfigFile = cfg.getChild("configFile").getValue();
if (javaConfigFile == null
|| "${configfile}".equals(javaConfigFile))
javaConfigFile = "src/config/eclipse/formatter/java.xml";
IFile cfgFile = eclipseProject.getFile(javaConfigFile);
if (!cfgFile.exists())
return;
InputStream content = cfgFile.getContents();
BufferedReader reader = new BufferedReader(new InputStreamReader(
content));
String line = null;
Map<String, String> opts = javaProject.getOptions(false);
try {
while ((line = reader.readLine()) != null) {
// <setting
// id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags"
// value="insert" />
if (!line.contains("<setting "))
continue;
int first = line.indexOf("id=\"") + 4;
String id = line.substring(first, line.indexOf('"', first));
first = line.indexOf("value=\"") + 7;
String value = line.substring(first,
line.indexOf('"', first));
opts.put(id, value);
}
} catch (IOException e) {
}
javaProject.setOptions(opts);
}
// jsdtConfigFile = cfg.getChild("configJsFile").getValue();
// src/config/eclipse/formatter/javascript.xml
}