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

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

Introduction

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

Prototype

public String getArtifactId() 

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 . j ava  2s.  co  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) {/*from w ww  . ja  va  2  s.c om*/
    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  ww.  java2  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;
    }/*from  w  ww .  j ava2 s  .c  om*/

    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();
    }/*from  w  w w  . j a  v a2 s .  com*/
    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.liferay.ide.maven.core.MavenUtil.java

License:Open Source License

public static MojoExecution getExecution(MavenExecutionPlan plan, String artifactId) {
    if (plan != null) {
        for (MojoExecution execution : plan.getMojoExecutions()) {
            if (artifactId.equals(execution.getArtifactId())) {
                return execution;
            }//from   w  w  w .j  a v a 2s.c  om
        }
    }

    return null;
}

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());
}