Java Code Examples for org.codehaus.plexus.util.StringUtils#isNotEmpty()

The following examples show how to use org.codehaus.plexus.util.StringUtils#isNotEmpty() . 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: StagerMojo.java    From helidon-build-tools with Apache License 2.0 6 votes vote down vote up
@Override
public void unpack(Path archive, Path target, String excludes, String includes) {
    File archiveFile = archive.toFile();
    UnArchiver unArchiver = null;
    try {
        unArchiver = archiverManager.getUnArchiver(archiveFile);
    } catch (NoSuchArchiverException ex) {
        throw new IllegalStateException(ex);
    }
    unArchiver.setSourceFile(archiveFile);
    unArchiver.setDestDirectory(target.toFile());
    if (StringUtils.isNotEmpty(excludes) || StringUtils.isNotEmpty(includes)) {
        IncludeExcludeFileSelector[] selectors = new IncludeExcludeFileSelector[]{
                new IncludeExcludeFileSelector()
        };
        if (StringUtils.isNotEmpty(excludes)) {
            selectors[0].setExcludes(excludes.split(","));
        }
        if (StringUtils.isNotEmpty(includes)) {
            selectors[0].setIncludes(includes.split(","));
        }
        unArchiver.setFileSelectors(selectors);
    }
    unArchiver.extract();
}
 
Example 2
Source File: StartContainerExecutor.java    From docker-maven-plugin with Apache License 2.0 6 votes vote down vote up
private void exposeContainerProps(String containerId)
    throws DockerAccessException {
    String propKey = getExposedPropertyKeyPart();

    if (StringUtils.isNotEmpty(exposeContainerProps) && StringUtils.isNotEmpty(propKey)) {
        Container container = hub.getQueryService().getMandatoryContainer(containerId);

        String prefix = addDot(exposeContainerProps) + addDot(propKey);
        projectProperties.put(prefix + "id", containerId);
        String ip = container.getIPAddress();
        if (StringUtils.isNotEmpty(ip)) {
            projectProperties.put(prefix + "ip", ip);
        }

        Map<String, String> nets = container.getCustomNetworkIpAddresses();
        if (nets != null) {
            for (Map.Entry<String, String> entry : nets.entrySet()) {
                projectProperties.put(prefix + addDot("net") + addDot(entry.getKey()) + "ip", entry.getValue());
            }
        }
    }
}
 
Example 3
Source File: MojoExecutor.java    From dew with Apache License 2.0 6 votes vote down vote up
private ArtifactFilter getArtifactFilter( MojoDescriptor mojoDescriptor )
{
    String scopeToResolve = mojoDescriptor.getDependencyResolutionRequired();
    String scopeToCollect = mojoDescriptor.getDependencyCollectionRequired();

    List<String> scopes = new ArrayList<>( 2 );
    if ( StringUtils.isNotEmpty( scopeToCollect ) )
    {
        scopes.add( scopeToCollect );
    }
    if ( StringUtils.isNotEmpty( scopeToResolve ) )
    {
        scopes.add( scopeToResolve );
    }

    if ( scopes.isEmpty() )
    {
        return null;
    }
    else
    {
        return new CumulativeScopeArtifactFilter( scopes );
    }
}
 
Example 4
Source File: MojoExecutor.java    From dew with Apache License 2.0 6 votes vote down vote up
private ArtifactFilter getArtifactFilter(MojoDescriptor mojoDescriptor) {
    String scopeToResolve = mojoDescriptor.getDependencyResolutionRequired();
    String scopeToCollect = mojoDescriptor.getDependencyCollectionRequired();

    List<String> scopes = new ArrayList<String>(2);
    if (StringUtils.isNotEmpty(scopeToCollect)) {
        scopes.add(scopeToCollect);
    }
    if (StringUtils.isNotEmpty(scopeToResolve)) {
        scopes.add(scopeToResolve);
    }

    if (scopes.isEmpty()) {
        return null;
    } else {
        return new CumulativeScopeArtifactFilter(scopes);
    }
}
 
