
it.serendigity.maven.plugin.lifecycle.helper.vo.MavenExecutionSummary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lifecycle-helper-maven-plugin Show documentation
Show all versions of lifecycle-helper-maven-plugin Show documentation
A Maven 3.x plugin to inspect the lifecycle of your project.
The plugin provides goals aimed at helping to inspects your project lifecycle phases and
if a plugin-goal is executed and when. It includes the ability to list all plugin-goal mapping to executed phases
and group the execution plan result by lifecycle/phases/plugin/goal.
package it.serendigity.maven.plugin.lifecycle.helper.vo;
import java.util.HashMap;
import java.util.Map;
public class MavenExecutionSummary {
private Map attributeMaxStringLength;
public MavenExecutionSummary() {
attributeMaxStringLength = new HashMap<>();
}
public void updateSummary( MavenExecutionInfo executionInfo ) {
updateMaxStringLength( executionInfo );
}
protected void updateMaxStringLength( MavenExecutionInfo executionInfo ) {
MavenExecutionAttribute[] values = MavenExecutionAttribute.values();
for ( MavenExecutionAttribute mavenExecutionAttribute : values ) {
String key = mavenExecutionAttribute.getCode();
int newStringLength = executionInfo.getStringLength( mavenExecutionAttribute );
Integer oldMaxStringLength = attributeMaxStringLength.get( key );
if ( oldMaxStringLength == null || oldMaxStringLength.compareTo( newStringLength ) < 0 ) {
attributeMaxStringLength.put( key, newStringLength );
}
}
}
public int getMaxStringLength( MavenExecutionAttribute attribute ) {
return attributeMaxStringLength.get( attribute.getCode() );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy