Examples of License


Examples of org.apache.archiva.metadata.model.License

            {
                String licenseName = getPropertyString( node, "license." + i + ".name" );
                String licenseUrl = getPropertyString( node, "license." + i + ".url" );
                if ( licenseName != null || licenseUrl != null )
                {
                    License license = new License();
                    license.setName( licenseName );
                    license.setUrl( licenseUrl );
                    versionMetadata.addLicense( license );
                }
                else
                {
                    done = true;
View Full Code Here

Examples of org.apache.archiva.metadata.model.License

                           prefix + "-unsubscribe@archiva.apache.org", otherArchives, allowPost );
    }

    private void checkApacheLicense( ProjectVersionMetadata metadata )
    {
        assertEquals( Arrays.asList( new License( "The Apache Software License, Version 2.0",
                                                  "http://www.apache.org/licenses/LICENSE-2.0.txt" ) ),
                      metadata.getLicenses() );
    }
View Full Code Here

Examples of org.apache.archiva.metadata.model.License

        Organization org = new Organization();
        org.setName( "org name" );
        org.setUrl( "url" );
        metadata.setOrganization( org );

        License l = new License();
        l.setName( "license name" );
        l.setUrl( "license url" );
        metadata.addLicense( l );

        Dependency d = new Dependency();
        d.setArtifactId( "artifactId" );
        d.setClassifier( "classifier" );
        d.setGroupId( "groupId" );
        d.setScope( "scope" );
        d.setSystemPath( "system path" );
        d.setType( "type" );
        d.setVersion( "version" );
        d.setOptional( true );
        metadata.addDependency( d );

        repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata );

        metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
        assertEquals( TEST_PROJECT_VERSION, metadata.getId() );
        assertEquals( TEST_PROJECT_VERSION, metadata.getVersion() );
        assertEquals( "project name", metadata.getName() );
        assertEquals( "project description", metadata.getDescription() );
        assertEquals( "the url", metadata.getUrl() );

        assertEquals( "connection", metadata.getScm().getConnection() );
        assertEquals( "dev conn", metadata.getScm().getDeveloperConnection() );
        assertEquals( "url", metadata.getScm().getUrl() );

        assertEquals( "system", metadata.getCiManagement().getSystem() );
        assertEquals( "ci url", metadata.getCiManagement().getUrl() );

        assertEquals( "system", metadata.getIssueManagement().getSystem() );
        assertEquals( "issue tracker url", metadata.getIssueManagement().getUrl() );

        assertEquals( "org name", metadata.getOrganization().getName() );
        assertEquals( "url", metadata.getOrganization().getUrl() );

        assertEquals( 1, metadata.getMailingLists().size() );
        MailingList retrievedMailingList = metadata.getMailingLists().get( 0 );
        assertEquals( mailingList.getName(), retrievedMailingList.getName() );
        assertEquals( mailingList.getMainArchiveUrl(), retrievedMailingList.getMainArchiveUrl() );
        assertEquals( mailingList.getPostAddress(), retrievedMailingList.getPostAddress() );
        assertEquals( mailingList.getSubscribeAddress(), retrievedMailingList.getSubscribeAddress() );
        assertEquals( mailingList.getUnsubscribeAddress(), retrievedMailingList.getUnsubscribeAddress() );
        assertThat( retrievedMailingList.getOtherArchives() ) //
            .isNotNull() //
            .isNotEmpty() //
            .hasSize( 1 ) //
            .contains( "other archive" );

        assertEquals( 1, metadata.getLicenses().size() );
        l = metadata.getLicenses().get( 0 );
        assertEquals( "license name", l.getName() );
        assertEquals( "license url", l.getUrl() );

        assertEquals( 1, metadata.getDependencies().size() );
        d = metadata.getDependencies().get( 0 );
        assertEquals( "artifactId", d.getArtifactId() );
        assertEquals( "classifier", d.getClassifier() );
View Full Code Here

Examples of org.apache.ivy.core.module.descriptor.License

                if (name == null) {
                    // The license name is required in Ivy but not in a POM!
                    name = "Unknown License";
                }

                lics.add(new License(name, url));
            }
        }
        return (License[]) lics.toArray(new License[lics.size()]);
    }