Example 5
Source File: NarMojo.java    From nifi-maven with Apache License 2.0 5 votes vote down vote up
protected DependencyStatusSets getDependencySets(boolean stopOnFailure) throws MojoExecutionException {
    // add filters in well known order, least specific to most specific
    FilterArtifacts filter = new FilterArtifacts();

    filter.addFilter(new ProjectTransitivityFilter(project.getDependencyArtifacts(), false));
    filter.addFilter(new ScopeFilter(this.includeScope, this.excludeScope));
    filter.addFilter(new TypeFilter(this.includeTypes, this.excludeTypes));
    filter.addFilter(new ClassifierFilter(this.includeClassifiers, this.excludeClassifiers));
    filter.addFilter(new GroupIdFilter(this.includeGroupIds, this.excludeGroupIds));
    filter.addFilter(new ArtifactIdFilter(this.includeArtifactIds, this.excludeArtifactIds));

    // explicitly filter our nar dependencies
    filter.addFilter(new TypeFilter("", "nar"));

    // start with all artifacts.
    Set artifacts = project.getArtifacts();

    // perform filtering
    try {
        artifacts = filter.filter(artifacts);
    } catch (ArtifactFilterException e) {
        throw new MojoExecutionException(e.getMessage(), e);
    }

    // transform artifacts if classifier is set
    final DependencyStatusSets status;
    if (StringUtils.isNotEmpty(copyDepClassifier)) {
        status = getClassifierTranslatedDependencies(artifacts, stopOnFailure);
    } else {
        status = filterMarkedDependencies(artifacts);
    }

    return status;
}
 
Example 6
Source File: AnsiLogger.java    From jkube with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Update the progress
 */
@Override
public void progressUpdate(String layerId, String status, String progressMessage) {
    if (!batchMode && log.isInfoEnabled() && StringUtils.isNotEmpty(layerId)) {
        if (useAnsi) {
            updateAnsiProgress(layerId, status, progressMessage);
        } else {
            updateNonAnsiProgress();
        }
        flush();
    }
}
 
Example 7
Source File: ProjectLicenseService.java    From sonarqube-licensecheck with Apache License 2.0 5 votes vote down vote up
public List<ProjectLicense> getProjectLicenseList()
{
    String projectLicenseString = configuration.get(PROJECT_LICENSE_KEY).orElse(null);

    if (StringUtils.isNotEmpty(projectLicenseString))
    {
        return ProjectLicense.fromString(projectLicenseString);
    }

    return new ArrayList<>();
}
 
Example 8
Source File: MojoExecutor.java    From dew with Apache License 2.0 5 votes vote down vote up
private Collection<String> toScopes( String classpath )
{
    if ( StringUtils.isNotEmpty( classpath ) )
    {
        if ( Artifact.SCOPE_COMPILE.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_PROVIDED );
        }
        else if ( Artifact.SCOPE_RUNTIME.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME );
        }
        else if ( Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_PROVIDED,
                                  Artifact.SCOPE_RUNTIME );
        }
        else if ( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_RUNTIME );
        }
        else if ( Artifact.SCOPE_TEST.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_PROVIDED,
                                  Artifact.SCOPE_RUNTIME, Artifact.SCOPE_TEST );
        }
    }
    return Collections.emptyList();
}
 
Example 9
Source File: AbstractDeployMojo.java    From opoopress with Apache License 2.0 5 votes vote down vote up
public static ProxyInfo getProxyInfo(Repository repository, WagonManager wagonManager) {
    ProxyInfo proxyInfo = wagonManager.getProxy(repository.getProtocol());

    if (proxyInfo == null) {
        return null;
    }

    String host = repository.getHost();
    String nonProxyHostsAsString = proxyInfo.getNonProxyHosts();
    for (String nonProxyHost : StringUtils.split(nonProxyHostsAsString, ",;|")) {
        if (org.apache.commons.lang.StringUtils.contains(nonProxyHost, "*")) {
            // Handle wildcard at the end, beginning or middle of the nonProxyHost
            final int pos = nonProxyHost.indexOf('*');
            String nonProxyHostPrefix = nonProxyHost.substring(0, pos);
            String nonProxyHostSuffix = nonProxyHost.substring(pos + 1);
            // prefix*
            if (StringUtils.isNotEmpty(nonProxyHostPrefix) && host.startsWith(nonProxyHostPrefix)
                    && StringUtils.isEmpty(nonProxyHostSuffix)) {
                return null;
            }
            // *suffix
            if (StringUtils.isEmpty(nonProxyHostPrefix)
                    && StringUtils.isNotEmpty(nonProxyHostSuffix) && host.endsWith(nonProxyHostSuffix)) {
                return null;
            }
            // prefix*suffix
            if (StringUtils.isNotEmpty(nonProxyHostPrefix) && host.startsWith(nonProxyHostPrefix)
                    && StringUtils.isNotEmpty(nonProxyHostSuffix) && host.endsWith(nonProxyHostSuffix)) {
                return null;
            }
        } else if (host.equals(nonProxyHost)) {
            return null;
        }
    }
    return proxyInfo;
}
 
