Java Code Examples for org.apache.maven.model.Site#getUrl()

The following examples show how to use org.apache.maven.model.Site#getUrl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocationAwareMavenXpp3Writer.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void writeSite(Site site, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if (site.getId() != null) {
        writeValue(serializer, "id", site.getId(), site);
    }
    if (site.getName() != null) {
        writeValue(serializer, "name", site.getName(), site);
    }
    if (site.getUrl() != null) {
        writeValue(serializer, "url", site.getUrl(), site);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(site, "", start, b.length());
}
 
Example 2
Source File: MavenUtil.java    From jkube with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Retrieves the URL used for documentation from the provided {@link MavenProject}.
 *
 * @param project MavenProject from which to retrieve the documentation URL
 * @return the documentation URL
 */
public static String getDocumentationUrl(MavenProject project) {
    while (project != null) {
        DistributionManagement distributionManagement = project.getDistributionManagement();
        if (distributionManagement != null) {
            Site site = distributionManagement.getSite();
            if (site != null) {
                return site.getUrl();
            }
        }
        project = project.getParent();
    }
    return null;
}