Package org.apache.maven.artifact.repository.metadata

Examples of org.apache.maven.artifact.repository.metadata.GroupRepositoryMetadata


    }

    private void loadPluginMappings( String groupId, List pluginRepositories, ArtifactRepository localRepository )
        throws RepositoryMetadataResolutionException
    {
        RepositoryMetadata metadata = new GroupRepositoryMetadata( groupId );

        repositoryMetadataManager.resolve( metadata, pluginRepositories, localRepository );

        Metadata repoMetadata = metadata.getMetadata();
        if ( repoMetadata != null )
        {
            for ( Iterator pluginIterator = repoMetadata.getPlugins().iterator(); pluginIterator.hasNext(); )
            {
                Plugin mapping = (Plugin) pluginIterator.next();

                String prefix = mapping.getPrefix();
               
                //if the prefix has already been found, don't add it again.
                //this is to preserve the correct ordering of prefix searching (MNG-2926)
                if ( !pluginDefinitionsByPrefix.containsKey( prefix ) )
                {
                    String artifactId = mapping.getArtifactId();

                    org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();

                    plugin.setGroupId( metadata.getGroupId() );

                    plugin.setArtifactId( artifactId );

                    pluginDefinitionsByPrefix.put( prefix, plugin );
                }
View Full Code Here


        versioning.setLatest( projectArtifact.getVersion() );
        versioning.updateTimestamp();
        ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( projectArtifact, versioning );
        projectArtifact.addMetadata( metadata );

        GroupRepositoryMetadata groupMetadata = new GroupRepositoryMetadata( project.getGroupId() );
        groupMetadata.addPluginMapping( getGoalPrefix(), project.getArtifactId(), project.getName() );

        projectArtifact.addMetadata( groupMetadata );
    }
View Full Code Here

        versioning.setLatest( projectArtifact.getVersion() );
        versioning.updateTimestamp();
        ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( projectArtifact, versioning );
        projectArtifact.addMetadata( metadata );

        GroupRepositoryMetadata groupMetadata = new GroupRepositoryMetadata( project.getGroupId() );
        groupMetadata.addPluginMapping( getGoalPrefix(), project.getArtifactId(), project.getName() );

        projectArtifact.addMetadata( groupMetadata );
    }
View Full Code Here

        versioning.setLatest( projectArtifact.getVersion() );
        versioning.updateTimestamp();
        ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( projectArtifact, versioning );
        projectArtifact.addMetadata( metadata );

        GroupRepositoryMetadata groupMetadata = new GroupRepositoryMetadata( project.getGroupId() );
        groupMetadata.addPluginMapping( getGoalPrefix(), project.getArtifactId(), project.getName() );

        projectArtifact.addMetadata( groupMetadata );
    }
View Full Code Here

    }

    private void loadPluginMappings( String groupId, List pluginRepositories, ArtifactRepository localRepository )
        throws RepositoryMetadataResolutionException
    {
        RepositoryMetadata metadata = new GroupRepositoryMetadata( groupId );

        repositoryMetadataManager.resolve( metadata, pluginRepositories, localRepository );

        Metadata repoMetadata = metadata.getMetadata();
        if ( repoMetadata != null )
        {
            for ( Iterator pluginIterator = repoMetadata.getPlugins().iterator(); pluginIterator.hasNext(); )
            {
                Plugin mapping = (Plugin) pluginIterator.next();

                String prefix = mapping.getPrefix();

                String artifactId = mapping.getArtifactId();

                org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();

                plugin.setGroupId( metadata.getGroupId() );

                plugin.setArtifactId( artifactId );

                pluginDefinitionsByPrefix.put( prefix, plugin );
            }
View Full Code Here

        assertFalse( "check no more failures", failures.hasNext() );
    }

    public void testInvalidPluginPrefix()
    {
        RepositoryMetadata metadata = new GroupRepositoryMetadata( "groupId" );
        metadata.getMetadata().addPlugin( createMetadataPlugin( "artifactId", null ) );
        metadata.getMetadata().addPlugin( createMetadataPlugin( "snapshot-artifact", "" ) );

        badMetadataReportProcessor.processMetadata( metadata, repository );

        Iterator failures = database.getIterator();
        assertTrue( "check there is a failure", failures.hasNext() );
View Full Code Here

        assertFalse( "check no more failures", failures.hasNext() );
    }

    public void testDuplicatePluginPrefixes()
    {
        RepositoryMetadata metadata = new GroupRepositoryMetadata( "groupId" );
        metadata.getMetadata().addPlugin( createMetadataPlugin( "artifactId", "default" ) );
        metadata.getMetadata().addPlugin( createMetadataPlugin( "snapshot-artifact", "default" ) );

        badMetadataReportProcessor.processMetadata( metadata, repository );

        Iterator failures = database.getIterator();
        assertTrue( "check there is a failure", failures.hasNext() );
View Full Code Here

        //Artifact level metadata
        metadata = new ArtifactRepositoryMetadata( artifact );
        metadataReportProcessor.processMetadata( metadata, repository );

        //Group level metadata
        metadata = new GroupRepositoryMetadata( "checksumTest" );
        metadataReportProcessor.processMetadata( metadata, repository );
    }
View Full Code Here

            }

            // groupMetadata
            if ( metaGroupId != null && metaGroupId.equals( groupDir ) )
            {
                metadata = new GroupRepositoryMetadata( metaGroupId );
            }
            else
            {
                /* If we reached this point, we have some bad metadata.
                 * We have a metadata file, with values for groupId / artifactId / version.
View Full Code Here

        assertFalse( "check no more failures", failures.hasNext() );
    }

    public void testValidPluginMetadata()
    {
        RepositoryMetadata metadata = new GroupRepositoryMetadata( "groupId" );
        metadata.getMetadata().addPlugin( createMetadataPlugin( "artifactId", "default" ) );
        metadata.getMetadata().addPlugin( createMetadataPlugin( "snapshot-artifact", "default2" ) );

        badMetadataReportProcessor.processMetadata( metadata, repository );

        Iterator failures = database.getIterator();
        assertFalse( "check there are no failures", failures.hasNext() );
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.repository.metadata.GroupRepositoryMetadata

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.