Example 10
Source File: NarMojo.java    From nifi-maven with Apache License 2.0 5 votes vote down vote up
protected DependencyStatusSets getClassifierTranslatedDependencies(Set artifacts, boolean stopOnFailure) throws MojoExecutionException {
    Set unResolvedArtifacts = new HashSet();
    Set resolvedArtifacts = artifacts;
    DependencyStatusSets status = new DependencyStatusSets();

    // possibly translate artifacts into a new set of artifacts based on the
    // classifier and type
    // if this did something, we need to resolve the new artifacts
    if (StringUtils.isNotEmpty(copyDepClassifier)) {
        ArtifactTranslator translator = new ClassifierTypeTranslator(this.copyDepClassifier, this.type, this.factory);
        artifacts = translator.translate(artifacts, getLog());

        status = filterMarkedDependencies(artifacts);

        // the unskipped artifacts are in the resolved set.
        artifacts = status.getResolvedDependencies();

        // resolve the rest of the artifacts
        ArtifactsResolver artifactsResolver = new DefaultArtifactsResolver(this.resolver, this.local,
                this.remoteRepos, stopOnFailure);
        resolvedArtifacts = artifactsResolver.resolve(artifacts, getLog());

        // calculate the artifacts not resolved.
        unResolvedArtifacts.addAll(artifacts);
        unResolvedArtifacts.removeAll(resolvedArtifacts);
    }

    // return a bean of all 3 sets.
    status.setResolvedDependencies(resolvedArtifacts);
    status.setUnResolvedDependencies(unResolvedArtifacts);

    return status;
}
 
Example 11
Source File: DefaultDaemonMerger.java    From appassembler with MIT License 5 votes vote down vote up
private String select( String dominant, String recessive )
{
    if ( StringUtils.isNotEmpty( dominant ) )
    {
        return dominant;
    }
    else
    {
        return recessive;
    }
}
 
Example 12
Source File: DefaultVersionsHelper.java    From versions-maven-plugin with Apache License 2.0 5 votes vote down vote up
private List<String> getSplittedProperties( String commaSeparatedProperties )
{
    List<String> propertiesList = Collections.emptyList();
    if ( StringUtils.isNotEmpty( commaSeparatedProperties ) )
    {
        String[] splittedProps = StringUtils.split( commaSeparatedProperties, "," );
        propertiesList = Arrays.asList( StringUtils.stripAll( splittedProps ) );
    }
    return propertiesList;
}
 
Example 13
Source File: MojoExecutor.java    From dew with Apache License 2.0 5 votes vote down vote up
private Collection<String> toScopes( String classpath )
{
    if ( StringUtils.isNotEmpty( classpath ) )
    {
        if ( Artifact.SCOPE_COMPILE.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_PROVIDED );
        }
        else if ( Artifact.SCOPE_RUNTIME.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME );
        }
        else if ( Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_PROVIDED,
                                  Artifact.SCOPE_RUNTIME );
        }
        else if ( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_RUNTIME );
        }
        else if ( Artifact.SCOPE_TEST.equals( classpath ) )
        {
            return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_PROVIDED,
                                  Artifact.SCOPE_RUNTIME, Artifact.SCOPE_TEST );
        }
    }
    return Collections.emptyList();
}
 
Example 14
Source File: CreateMojo.java    From buildnumber-maven-plugin with MIT License 5 votes vote down vote up
/**
 * Get the branch info for this revision from the repository. For svn, it is in svn info.
 *
 * @return
 * @throws MojoExecutionException
 * @throws MojoExecutionException
 */