View Full Code Here

Examples of org.apache.ivy.core.module.descriptor.License

                out.print(" extendType=\"" + StringUtils.join(parent.getExtendsTypes(), ",") + "\"");
                out.println("/>");
            }
            License[] licenses = md.getLicenses();
            for (int i = 0; i < licenses.length; i++) {
                License license = licenses[i];
                out.print("\t\t<license ");
                if (license.getName() != null) {
                    out.print("name=\"" + XMLHelper.escape(license.getName()) + "\" ");
                }
                if (license.getUrl() != null) {
                    out.print("url=\"" + XMLHelper.escape(license.getUrl()) + "\" ");
                }
                out.println("/>");
            }
            if (md.getHomePage() != null || md.getDescription() != null) {
                out.print("\t\t<description");
View Full Code Here

Examples of org.apache.ivy.core.module.descriptor.License

                    infoStarted(attributes);
                } else if (state == State.INFO && "extends".equals(qName)) {
                    extendsStarted(attributes);
                } else if (state == State.INFO && "license".equals(qName)) {
                    getMd().addLicense(
                        new License(settings.substitute(attributes.getValue("name")), settings
                                .substitute(attributes.getValue("url"))));
                } else if (state == State.INFO && "description".equals(qName)) {
                    getMd().setHomePage(settings.substitute(attributes.getValue("homepage")));
                    state = State.DESCRIPTION;
                    buffer = new StringBuffer();
View Full Code Here

Examples of org.apache.ivy.core.module.descriptor.License

                if ("ivy-module".equals(qName)) {
                    ivyModuleStarted(attributes);
                } else if ("info".equals(qName)) {
                    infoStarted(attributes);
                } else if (state == INFO && "license".equals(qName)) {
                    md.addLicense(new License(ivy.substitute(attributes.getValue("name")), ivy
                            .substitute(attributes.getValue("url"))));
                } else if (state == INFO && "description".equals(qName)) {
                    md.setHomePage(ivy.substitute(attributes.getValue("homepage")));
                    state = DESCRIPTION;
                } else if (state == INFO) {
View Full Code Here

Examples of org.apache.ivy.core.module.descriptor.License

                    } else {
                        md.setPublicationDate(getDefaultPubDate());
                    }

                } else if ("license".equals(qName)) {
                    md.addLicense(new License(_ivy.substitute(attributes.getValue("name")), _ivy
                            .substitute(attributes.getValue("url"))));
                } else if ("description".equals(qName)) {
                    md.setHomePage(_ivy.substitute(attributes.getValue("homepage")));
                } else if ("configurations".equals(qName)) {
                    _state = CONF;
View Full Code Here

Examples of org.apache.ivy.core.module.descriptor.License

                } else if ("info".equals(qName)) {
                    infoStarted(attributes);
                } else if (state == State.INFO && "extends".equals(qName)) {
                    extendsStarted(attributes);
                } else if (state == State.INFO && "license".equals(qName)) {
                    getMd().addLicense(new License(settings.substitute(attributes.getValue("name")),
                                        settings.substitute(attributes.getValue("url"))));
                } else if (state == State.INFO && "description".equals(qName)) {
                    getMd().setHomePage(settings.substitute(attributes.getValue("homepage")));
                    state = State.DESCRIPTION;
                    buffer = new StringBuffer();
View Full Code Here

Examples of org.apache.ivy.core.module.descriptor.License

                out.print(" extendType=\"" + StringUtils.join(parent.getExtendsTypes(), ",") + "\"");
                out.println("/>");
            }
            License[] licenses = md.getLicenses();
            for (int i = 0; i < licenses.length; i++) {
                License license = licenses[i];
                out.print("\t\t<license ");
                if (license.getName() != null) {
                    out.print("name=\"" + XMLHelper.escape(license.getName()) + "\" ");
                }
                if (license.getUrl() != null) {
                    out.print("url=\"" + XMLHelper.escape(license.getUrl()) + "\" ");
                }
                out.println("/>");
            }
            if (md.getHomePage() != null || md.getDescription() != null) {
                out.print("\t\t<description");
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.