Package org.apache.archiva.metadata.repository.storage.maven2

Examples of org.apache.archiva.metadata.repository.storage.maven2.MavenProjectFacet


        assertEquals( TEST_CI_URL, model.getCiManagement( ).getUrl( ) );
        assertEquals( TEST_SCM_CONNECTION, model.getScm( ).getConnection( ) );
        assertEquals( TEST_SCM_DEV_CONNECTION, model.getScm( ).getDeveloperConnection( ) );
        assertEquals( TEST_SCM_URL, model.getScm( ).getUrl( ) );

        MavenProjectFacet mavenFacet = (MavenProjectFacet) model.getFacet( MavenProjectFacet.FACET_ID );
        assertEquals( groupId, mavenFacet.getGroupId( ) );
        assertEquals( artifactId, mavenFacet.getArtifactId( ) );
        assertEquals( TEST_PACKAGING, mavenFacet.getPackaging( ) );
        assertEquals( TEST_PARENT_GROUP_ID, mavenFacet.getParent( ).getGroupId( ) );
        assertEquals( TEST_PARENT_ARTIFACT_ID, mavenFacet.getParent( ).getArtifactId( ) );
        assertEquals( TEST_PARENT_VERSION, mavenFacet.getParent( ).getVersion( ) );
    }
View Full Code Here


        scm.setConnection( TEST_SCM_CONNECTION );
        scm.setDeveloperConnection( TEST_SCM_DEV_CONNECTION );
        scm.setUrl( TEST_SCM_URL );
        model.setScm( scm );

        MavenProjectFacet mavenProjectFacet = new MavenProjectFacet( );
        mavenProjectFacet.setGroupId( groupId );
        mavenProjectFacet.setArtifactId( artifactId );
        mavenProjectFacet.setPackaging( TEST_PACKAGING );
        MavenProjectParent parent = new MavenProjectParent( );
        parent.setGroupId( TEST_PARENT_GROUP_ID );
        parent.setArtifactId( TEST_PARENT_ARTIFACT_ID );
        parent.setVersion( TEST_PARENT_VERSION );
        mavenProjectFacet.setParent( parent );
        model.addFacet( mavenProjectFacet );

        GenericMetadataFacet genericMetadataFacet = new GenericMetadataFacet( );
        Map<String, String> props = new HashMap<String, String>( );
        props.put( TEST_GENERIC_METADATA_PROPERTY_NAME, TEST_GENERIC_METADATA_PROPERTY_VALUE );
