Package org.apache.maven.archiva.model

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


    private void assertUpdatedProjectMetadata( String artifactId, String[] expectedVersions, String latestVersion,
                                               String releaseVersion )
        throws Exception
    {
        ManagedRepositoryContent testRepo = createTestRepoContent();
        ProjectReference reference = new ProjectReference();
        reference.setGroupId( "org.apache.archiva.metadata.tests" );
        reference.setArtifactId( artifactId );

        prepTestRepo( testRepo, reference );

        tools.updateMetadata( testRepo, reference );

        StringBuilder buf = new StringBuilder();
        buf.append( "<metadata>\n" );
        buf.append( "  <groupId>" ).append( reference.getGroupId() ).append( "</groupId>\n" );
        buf.append( "  <artifactId>" ).append( reference.getArtifactId() ).append( "</artifactId>\n" );
        // buf.append( "  <version>1.0</version>\n" );

        if ( expectedVersions != null )
        {
            buf.append( "  <versioning>\n" );
View Full Code Here


    }

    private void prepTestRepo( ManagedRepositoryContent repo, VersionedReference reference )
        throws IOException
    {
        ProjectReference projectRef = new ProjectReference();
        projectRef.setGroupId( reference.getGroupId() );
        projectRef.setArtifactId( reference.getArtifactId() );

        prepTestRepo( repo, projectRef );
    }
View Full Code Here

        {
            LayoutExample example = (LayoutExample) it.next();
            if ( example.isSuitableForProjectTest() || example.isSuitableForVersionedTest()
                || example.isSuitableForArtifactTest() )
            {
                ProjectReference reference = new ProjectReference();
                reference.setGroupId( example.groupId );
                reference.setArtifactId( example.artifactId );

                assertEquals( "ProjectReference <" + reference + "> to path:", example.pathProjectd, layout
                    .toPath( reference ) );
            }
        }
View Full Code Here

        while ( it.hasNext() )
        {
            LayoutExample example = (LayoutExample) it.next();
            if ( example.isSuitableForProjectTest() )
            {
                ProjectReference reference = layout.toProjectReference( example.pathProjectd );

                assertProjectReference( reference, example.groupId, example.artifactId );
            }
        }
    }
View Full Code Here

        {
            LayoutExample example = (LayoutExample) it.next();
            if ( example.isSuitableForProjectTest() || example.isSuitableForVersionedTest()
                || example.isSuitableForArtifactTest() )
            {
                ProjectReference reference = new ProjectReference();
                reference.setGroupId( example.groupId );
                reference.setArtifactId( example.artifactId );

                assertEquals( "ProjectReference <" + reference + "> to path:", example.pathProjectd, layout
                    .toPath( reference ) );
            }
        }
View Full Code Here

        while ( it.hasNext() )
        {
            LayoutExample example = (LayoutExample) it.next();
            if ( example.isSuitableForProjectTest() )
            {
                ProjectReference reference = layout.toProjectReference( example.pathProjectd );

                assertProjectReference( reference, example.groupId, example.artifactId );
            }
        }
    }
View Full Code Here

            throw new LayoutException(
                "Only paths ending in '/maven-metadata.xml' can be " + "converted to a ProjectReference." );
        }

        PathReferences pathrefs = toPathReferences( path, false );
        ProjectReference reference = new ProjectReference();
        reference.setGroupId( pathrefs.groupId );
        reference.setArtifactId( pathrefs.artifactId );

        return reference;
    }
View Full Code Here

    protected ProjectReference createMetadataReference( String layoutType, String path )
        throws Exception
    {
        BidirectionalRepositoryLayout layout = layoutFactory.getLayout( layoutType );
        ProjectReference metadata = layout.toProjectReference( path );
        return metadata;
    }
View Full Code Here

    public void testGetMetadataNotPresent()
        throws Exception
    {
        String path = "org/apache/maven/test/dummy-artifact/1.0/maven-metadata.xml";
        File expectedFile = new File( managedDefaultDir, path );
        ProjectReference metadata = createMetadataReference( "default", path );

        // Configure Connector (usually done within archiva.xml configuration)
        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
View Full Code Here

    public void testGetMetadataProxied()
        throws Exception
    {
        String path = "org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml";
        File expectedFile = new File( managedDefaultDir, path );
        ProjectReference metadata = createMetadataReference( "default", path );

        FileUtils.deleteDirectory( expectedFile.getParentFile() );
        assertFalse( expectedFile.exists() );

        // Configure Connector (usually done within archiva.xml configuration)
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.