public String getScmBranch()
    throws MojoExecutionException
{
    try
    {
        ScmRepository repository = getScmRepository();
        ScmProvider provider = scmManager.getProviderByRepository( repository );
        /* git branch can be obtained directly by a command */
        if ( GitScmProviderRepository.PROTOCOL_GIT.equals( provider.getScmType() ) )
        {
            ScmFileSet fileSet = new ScmFileSet( scmDirectory );
            return GitBranchCommand.getCurrentBranch( getLogger(),
                                                      (GitScmProviderRepository) repository.getProviderRepository(),
                                                      fileSet );
        }
        else if ( provider instanceof HgScmProvider )
        {
            /* hg branch can be obtained directly by a command */
            HgOutputConsumer consumer = new HgOutputConsumer( getLogger() );
            ScmResult result = HgUtils.execute( consumer, logger, scmDirectory, new String[] { "id", "-b" } );
            checkResult( result );
            if ( StringUtils.isNotEmpty( consumer.getOutput() ) )
            {
                return consumer.getOutput();
            }
        }
    }
    catch ( ScmException e )
    {
        getLog().warn( "Cannot get the branch information from the git repository: \n" + e.getLocalizedMessage() );
    }

    return getScmBranchFromUrl();
}
 
Example 15
Source File: SpringMvcApiReader.java    From swagger-maven-plugin with Apache License 2.0 5 votes vote down vote up
private void updateResponseStatus(Operation operation, ResponseStatus responseStatus) {
    int code = responseStatus.value().value();
    String reason = responseStatus.reason();

    if (operation.getResponses() != null && operation.getResponses().size() == 1) {
        String currentKey = operation.getResponses().keySet().iterator().next();
        Response oldResponse = operation.getResponses().remove(currentKey);
        if (StringUtils.isNotEmpty(reason)) {
            oldResponse.setDescription(reason);
        }
        operation.response(code, oldResponse);
    } else {
        operation.response(code, new Response().description(reason));
    }
}
 
Example 16
Source File: DependencyFactory.java    From appassembler with MIT License 5 votes vote down vote up
/**
 * Used by GenericDaemonGenerator.
 * @param artifact {@link Artifact}
 * @param layout {@link ArtifactRepositoryLayout}
 * @param outputFileNameMapping The name mapping.
 * @return the dependency.
 */
public static Dependency create( Artifact artifact, ArtifactRepositoryLayout layout, String outputFileNameMapping )
{
    Dependency dependency = new Dependency();
    dependency.setGroupId( artifact.getGroupId() );
    dependency.setArtifactId( artifact.getArtifactId() );
    dependency.setVersion( artifact.getVersion() );
    dependency.setClassifier( artifact.getClassifier() );

    String path = layout.pathOf( artifact );
    if ( StringUtils.isNotEmpty( outputFileNameMapping ) )
    {
        // Replace the file name part of the path with one that has been mapped
        File directory = new File( path ).getParentFile();

        try
        {
            String fileName = MappingUtils.evaluateFileNameMapping( outputFileNameMapping, artifact );
            File file = new File( directory, fileName );
            // Always use forward slash as path separator, because that's what layout.pathOf( artifact ) uses
            path = file.getPath().replace( '\\', '/' );
        }
        catch ( InterpolationException e )
        {
            // TODO Handle exceptions!
            // throw new MojoExecutionException("Unable to map file name.", e);
        }
    }
    dependency.setRelativePath( path );

    return dependency;
}
 
Example 17
Source File: ProjectTeamRenderer.java    From maven-confluence-plugin with Apache License 2.0 4 votes vote down vote up
/**
 * @param units contributors and developers to check
 * @return required headers
 */