View Full Code Here

    private void populateSharedModel( RepositorySession repositorySession, MetadataResolver metadataResolver,
                                      Collection<String> selectedRepos, Collection<String> projectVersions )
    {
        sharedModel = new ProjectVersionMetadata();

        MavenProjectFacet mavenFacet = new MavenProjectFacet();
        mavenFacet.setGroupId( groupId );
        mavenFacet.setArtifactId( artifactId );
        sharedModel.addFacet( mavenFacet );

        boolean isFirstVersion = true;

        for ( String version : projectVersions )
        {
            ProjectVersionMetadata versionMetadata = null;
            for ( String repoId : selectedRepos )
            {
                if ( versionMetadata == null )
                {
                    try
                    {
                        versionMetadata =
                            metadataResolver.resolveProjectVersion( repositorySession, repoId, groupId, artifactId,
                                                                    version );
                    }
                    catch ( MetadataResolutionException e )
                    {
                        log.error(
                            "Skipping invalid metadata while compiling shared model for " + groupId + ":" + artifactId
                                + " in repo " + repoId + ": " + e.getMessage() );
                    }
                }
            }

            if ( versionMetadata == null )
            {
                continue;
            }

            if ( isFirstVersion )
            {
                sharedModel = versionMetadata;
                sharedModel.setId( null );
            }
            else
            {
                MavenProjectFacet versionMetadataMavenFacet =
                    (MavenProjectFacet) versionMetadata.getFacet( MavenProjectFacet.FACET_ID );
                if ( versionMetadataMavenFacet != null )
                {
                    if ( mavenFacet.getPackaging() != null && !StringUtils.equalsIgnoreCase( mavenFacet.getPackaging(),
                                                                                             versionMetadataMavenFacet.getPackaging() ) )
                    {
                        mavenFacet.setPackaging( null );
                    }
                }
View Full Code Here

            MetadataResolver metadataResolver = repositorySession.getResolver();

            ProjectVersionMetadata sharedModel = new ProjectVersionMetadata();

            MavenProjectFacet mavenFacet = new MavenProjectFacet();
            mavenFacet.setGroupId( groupId );
            mavenFacet.setArtifactId( artifactId );
            sharedModel.addFacet( mavenFacet );

            boolean isFirstVersion = true;

            for ( String version : projectVersions )
            {
                ProjectVersionMetadata versionMetadata = null;
                for ( String repoId : selectedRepos )
                {
                    if ( versionMetadata == null || versionMetadata.isIncomplete() )
                    {
                        try
                        {
                            versionMetadata =
                                metadataResolver.resolveProjectVersion( repositorySession, repoId, groupId, artifactId,
                                                                        version );
                        }
                        catch ( MetadataResolutionException e )
                        {
                            log.error( "Skipping invalid metadata while compiling shared model for " + groupId + ":"
                                           + artifactId + " in repo " + repoId + ": " + e.getMessage() );
                        }
                    }
                }

                if ( versionMetadata == null )
                {
                    continue;
                }

                if ( isFirstVersion )
                {
                    sharedModel = versionMetadata;
                    sharedModel.setId( null );
                }
                else
                {
                    MavenProjectFacet versionMetadataMavenFacet =
                        (MavenProjectFacet) versionMetadata.getFacet( MavenProjectFacet.FACET_ID );
                    if ( versionMetadataMavenFacet != null )
                    {
                        if ( mavenFacet.getPackaging() != null && !StringUtils.equalsIgnoreCase(
                            mavenFacet.getPackaging(), versionMetadataMavenFacet.getPackaging() ) )
                        {
                            mavenFacet.setPackaging( null );
                        }
                    }
View Full Code Here

            MetadataResolver metadataResolver = repositorySession.getResolver();

            ProjectVersionMetadata sharedModel = new ProjectVersionMetadata();

            MavenProjectFacet mavenFacet = new MavenProjectFacet();
            mavenFacet.setGroupId( groupId );
            mavenFacet.setArtifactId( artifactId );
            sharedModel.addFacet( mavenFacet );

            boolean isFirstVersion = true;

            for ( String version : projectVersions )
            {
                ProjectVersionMetadata versionMetadata = null;
                for ( String repoId : selectedRepos )
                {
                    if ( versionMetadata == null || versionMetadata.isIncomplete() )
                    {
                        try
                        {
                            versionMetadata =
                                metadataResolver.resolveProjectVersion( repositorySession, repoId, groupId, artifactId,
                                                                        version );
                        }
                        catch ( MetadataResolutionException e )
                        {
                            log.error( "Skipping invalid metadata while compiling shared model for " + groupId + ":"
                                           + artifactId + " in repo " + repoId + ": " + e.getMessage() );
                        }
                    }
                }

                if ( versionMetadata == null )
                {
                    continue;
                }

                if ( isFirstVersion )
                {
                    sharedModel = versionMetadata;
                    sharedModel.setId( null );
                }
                else
                {
                    MavenProjectFacet versionMetadataMavenFacet =
                        (MavenProjectFacet) versionMetadata.getFacet( MavenProjectFacet.FACET_ID );
                    if ( versionMetadataMavenFacet != null )
                    {
                        if ( mavenFacet.getPackaging() != null && !StringUtils.equalsIgnoreCase(
                            mavenFacet.getPackaging(), versionMetadataMavenFacet.getPackaging() ) )
                        {
                            mavenFacet.setPackaging( null );
                        }
                    }
View Full Code Here

        MavenProjectFacet mavenProjectFacet = new MavenProjectFacet( );
        mavenProjectFacet.setGroupId( groupId );
        mavenProjectFacet.setArtifactId( artifactId );
        mavenProjectFacet.setPackaging( TEST_PACKAGING );
        MavenProjectParent parent = new MavenProjectParent( );
        parent.setGroupId( TEST_PARENT_GROUP_ID );
        parent.setArtifactId( TEST_PARENT_ARTIFACT_ID );
        parent.setVersion( TEST_PARENT_VERSION );
        mavenProjectFacet.setParent( parent );
        model.addFacet( mavenProjectFacet );

        GenericMetadataFacet genericMetadataFacet = new GenericMetadataFacet( );
        Map<String, String> props = new HashMap<String, String>( );
View Full Code Here

        MavenProjectFacet mavenProjectFacet = new MavenProjectFacet( );
        mavenProjectFacet.setGroupId( groupId );
        mavenProjectFacet.setArtifactId( artifactId );
        mavenProjectFacet.setPackaging( TEST_PACKAGING );
        MavenProjectParent parent = new MavenProjectParent( );
        parent.setGroupId( TEST_PARENT_GROUP_ID );
        parent.setArtifactId( TEST_PARENT_ARTIFACT_ID );
        parent.setVersion( TEST_PARENT_VERSION );
        mavenProjectFacet.setParent( parent );
        model.addFacet( mavenProjectFacet );

        GenericMetadataFacet genericMetadataFacet = new GenericMetadataFacet( );
        Map<String, String> props = new HashMap<String, String>( );
View Full Code Here

                File basedir = new File( repository.getLocation() );

                try
                {
                    project =
                        buildProject( new RepositoryModelResolver( basedir, pathTranslator ), artifact.getGroupId(),
                                      artifact.getArtifactId(), artifact.getVersion() );
                }
                catch ( ModelBuildingException e )
                {
                    throw new ArtifactMetadataRetrievalException( e.getMessage(), e, artifact );
View Full Code Here

                        networkProxies.put( proxyConnector.getTargetRepoId(), proxy );
                    }
                }
            }

            Model model = buildProject( new RepositoryModelResolver( basedir, pathTranslator, wagonFactory, remoteRepositories,
                                         networkProxies, repository ), groupId, artifactId, version );

            Map managedVersions = createManagedVersionMap( model );

            Set<Artifact> dependencyArtifacts = createArtifacts( model, null );
View Full Code Here

TOP

Related Classes of org.apache.archiva.metadata.repository.storage.maven2.MavenProjectFacet

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.