本文整理匯總了Java中org.apache.maven.project.MavenProject.getProperties方法的典型用法代碼示例。如果您正苦於以下問題:Java MavenProject.getProperties方法的具體用法?Java MavenProject.getProperties怎麽用?Java MavenProject.getProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.maven.project.MavenProject
的用法示例。
在下文中一共展示了MavenProject.getProperties方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: simpleDefaultProperty
import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
static @NonNull ExternalDefaultBuilder<String> simpleDefaultProperty(final @NullAllowed String expressionProperty) {
return new ExternalDefaultBuilder<String>() {
@Override
public String externalValue(MavenProject prj) {
if (expressionProperty == null) {
return null;
}
Properties prop = prj.getProperties();
if (prop != null) {
return prop.getProperty(expressionProperty);
}
return null;
}
};
}
示例2: performOperation
import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
@Override
public void performOperation(POMModel model) {
org.netbeans.modules.maven.model.pom.Project root = model.getProject();
if (root != null) {
MavenProject parent = context.getParent();
if (parent != null) {
Parent parentpom = model.getFactory().createParent();
parentpom.setGroupId(parent.getGroupId());
parentpom.setArtifactId(parent.getArtifactId());
parentpom.setVersion(parent.getVersion());
File pfile = FileUtil.normalizeFile(parent.getFile());
String rel = FileUtilities.relativizeFile(context.getProjectDirectory(), pfile);
if (rel != null) {
if ("..".equals(rel) || "../pom.xml".equals(rel)) {
} else {
parentpom.setRelativePath(rel);
}
} else {
parentpom.setRelativePath("");
}
root.setPomParent(parentpom);
}
if (parent == null || !context.getGroupId().equals(parent.getGroupId())) {
root.setGroupId(context.getGroupId());
}
root.setArtifactId(context.getArtifactId());
if (parent == null || !context.getVersion().equals(parent.getVersion())) {
root.setVersion(context.getVersion());
}
root.setPackaging(packaging);
boolean setEncoding = true;
if (parent != null) {
java.util.Properties parentprops = parent.getProperties();
if (parentprops != null && parentprops.containsKey("project.build.sourceEncoding")) {
setEncoding = false;
}
}
if (setEncoding) {
Properties props = root.getProperties();
if (props == null) {
props = model.getFactory().createProperties();
root.setProperties(props);
}
props.setProperty("project.build.sourceEncoding", "UTF-8");
}
}
}
示例3: MavenProjectContext
import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
public MavenProjectContext(MavenProject project, ResourceConfig resourceConfig, BuildLogger logger) {
super(project.getProperties(), resourceConfig, logger);
}