本文整理汇总了Java中org.apache.maven.project.MavenProject.setFile方法的典型用法代码示例。如果您正苦于以下问题:Java MavenProject.setFile方法的具体用法?Java MavenProject.setFile怎么用?Java MavenProject.setFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.project.MavenProject
的用法示例。
在下文中一共展示了MavenProject.setFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: normalizePaths
import org.apache.maven.project.MavenProject; //导入方法依赖的package包/类
/**
* normalize all File references in the object tree.
* @param project
* @since 2.36
*/
public static void normalizePaths(MavenProject project) {
if (project == null) {
return;
}
File f = project.getFile();
if (f != null) {
project.setFile(FileUtil.normalizeFile(f));
}
normalizePath(project.getArtifact());
normalizePaths(project.getAttachedArtifacts());
f = project.getParentFile();
if (f != null) {
project.setParentFile(FileUtil.normalizeFile(f));
}
normalizePath(project.getParentArtifact());
normalizePaths(project.getArtifacts());
normalizePaths(project.getDependencyArtifacts());
normalizePaths(project.getExtensionArtifacts());
normalizePaths(project.getPluginArtifacts());
normalizePath(project.getModel());
normalizePath(project.getOriginalModel());
}
示例2: getFallbackProject
import org.apache.maven.project.MavenProject; //导入方法依赖的package包/类
@NbBundle.Messages({
"LBL_Incomplete_Project_Name=<partially loaded Maven project>",
"LBL_Incomplete_Project_Desc=Partially loaded Maven project; try building it."
})
public static MavenProject getFallbackProject(File projectFile) throws AssertionError {
MavenProject newproject = new MavenProject();
newproject.setGroupId("error");
newproject.setArtifactId("error");
newproject.setVersion("0");
newproject.setPackaging("pom");
newproject.setName(Bundle.LBL_Incomplete_Project_Name());
newproject.setDescription(Bundle.LBL_Incomplete_Project_Desc());
newproject.setFile(projectFile);
return newproject;
}