Package org.apache.maven.artifact.repository

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


        ArtifactRepository localRepository = localRepository();

        Artifact a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", null );
        File file = new File( localRepository.getBasedir(),
                              localRepository.pathOf( a ) );
        a.setFile( file );

        assertEquals( "a-0.0.1-SNAPSHOT.jar.lastUpdated", updateCheckManager.getTouchfile( a ).getName() );

        a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", "classifier" );
View Full Code Here


        assertEquals( "a-0.0.1-SNAPSHOT.jar.lastUpdated", updateCheckManager.getTouchfile( a ).getName() );

        a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", "classifier" );
        file = new File( localRepository.getBasedir(),
                              localRepository.pathOf( a ) );
        a.setFile( file );

        assertEquals( "a-0.0.1-SNAPSHOT-classifier.jar.lastUpdated", updateCheckManager.getTouchfile( a ).getName() );
    }
View Full Code Here

    {
        Artifact pom = artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(),
                                                              artifact.getVersion() );
        pom.setBaseVersion( artifact.getBaseVersion() );
        ArtifactRepository repository = artifact.getRepository();
        File file = new File( repository.getBasedir(), repository.pathOf( pom ) );

        boolean result = true;
        if ( file.exists() )
        {
            File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( pom ) );
View Full Code Here

                "Can't process repository '" + repository.getUrl() + "'. Only file based repositories are supported" );
        }

        adjustDistributionArtifactHandler( artifact );

        String artifactPath = repository.pathOf( artifact );

        //get the location of the artifact itself
        File file = new File( repository.getBasedir(), artifactPath );

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

            needsUpdate = true;
        }

        if ( needsUpdate || force || !target.exists() )
        {
            getFileFromRepository( artifactRepository.pathOf( artifact ), repository, managedRepository.getBasedir(),
                                   wagonProxy, target, policy, force );
        }
    }

    private void mergeMetadataFiles( File target, File metadataFile )
View Full Code Here

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

        adjustDistributionArtifactHandler( artifact );

        String artifactPath = repository.pathOf( artifact );

        //get the location of the artifact itself
        File file = new File( repository.getBasedir(), artifactPath );

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

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

        if ( "pom".equals( artifact.getType().toLowerCase() ) )
        {
            File f = new File( repository.getBasedir(), repository.pathOf( artifact ) );

            if ( !f.exists() )
            {
                addFailure( artifact, "pom-missing", "POM not found." );
            }
View Full Code Here

            throw new UnsupportedOperationException(
                "Can't process repository '" + repository.getUrl() + "'. Only file based repositories are supported" );
        }

        //check if checksum files exist
        String path = repository.pathOf( artifact );
        File file = new File( repository.getBasedir(), path );

        // TODO: make md5 configurable
//        verifyChecksum( repository, path + ".md5", file, md5Digester, reporter, artifact );
        verifyChecksum( repository, path + ".sha1", file, sha1Digester, artifact );
View Full Code Here

    {
        Artifact pom = artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact
            .getVersion() );
        pom.setBaseVersion( artifact.getBaseVersion() );
        ArtifactRepository repository = artifact.getRepository();
        File file = new File( repository.getBasedir(), repository.pathOf( pom ) );

        boolean result = true;
        if ( file.exists() )
        {
            File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( pom ) );
View Full Code Here

                        for ( Iterator i = results.iterator(); i.hasNext(); )
                        {
                            StandardArtifactIndexRecord result = (StandardArtifactIndexRecord) i.next();

                            //make sure it is not the same artifact
                            if ( !result.getFilename().equals( repository.pathOf( artifact ) ) )
                            {
                                //report only duplicates from the same groupId
                                String groupId = artifact.getGroupId();
                                if ( groupId.equals( result.getGroupId() ) )
                                {
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.