Search in sources :

Example 1 with EnricherContext

use of io.fabric8.maven.enricher.api.EnricherContext in project fabric8-maven-plugin by fabric8io.

the class IconEnricher method getDefaultIconRef.

/**
 * Lets use the project and its classpath to try figure out what default icon to use
 *
 * @return the icon ref if we can detect one or return null
 */
private String getDefaultIconRef() {
    MavenProject project = getProject();
    EnricherContext context = getContext();
    if (hasClass(project, "io.fabric8.funktion.runtime.Main") || MavenUtil.hasDependencyOnAnyArtifactOfGroup(project, "io.fabric8.funktion")) {
        return "funktion";
    }
    if (hasClass(project, "org.apache.camel.CamelContext")) {
        return "camel";
    }
    if (hasPlugin(project, "org.springframework.boot:spring-boot-maven-plugin") || hasClass(project, "org.springframework.boot.SpringApplication")) {
        return "spring-boot";
    }
    if (hasClass(project, "org.springframework.core.Constants")) {
        return "spring";
    }
    if (hasClass(project, "org.vertx.java.core.Handler", "io.vertx.core.Handler")) {
        return "vertx";
    }
    if (hasPlugin(project, "org.wildfly.swarm:wildfly-swarm-plugin") || MavenUtil.hasDependencyOnAnyArtifactOfGroup(project, "org.wildfly.swarm")) {
        return "wildfly-swarm";
    }
    return null;
}
Also used : MavenProject(org.apache.maven.project.MavenProject) EnricherContext(io.fabric8.maven.enricher.api.EnricherContext)

Aggregations

EnricherContext (io.fabric8.maven.enricher.api.EnricherContext)1 MavenProject (org.apache.maven.project.MavenProject)1