private Map<String, Boolean> checkRequiredHeaders( List<? extends Contributor> units )
{
    Map<String, Boolean> requiredHeaders = new HashMap<String, Boolean>();

    requiredHeaders.put( IMAGE, Boolean.FALSE );
    requiredHeaders.put( ID, Boolean.FALSE );
    requiredHeaders.put( NAME, Boolean.FALSE );
    requiredHeaders.put( EMAIL, Boolean.FALSE );
    requiredHeaders.put( URL, Boolean.FALSE );
    requiredHeaders.put( ORGANIZATION, Boolean.FALSE );
    requiredHeaders.put( ORGANIZATION_URL, Boolean.FALSE );
    requiredHeaders.put( ROLES, Boolean.FALSE );
    requiredHeaders.put( TIME_ZONE, Boolean.FALSE );
    requiredHeaders.put( PROPERTIES, Boolean.FALSE );

    for ( Contributor unit : units )
    {
        if ( unit instanceof Developer )
        {
            Developer developer = (Developer) unit;
            if ( StringUtils.isNotEmpty( developer.getId() ) )
            {
                requiredHeaders.put( ID, Boolean.TRUE );
            }
        }
        if ( StringUtils.isNotEmpty( unit.getName() ) )
        {
            requiredHeaders.put( NAME, Boolean.TRUE );
        }
        if ( StringUtils.isNotEmpty( unit.getEmail() ) )
        {
            requiredHeaders.put( EMAIL, Boolean.TRUE );
            requiredHeaders.put( IMAGE, Boolean.TRUE );
        }
        if ( StringUtils.isNotEmpty( unit.getUrl() ) )
        {
            requiredHeaders.put( URL, Boolean.TRUE );
        }
        if ( StringUtils.isNotEmpty( unit.getOrganization() ) )
        {
            requiredHeaders.put( ORGANIZATION, Boolean.TRUE );
        }
        if ( StringUtils.isNotEmpty( unit.getOrganizationUrl() ) )
        {
            requiredHeaders.put( ORGANIZATION_URL, Boolean.TRUE );
        }
        if ( !isEmpty( unit.getRoles() ) )
        {
            requiredHeaders.put( ROLES, Boolean.TRUE );
        }
        if ( StringUtils.isNotEmpty( unit.getTimezone() ) )
        {
            requiredHeaders.put( TIME_ZONE, Boolean.TRUE );
        }
        Properties properties = unit.getProperties();
        boolean hasPicUrl = properties.containsKey( "picUrl" );
        if ( hasPicUrl )
        {
            requiredHeaders.put( IMAGE, Boolean.TRUE );
        }
        boolean isJustAnImageProperty = properties.size() == 1 && hasPicUrl;
        if ( !isJustAnImageProperty && !properties.isEmpty() )
        {
            requiredHeaders.put( PROPERTIES, Boolean.TRUE );
        }
    }
    return requiredHeaders;
}
 
Example 18
Source File: GeneratorUtils.java    From takari-lifecycle with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Decodes javadoc inline tags into equivalent HTML tags. For instance, the inline tag "{@code <A&B>}" should be rendered as "<code>&lt;A&amp;B&gt;</code>".
 *
 * @param description The javadoc description to decode, may be <code>null</code>.
 * @return The decoded description, never <code>null</code>.
 */
static String decodeJavadocTags(String description) {
  if (StringUtils.isEmpty(description)) {
    return "";
  }

  StringBuffer decoded = new StringBuffer(description.length() + 1024);

  Matcher matcher = Pattern.compile("\\{@(\\w+)\\s*([^\\}]*)\\}").matcher(description);
  while (matcher.find()) {
    String tag = matcher.group(1);
    String text = matcher.group(2);
    text = StringUtils.replace(text, "&", "&amp;");
    text = StringUtils.replace(text, "<", "&lt;");
    text = StringUtils.replace(text, ">", "&gt;");
    if ("code".equals(tag)) {
      text = "<code>" + text + "</code>";
    } else if ("link".equals(tag) || "linkplain".equals(tag) || "value".equals(tag)) {
      String pattern = "(([^#\\.\\s]+\\.)*([^#\\.\\s]+))?" + "(#([^\\(\\s]*)(\\([^\\)]*\\))?\\s*(\\S.*)?)?";
      final int label = 7;
      final int clazz = 3;
      final int member = 5;
      final int args = 6;
      Matcher link = Pattern.compile(pattern).matcher(text);
      if (link.matches()) {
        text = link.group(label);
        if (StringUtils.isEmpty(text)) {
          text = link.group(clazz);
          if (StringUtils.isEmpty(text)) {
            text = "";
          }
          if (StringUtils.isNotEmpty(link.group(member))) {
            if (StringUtils.isNotEmpty(text)) {
              text += '.';
            }
            text += link.group(member);
            if (StringUtils.isNotEmpty(link.group(args))) {
              text += "()";
            }
          }
        }
      }
      if (!"linkplain".equals(tag)) {
        text = "<code>" + text + "</code>";
      }
    }
    matcher.appendReplacement(decoded, (text != null) ? quoteReplacement(text) : "");
  }
  matcher.appendTail(decoded);

  return decoded.toString();
}
 
