Package org.apache.maven.archiva.model

Examples of org.apache.maven.archiva.model.ProjectReference


        }
    }

    private void updateProjectMetadata( ArtifactReference artifact, String path )
    {
        ProjectReference projectRef = new ProjectReference();
        projectRef.setGroupId( artifact.getGroupId() );
        projectRef.setArtifactId( artifact.getArtifactId() );

        try
        {
            String metadataPath = this.metadataTools.toPath( projectRef );
View Full Code Here


    private boolean fetchMetadataFromProxies( ManagedRepositoryContent managedRepository, DavServletRequest request,
                                              LogicalResource resource )
        throws DavException
    {
        ProjectReference project;
        VersionedReference versioned;

        try
        {
View Full Code Here

            {
                // Nothing to do here, not a snapshot, skip it.
                return;
            }

            ProjectReference reference = new ProjectReference();
            reference.setGroupId( artifact.getGroupId() );
            reference.setArtifactId( artifact.getArtifactId() );

            // Gather up all of the versions.
            List<String> allVersions = new ArrayList<String>( repository.getVersions( reference ) );

            // Split the versions into released and snapshots.
View Full Code Here

    }

    private void assertVersions( String groupId, String artifactId, String[] expectedVersions )
        throws Exception
    {
        ProjectReference reference = new ProjectReference();
        reference.setGroupId( groupId );
        reference.setArtifactId( artifactId );

        // Request the versions.
        Set<String> testedVersionSet = repoContent.getVersions( reference );

        // Sort the list (for asserts later)
View Full Code Here

        throws Exception
    {
        File actualFile = new File( managedDefaultDir, requestedResource );
        assertTrue( actualFile.exists() );

        ProjectReference metadata = createProjectReference( requestedResource );

        // Build expected metadata XML
        StringWriter expectedMetadataXml = new StringWriter();
        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
        m.setGroupId( metadata.getGroupId() );
        m.setArtifactId( metadata.getArtifactId() );
        m.setLatestVersion( latestVersion );
        m.setReleasedVersion( releaseVersion );

        if ( expectedVersions != null )
        {
View Full Code Here

        String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource );

        File actualFile = new File( managedDefaultDir, proxiedFile );
        assertTrue( actualFile.exists() );

        ProjectReference metadata = createProjectReference( requestedResource );

        // Build expected metadata XML
        StringWriter expectedMetadataXml = new StringWriter();
        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
        m.setGroupId( metadata.getGroupId() );
        m.setArtifactId( metadata.getArtifactId() );

        if ( expectedProxyVersions != null )
        {
            m.getAvailableVersions().addAll( Arrays.asList( expectedProxyVersions ) );
        }
View Full Code Here

        }
    }

    private void updateProjectMetadata( ArtifactReference artifact, String path )
    {
        ProjectReference projectRef = new ProjectReference();
        projectRef.setGroupId( artifact.getGroupId() );
        projectRef.setArtifactId( artifact.getArtifactId() );

        try
        {
            String metadataPath = this.metadataTools.toPath( projectRef );
View Full Code Here

            {
                // Nothing to do here, not a snapshot, skip it.
                return;
            }

            ProjectReference reference = new ProjectReference();
            reference.setGroupId( artifact.getGroupId() );
            reference.setArtifactId( artifact.getArtifactId() );

            // Gather up all of the versions.
            List<String> allVersions = new ArrayList<String>( repository.getVersions( reference ) );

            // Split the versions into released and snapshots.
View Full Code Here

        VersionedReference versionRef = new VersionedReference();
        versionRef.setGroupId( artifact.getGroupId() );
        versionRef.setArtifactId( artifact.getArtifactId() );
        versionRef.setVersion( artifact.getVersion() );

        ProjectReference projectRef = new ProjectReference();
        projectRef.setGroupId( artifact.getGroupId() );
        projectRef.setArtifactId( artifact.getArtifactId() );

        try
        {
            metadataTools.updateMetadata( repository, versionRef );
        }
View Full Code Here

        if ( !path.endsWith( "/" + MAVEN_METADATA ) )
        {
            throw new RepositoryMetadataException( "Cannot convert to versioned reference, not a metadata file. " );
        }

        ProjectReference reference = new ProjectReference();

        String normalizedPath = StringUtils.replace( path, "\\", "/" );
        String pathParts[] = StringUtils.split( normalizedPath, '/' );

        // Assume last part of the path is the version.

        int artifactIdOffset = pathParts.length - 2;
        int groupIdEnd = artifactIdOffset - 1;

        reference.setArtifactId( pathParts[artifactIdOffset] );

        StringBuffer gid = new StringBuffer();
        for ( int i = 0; i <= groupIdEnd; i++ )
        {
            if ( i > 0 )
            {
                gid.append( "." );
            }
            gid.append( pathParts[i] );
        }

        reference.setGroupId( gid.toString() );

        return reference;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.model.ProjectReference

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.