本文整理汇总了Java中org.jetbrains.idea.maven.project.MavenProject.getPluginConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java MavenProject.getPluginConfiguration方法的具体用法?Java MavenProject.getPluginConfiguration怎么用?Java MavenProject.getPluginConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jetbrains.idea.maven.project.MavenProject
的用法示例。
在下文中一共展示了MavenProject.getPluginConfiguration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doFilterText
import org.jetbrains.idea.maven.project.MavenProject; //导入方法依赖的package包/类
public static void doFilterText(Module module,
String text,
Properties additionalProperties,
@Nullable String propertyEscapeString,
Appendable out) throws IOException {
MavenProjectsManager manager = MavenProjectsManager.getInstance(module.getProject());
MavenProject mavenProject = manager.findProject(module);
if (mavenProject == null) {
out.append(text);
return;
}
Element pluginConfiguration = mavenProject.getPluginConfiguration("org.apache.maven.plugins", "maven-resources-plugin");
String escapeWindowsPathsStr = MavenJDOMUtil.findChildValueByPath(pluginConfiguration, "escapeWindowsPaths");
boolean escapeWindowsPath = escapeWindowsPathsStr == null || Boolean.parseBoolean(escapeWindowsPathsStr);
doFilterText(MavenFilteredPropertyPsiReferenceProvider.getDelimitersPattern(mavenProject),
manager,
mavenProject,
text,
additionalProperties,
propertyEscapeString,
escapeWindowsPath,
null,
out);
}
示例2: getMavenPackagingPluginConfiguration
import org.jetbrains.idea.maven.project.MavenProject; //导入方法依赖的package包/类
@Nullable
private static Element getMavenPackagingPluginConfiguration(@NotNull MavenProject mavenProject) {
Element mavenPackagingPluginConfiguration = null;
final String packaging = mavenProject.getPackaging();
if (StringUtil.isEmpty(packaging)) {
mavenPackagingPluginConfiguration = mavenProject.getPluginConfiguration("org.apache.maven.plugins", "maven-jar-plugin");
}
else {
final String pluginArtifactId = PACKAGING_PLUGINS.get(StringUtil.toLowerCase(packaging));
if (pluginArtifactId != null) {
mavenPackagingPluginConfiguration = mavenProject.getPluginConfiguration("org.apache.maven.plugins", pluginArtifactId);
}
}
return mavenPackagingPluginConfiguration;
}
示例3: getDelimitersPattern
import org.jetbrains.idea.maven.project.MavenProject; //导入方法依赖的package包/类
@NotNull
public static Pattern getDelimitersPattern(MavenProject mavenProject) {
Pattern res = mavenProject.getCachedValue(KEY);
if (res == null) {
Element cfg = mavenProject.getPluginConfiguration("org.apache.maven.plugins", "maven-resources-plugin");
if (cfg == null) {
res = DEFAULT_DELIMITERS;
}
else {
List<String> delimiters = MavenJDOMUtil.findChildrenValuesByPath(cfg, "delimiters", "delimiter");
if (delimiters.isEmpty() || delimiters.size() > 10) {
res = DEFAULT_DELIMITERS;
}
else {
StringBuilder patternBuilder = new StringBuilder();
for (String delimiter : delimiters) {
delimiter = delimiter.trim();
if (delimiter.isEmpty()) continue;
int ind = delimiter.indexOf('*');
if (ind >= 0) {
appendDelimiter(patternBuilder, delimiter.substring(0, ind), delimiter.substring(ind + 1));
}
else {
appendDelimiter(patternBuilder, delimiter, delimiter);
}
}
// <useDefaultDelimiters> is not used if custom delimiters are not present.
boolean useDefaultDelimiters = true;
String useDefaultDelimitersText = cfg.getChildText("useDefaultDelimiters");
if (StringUtil.isNotEmpty(useDefaultDelimitersText)) {
useDefaultDelimiters = Boolean.parseBoolean(useDefaultDelimitersText);
}
if (useDefaultDelimiters) {
appendDelimiter(patternBuilder, "${", "}");
appendDelimiter(patternBuilder, "@", "@");
}
res = Pattern.compile(patternBuilder.toString());
}
}
res = mavenProject.putCachedValue(KEY, res);
}
return res;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:MavenFilteredPropertyPsiReferenceProvider.java
示例4: configure
import org.jetbrains.idea.maven.project.MavenProject; //导入方法依赖的package包/类
@Override
public void configure(@NotNull MavenProject mavenProject, @NotNull Project project, @Nullable Module module) {
if (module == null) return;
Element cfg = mavenProject.getPluginConfiguration("com.googlecode", "maven-idea-plugin");
if (cfg == null) return;
configureJdk(cfg, module);
MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(project);
String downloadSources = cfg.getChildTextTrim("downloadSources");
if (!StringUtil.isEmptyOrSpaces(downloadSources)) {
projectsManager.getImportingSettings().setDownloadSourcesAutomatically(Boolean.parseBoolean(downloadSources));
}
String downloadJavadocs = cfg.getChildTextTrim("downloadJavadocs");
if (!StringUtil.isEmptyOrSpaces(downloadJavadocs)) {
projectsManager.getImportingSettings().setDownloadDocsAutomatically(Boolean.parseBoolean(downloadJavadocs));
}
String assertNotNull = cfg.getChildTextTrim("assertNotNull");
if (!StringUtil.isEmptyOrSpaces(assertNotNull)) {
CompilerConfiguration.getInstance(project).setAddNotNullAssertions(Boolean.parseBoolean(assertNotNull));
}
String autoscrollToSource = cfg.getChildTextTrim("autoscrollToSource");
if (!StringUtil.isEmptyOrSpaces(autoscrollToSource)) {
((ProjectViewImpl)ProjectView.getInstance(project)).setAutoscrollToSource(Boolean.parseBoolean(autoscrollToSource), ProjectViewPane.ID);
}
String autoscrollFromSource = cfg.getChildTextTrim("autoscrollFromSource");
if (!StringUtil.isEmptyOrSpaces(autoscrollFromSource)) {
((ProjectViewImpl)ProjectView.getInstance(project)).setAutoscrollFromSource(Boolean.parseBoolean(autoscrollFromSource), ProjectViewPane.ID);
}
String hideEmptyPackages = cfg.getChildTextTrim("hideEmptyPackages");
if (!StringUtil.isEmptyOrSpaces(hideEmptyPackages)) {
ProjectView.getInstance(project).setHideEmptyPackages(Boolean.parseBoolean(hideEmptyPackages), ProjectViewPane.ID);
}
String optimizeImportsBeforeCommit = cfg.getChildTextTrim("optimizeImportsBeforeCommit");
if (!StringUtil.isEmptyOrSpaces(optimizeImportsBeforeCommit)) {
VcsConfiguration.getInstance(module.getProject()).OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = Boolean.parseBoolean(optimizeImportsBeforeCommit);
}
String performCodeAnalisisBeforeCommit = cfg.getChildTextTrim("performCodeAnalisisBeforeCommit");
if (!StringUtil.isEmptyOrSpaces(performCodeAnalisisBeforeCommit)) {
VcsConfiguration.getInstance(module.getProject()).CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT = Boolean.parseBoolean(performCodeAnalisisBeforeCommit);
}
String reformatCodeBeforeCommit = cfg.getChildTextTrim("reformatCodeBeforeCommit");
if (!StringUtil.isEmptyOrSpaces(reformatCodeBeforeCommit)) {
VcsConfiguration vcsConfiguration = VcsConfiguration.getInstance(module.getProject());
boolean value = Boolean.parseBoolean(reformatCodeBeforeCommit);
vcsConfiguration.REFORMAT_BEFORE_FILE_COMMIT = value;
vcsConfiguration.REFORMAT_BEFORE_PROJECT_COMMIT = value;
}
}