Example 19
Source File: PluginConfluenceDocGenerator.java    From maven-confluence-plugin with Apache License 2.0 4 votes vote down vote up
/**
 *
 * @param w
 */
private void writeAttributes(ConfluenceWikiWriter w) {
    w.printNormalHeading("Mojo Attributes");

    String value = descriptor.getDeprecated();

    if (StringUtils.isNotEmpty(value)) {
        w.printBullet("This plugin goal has been deprecated: " + value);
    }

    if (descriptor.isProjectRequired()) {
        w.printBullet("Requires a Maven 2.0 project to execute.");
    }

    if (descriptor.isAggregator()) {
        w.printBullet("Executes as an aggregator plugin.");
    }

    if (descriptor.isDirectInvocationOnly()) {
        w.printBullet("Executes by direct invocation only.");
    }

    value = descriptor.getDependencyResolutionRequired();

    if (StringUtils.isNotEmpty(value)) {
        w.printBullet("Requires dependency resolution of artifacts in scope: {{" + value + "}}");
    }

    value = descriptor.getSince();
    if (StringUtils.isNotEmpty(value)) {
        w.printBullet("Since version: {{" + value + "}}");
    }

    value = descriptor.getPhase();
    if (StringUtils.isNotEmpty(value)) {
        w.printBullet("Automatically executes within the lifecycle phase: {{" + value + "}}");
    }

    value = descriptor.getExecutePhase();
    if (StringUtils.isNotEmpty(value)) {
        w.printBullet(
                "Invokes the execution of the lifecycle phase {{" + value + "}} prior to executing itself.");
    }

    value = descriptor.getExecuteGoal();
    if (StringUtils.isNotEmpty(value)) {
        w.printBullet(
                "Invokes the execution of this plugin's goal {{" + value + "}} prior to executing itself.");
    }

    value = descriptor.getExecuteLifecycle();
    if (StringUtils.isNotEmpty(value)) {
        w.printBullet("Executes in its own lifecycle: {{" + value + "}}");
    }

    if (descriptor.isOnlineRequired()) {
        w.printBullet("Requires that mvn runs in online mode.");
    }

    if (!descriptor.isInheritedByDefault()) {
        w.printBullet("Is NOT inherited by default in multi-project builds.");
    }
}
 
Example 20
Source File: PluginConfluenceDocGenerator.java    From maven-confluence-plugin with Apache License 2.0 2 votes vote down vote up
/**
 *
 * @param title
 * @param parameterList
 * @param w
 */
private void writeParameterList(String title, List<Parameter> parameterList, ConfluenceWikiWriter w) {
    w.printNormalHeading(title);

    w.printNewParagraph();

    w.printf("||%s||%s||%s||\n", "Name", "Type", "Description");

    for (Parameter parameter : parameterList) {

        int index = parameter.getType().lastIndexOf(".");

        w.print('|');

        w.print(createLinkToAnchor(parameter.getName(), parameter.getName()));

        w.print('|');

        w.print(parameter.getType().substring(index + 1));

        w.print('|');

        String description = parameter.getDescription();
        if (StringUtils.isEmpty(description)) {
            description = "No description.";
        }
        if (StringUtils.isNotEmpty(parameter.getDeprecated())) {
            description = "Deprecated. " + description;
        }

      
        w.print(replaceHTML(description).replace("\n\n", "\n"));

        if (StringUtils.isNotEmpty(parameter.getDefaultValue())) {
            w.printf(" Default value is %s", replaceHTML(parameter.getDefaultValue()));
        }

        w.println('|');
    }

}