Example usage for org.apache.maven.plugin MojoExecution getGroupId

List of usage examples for org.apache.maven.plugin MojoExecution getGroupId

Introduction

In this page you can find the example usage for org.apache.maven.plugin MojoExecution getGroupId.

Prototype

public String getGroupId() 

Source Link

Usage

From source file:co.leantechniques.maven.Project.java

License:Apache License

private String generateKeyFrom(ExecutionEvent event) {
    MojoExecution mojoExecution = event.getMojoExecution();
    return mojoExecution.getGroupId() + mojoExecution.getArtifactId() + mojoExecution.getGoal()
            + mojoExecution.getExecutionId();
}

From source file:com.basistech.m2e.code.quality.shared.AbstractMavenPluginProjectConfigurator.java

License:Open Source License

protected MojoExecution findForkedExecution(MojoExecution primary, String groupId, String artifactId,
        String goal) {//from w  w  w  .ja  v a 2  s .c  o  m
    Map<String, List<MojoExecution>> forkedExecutions = primary.getForkedExecutions();
    MojoExecution goalExecution = null;
    for (List<MojoExecution> possibleExecutionList : forkedExecutions.values()) {
        for (MojoExecution possibleExecution : possibleExecutionList) {
            if (groupId.equals(possibleExecution.getGroupId())
                    && artifactId.equals(possibleExecution.getArtifactId())
                    && goal.equals(possibleExecution.getGoal())) {
                goalExecution = possibleExecution;
                break;
            }
        }
        if (goalExecution != null) {
            break;
        }
    }
    return goalExecution;
}

From source file:com.basistech.m2e.code.quality.shared.MavenPluginWrapper.java

License:Open Source License

public static boolean mojoExecutionForPlugin(MojoExecution mojoExecution, String groupId, String artifactId,
        String goal) {/*  w ww. ja  va 2  s. c  o  m*/
    return groupId.equals(mojoExecution.getGroupId()) && artifactId.equals(mojoExecution.getArtifactId())
            && (goal == null || goal.equals(mojoExecution.getGoal()));
}

From source file:com.carrotgarden.m2e.config.MojoUtil.java

License:BSD License

static boolean isMojoSCR(final MavenContext context) {

    final MojoExecution exec = context.getExecution();

    if (!SCR_GROUP_ID.equals(exec.getGroupId())) {
        return false;
    }/*from w  w w. j  av a  2 s  .c o m*/

    if (!SCR_ARTIFACT_ID.equals(exec.getArtifactId())) {
        return false;
    }

    return true;

}

From source file:com.carrotgarden.m2e.config.MojoUtil.java

License:BSD License

static boolean isMojoBND(final MavenContext context) {

    final MojoExecution exec = context.getExecution();

    if (!BND_GROUP_ID.equals(exec.getGroupId())) {
        return false;
    }/*ww w  .  j  ava2  s .co m*/

    if (!BND_ARTIFACT_ID.equals(exec.getArtifactId())) {
        return false;
    }

    return true;

}

From source file:com.ccoe.build.profiler.profile.MojoProfile.java

License:Apache License

public MojoProfile(Context c, MojoExecution mojoExecution, ExecutionEvent event) {
    super(new Timer(), event, c);

    this.mojoExecution = mojoExecution;
    this.pluginGroupID = mojoExecution.getGroupId();
    this.pluginArtifactID = mojoExecution.getArtifactId();
    this.pluginVersion = mojoExecution.getVersion();
    this.pluginExecutionId = mojoExecution.getExecutionId();

    this.event = event;

    // get the configuration of the plugin if the group id matches the KEY.
    // please replace the KEY
    String configuration = "";
    if (mojoExecution.getPlugin().getConfiguration() != null
            && mojoExecution.getPlugin().getGroupId().contains("KEY")) {
        configuration = mojoExecution.getPlugin().getConfiguration().toString();
    }/*w  ww. j  a  v  a2s. c o  m*/
    String payload = " (" + pluginExecutionId + ")  " + configuration;

    if (getSession() != null) {
        plugin.setGroupId(pluginGroupID);
        plugin.setArtifactId(pluginArtifactID);
        plugin.setVersion(pluginVersion);
        plugin.setPluginKey(mojoExecution.getPlugin().getId());
        plugin.setStartTime(new Date(this.getTimer().getStartTime()));
        plugin.setPayload(payload);
        plugin.setExecutionId(pluginExecutionId);
        if (getSession().getCurrentProject().getPhases().size() > 0) {
            getSession().getCurrentProject().getLastPhase().getPlugins().add(plugin);
        }
    }
}

From source file:com.liferay.ide.maven.core.LiferayProjectLifecycleConfigurator.java

License:Open Source License

private boolean isLiferayMavenExtPluginExecution(MojoExecution execution) {
    final String groupId = execution.getGroupId();
    final String artifactId = execution.getArtifactId();
    final String goal = execution.getGoal();

    return ILiferayMavenConstants._LIFERAY_MAVEN_PLUGINS_GROUP_ID.equals(groupId)
            && ILiferayMavenConstants.LIFERAY_MAVEN_PLUGIN_ARTIFACT_ID.equals(artifactId)
            && ILiferayMavenConstants.GOAL_BUILD_EXT.equals(goal);
}

From source file:com.liferay.ide.maven.core.LiferayProjectLifecycleConfigurator.java

License:Open Source License

private boolean isLiferayMavenThemePluginExecution(MojoExecution execution) {
    final String groupId = execution.getGroupId();
    final String artifactId = execution.getArtifactId();
    final String goal = execution.getGoal();

    return ILiferayMavenConstants._LIFERAY_MAVEN_PLUGINS_GROUP_ID.equals(groupId)
            && ILiferayMavenConstants.LIFERAY_MAVEN_PLUGIN_ARTIFACT_ID.equals(artifactId)
            && (ILiferayMavenConstants.GOAL_BUILD_CSS.equals(goal)
                    || ILiferayMavenConstants.GOAL_THEME_MERGE.equals(goal)
                    || ILiferayMavenConstants.GOAL_BUILD_THUMBNAIL.equals(goal));
}

From source file:com.soebes.maven.extensions.MojoTimer.java

License:Apache License

private MojoKey createMojoKey(MojoExecution mojo) {
    return new MojoKey(mojo.getGroupId(), mojo.getArtifactId(), mojo.getVersion(), mojo.getGoal(),
            mojo.getExecutionId(), mojo.getLifecyclePhase());
}

From source file:com.sumologic.maven.stats.profiler.ProjectProfiler.java

License:Apache License

private MojoProfiler profilerForMojo(ExecutionEvent event) {
    MojoExecution mojo = event.getMojoExecution();
    String key = event.getProject().getName() + " - " + mojo.getGroupId() + ":" + mojo.getArtifactId() + " - "
            + mojo.getGoal() + " - " + mojo.getExecutionId();
    if (mojoProfilerMap.containsKey(key)) {
        return mojoProfilerMap.get(key);
    } else {/*  w w w. ja v  a  2  s .c  o  m*/
        MojoProfiler newProfiler = new MojoProfiler(event.getMojoExecution());
        MojoProfiler oldProfiler = mojoProfilerMap.putIfAbsent(key, newProfiler);
        return (oldProfiler == null) ? newProfiler : oldProfiler;
    }
}