Package org.apache.maven.artifact.repository

Examples of org.apache.maven.artifact.repository.ArtifactRepository.pathOf()


                + "'. Only file based repositories are supported" );
        }

        adjustDistributionArtifactHandler( artifact );

        String artifactPath = repository.pathOf( artifact );

        if ( model != null )
        {
            // only check if it is a standalone POM, or an artifact other than a POM
            // ie, don't check the location of the POM for another artifact matches that of the artifact
View Full Code Here


                //specified in the model object/pom
                Artifact modelArtifact = artifactFactory.createArtifactWithClassifier( model.getGroupId(), model
                    .getArtifactId(), model.getVersion(), artifact.getType(), artifact.getClassifier() );

                adjustDistributionArtifactHandler( modelArtifact );
                String modelPath = repository.pathOf( modelArtifact );
                if ( !modelPath.equals( artifactPath ) )
                {
                    addFailure( artifact, "repository-pom-location",
                                "The artifact is out of place. It does not match the specified location in the repository pom: "
                                    + modelPath );
View Full Code Here

                {
                    Artifact extractedArtifact = artifactFactory.createBuildArtifact( extractedModel.getGroupId(),
                                                                                      extractedModel.getArtifactId(),
                                                                                      extractedModel.getVersion(),
                                                                                      extractedModel.getPackaging() );
                    if ( !repository.pathOf( extractedArtifact ).equals( artifactPath ) )
                    {
                        addFailure( artifact, "packaged-pom-location",
                                    "The artifact is out of place. It does not match the specified location in the packaged pom." );
                    }
                }
View Full Code Here

            {
                // skip repo.
                continue;
            }

            String path = repository.pathOf( artifact );
            File f = new File( repository.getBasedir(), path );
            if ( f.exists() )
            {
                // Found it.
                managedArtifact = createManagedArtifact( repository, artifact, f );
View Full Code Here

            return;
        }

        ArtifactRepository localRepo = request.getLocalRepository();

        File localFile = new File( localRepo.getBasedir(), localRepo.pathOf( artifact ) );

        artifact.setFile( localFile );

        if ( !localFile.exists() )
        {
View Full Code Here

                throw new IOException( localFile + " does not exist and no remote repositories are configured" );
            }

            ArtifactRepository remoteRepo = request.getRemoteRepositories().get( 0 );

            File remoteFile = new File( remoteRepo.getBasedir(), remoteRepo.pathOf( artifact ) );

            FileUtils.copyFile( remoteFile, localFile );
        }

        artifact.setResolved( true );
View Full Code Here

    protected void assertRemoteArtifactPresent( Artifact artifact )
        throws Exception
    {
        ArtifactRepository remoteRepo = remoteRepository();

        String path = remoteRepo.pathOf( artifact );

        File file = new File( remoteRepo.getBasedir(), path );

        if ( !file.exists() )
        {
View Full Code Here

    protected void assertLocalArtifactPresent( Artifact artifact )
        throws Exception
    {
        ArtifactRepository localRepo = localRepository();

        String path = localRepo.pathOf( artifact );

        File file = new File( localRepo.getBasedir(), path );

        if ( !file.exists() )
        {
View Full Code Here

    protected void assertRemoteArtifactNotPresent( Artifact artifact )
        throws Exception
    {
        ArtifactRepository remoteRepo = remoteRepository();

        String path = remoteRepo.pathOf( artifact );

        File file = new File( remoteRepo.getBasedir(), path );

        if ( file.exists() )
        {
View Full Code Here

    protected void assertLocalArtifactNotPresent( Artifact artifact )
        throws Exception
    {
        ArtifactRepository localRepo = localRepository();

        String path = localRepo.pathOf( artifact );

        File file = new File( localRepo.getBasedir(), path );

        if ( file.exists() )
        {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.