Package org.apache.maven.model.building

Examples of org.apache.maven.model.building.FileModelSource


            artifact.selectVersion( pomArtifact.getVersion() );
            artifact.setFile( pomFile );
            artifact.setResolved( true );
        }

        return build( localProject ? pomFile : null, new FileModelSource( pomFile ), config );
    }
View Full Code Here


            if ( StringUtils.contains( version, VersionUtil.SNAPSHOT ) )
            {
                File localSnapshotModel = findTimeStampedSnapshotPom( groupId, artifactId, version, model.getParent() );
                if ( localSnapshotModel != null )
                {
                    return new FileModelSource( localSnapshotModel );
                }

            }

            for ( RemoteRepository remoteRepository : remoteRepositories )
            {
                try
                {
                    boolean success = getModelFromProxy( remoteRepository, groupId, artifactId, version, filename );
                    if ( success && model.exists() )
                    {
                        log.info( "Model '{}' successfully retrieved from remote repository '{}'",
                                  model.getAbsolutePath(), remoteRepository.getId() );
                        break;
                    }
                }
                catch ( ResourceDoesNotExistException e )
                {
                    log.info(
                        "An exception was caught while attempting to retrieve model '{}' from remote repository '{}'.Reason:{}",
                        model.getAbsolutePath(), remoteRepository.getId(), e.getMessage() );
                }
                catch ( Exception e )
                {
                    log.warn(
                        "An exception was caught while attempting to retrieve model '{}' from remote repository '{}'.Reason:{}",
                        model.getAbsolutePath(), remoteRepository.getId(), e.getMessage() );

                    continue;
                }
            }
        }

        return new FileModelSource( model );
    }
View Full Code Here

                {
                    modelRequest.setPomFile( pomArtifact.getFile() );
                }
                else
                {
                    modelRequest.setModelSource( new FileModelSource( pomArtifact.getFile() ) );
                }

                model = modelBuilder.build( modelRequest ).getEffectiveModel();
            }
            catch ( ModelBuildingException e )
View Full Code Here

            throw new UnresolvableModelException( e.getMessage(), groupId, artifactId, version, e );
        }

        File pomFile = pomArtifact.getFile();

        return new FileModelSource( pomFile );
    }
View Full Code Here

            }

            pomFile = pomArtifact.getFile();
        }

        return new FileModelSource( pomFile );
    }
View Full Code Here

    // ----------------------------------------------------------------------

    public ProjectBuildingResult build( File pomFile, ProjectBuildingRequest request )
        throws ProjectBuildingException
    {
        return build( pomFile, new FileModelSource( pomFile ), new InternalConfig( request, null ) );
    }
View Full Code Here

            artifact.selectVersion( pomArtifact.getVersion() );
            artifact.setFile( pomFile );
            artifact.setResolved( true );
        }

        return build( localProject ? pomFile : null, new FileModelSource( pomFile ), config );
    }
View Full Code Here

    {
        File pomFile = new File( "src/test/resources/projects/modelsource/module01/pom.xml" );
        MavenSession mavenSession = createMavenSession( pomFile );
        ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
        configuration.setRepositorySession( mavenSession.getRepositorySession() );
        ModelSource modelSource = new FileModelSource( pomFile );
        ProjectBuildingResult result =
            lookup( org.apache.maven.project.ProjectBuilder.class ).build( modelSource, configuration );

        assertNotNull( result.getProject().getParentFile() );
    }
View Full Code Here

                {
                    modelRequest.setPomFile( pomArtifact.getFile() );
                }
                else
                {
                    modelRequest.setModelSource( new FileModelSource( pomArtifact.getFile() ) );
                }

                model = modelBuilder.build( modelRequest ).getEffectiveModel();
            }
            catch ( ModelBuildingException e )
View Full Code Here

                + version + " due to " + e.getMessage(), groupId, artifactId, version, e );
        }

        File pomFile = pomArtifact.getFile();

        return new FileModelSource( pomFile );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.model.building.FileModelSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.