Java Code Examples for org.apache.maven.model.Model#getPomFile()

The following examples show how to use org.apache.maven.model.Model#getPomFile() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModelTree.java    From butterfly with MIT License 5 votes vote down vote up
private boolean add(Model model) {
        ModelNode temp = null;
        if (rootNode == null) {
            rootNode = new ModelNode(model);
            nodesInTree.add(rootNode);
// TODO
// We can comment this out in the future if we want to allow
// not fixing the root artifact
//        } else if (rootNode.isChildOf(model)) {
//            temp = rootNode;
//            rootNode = new ModelNode(model);
//            rootNode.addChild(temp);
//            nodesInTree.add(rootNode);
        } else {
            for (ModelNode n : nodesInTree) {
                if(n.isParentOf(model)) {
                    temp = new ModelNode(model);
                    n.addChild(temp);
                    nodesInTree.add(temp);
                    break;
                }
            }
            if (temp == null) {
                return false;
            }
        }
// TODO
// We can comment this out in the future if we need this feature
//        modelsInTree.add(model);
        if (model.getPomFile() != null) {
            pomFilesInTree.add(model.getPomFile());
        }
        return true;
    }
 
Example 2
Source File: MavenEmbedder.java    From netbeans with Apache License 2.0 5 votes vote down vote up
static void normalizePath(Model model) {
    if (model != null) {
        File f = model.getPomFile();
        if (f != null) {
            model.setPomFile(FileUtil.normalizeFile(f));
        }
    }
}
 
Example 3
Source File: PomProperty.java    From flatten-maven-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public File get( Model model )
{
    return model.getPomFile();
}
 
Example 4
Source File: Project.java    From pom-manipulation-ext with Apache License 2.0 4 votes vote down vote up
/**
 * Create a project with only a Model. Only used by tests currently.
 * @param model the Model to use.
 * @throws ManipulationException if an error occurs.
 */
public Project( final Model model )
                throws ManipulationException
{
    this( model.getPomFile(), model );
}