下面列出了org.apache.maven.plugin.MojoExecutionException#getMessage ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
protected void doGenerateReport( Locale locale, Sink sink )
throws MavenReportException
{
final Map<Property, PropertyVersions> updateSet;
try
{
updateSet = getHelper().getVersionPropertiesMap( getProject(), properties, includeProperties,
excludeProperties, autoLinkItems );
}
catch ( MojoExecutionException e )
{
throw new MavenReportException( e.getMessage(), e );
}
PropertyUpdatesRenderer renderer =
new PropertyUpdatesRenderer( sink, getI18n(), getOutputName(), locale, updateSet );
renderer.render();
}
public VersionsHelper getHelper()
throws MavenReportException
{
if ( helper == null )
{
try
{
helper = new DefaultVersionsHelper( artifactFactory, artifactResolver, artifactMetadataSource,
remoteArtifactRepositories, remotePluginRepositories,
localRepository, wagonManager, settings, serverId, rulesUri,
getLog(), session, pathTranslator );
}
catch ( MojoExecutionException e )
{
throw new MavenReportException( e.getMessage(), e );
}
}
return helper;
}
/**
* {@inheritDoc}
*/
protected void executeReport( Locale locale )
throws MavenReportException
{
if ( !skip )
{
try
{
doGenerateReport( locale, getSink() );
}
catch ( MojoExecutionException e )
{
throw new MavenReportException( e.getMessage(), e );
}
}
}
/**
* {@inheritDoc}
*/
public void check( JnlpDependencyConfig config )
{
if ( config == null )
{
throw new NullPointerException( "config can't be null" );
}
if ( config.getArtifact() == null )
{
throw new NullPointerException( "config.artifact can't be null" );
}
if ( config.getArtifact().getFile() == null )
{
throw new NullPointerException( "config.artifact.file can't be null" );
}
if ( !config.isSign() )
{
throw new IllegalStateException( "Can't sign if config.isSign is false" );
}
File file = config.getArtifact().getFile();
boolean jarSigned;
try
{
jarSigned = signTool.isJarSigned( file );
}
catch ( MojoExecutionException e )
{
throw new RuntimeException( e.getMessage(), e.getCause() );
}
if ( jarSigned && !config.isCanUnsign() )
{
throw new IllegalStateException( "Can't unsign the config.artifact.file if config.isCanUsign is false" );
}
}
/**
* {@inheritDoc}
*/
public void check( JnlpDependencyConfig config )
{
if ( config == null )
{
throw new NullPointerException( "config can't be null" );
}
if ( config.getArtifact() == null )
{
throw new NullPointerException( "config.artifact can't be null" );
}
if ( config.getArtifact().getFile() == null )
{
throw new NullPointerException( "config.artifact.file can't be null" );
}
if ( !config.isSign() )
{
throw new IllegalStateException( "Can't sign if config.isSign is false" );
}
File file = config.getArtifact().getFile();
boolean jarSigned;
try
{
jarSigned = signTool.isJarSigned( file );
}
catch ( MojoExecutionException e )
{
throw new RuntimeException( e.getMessage(), e.getCause() );
}
if ( jarSigned && !config.isCanUnsign() )
{
throw new IllegalStateException( "Can't unsign the config.artifact.file if config.isCanUsign is false" );
}
}
@Override
public boolean fileCreated(File file) throws WatchingException {
try {
execute();
} catch (MojoExecutionException e) {
throw new WatchingException(e.getMessage(), file, e);
}
return true;
}
@Override
public void redeployApp() throws PluginExecutionException {
try {
runLibertyMojoDeploy();
} catch (MojoExecutionException e) {
throw new PluginExecutionException("liberty:deploy goal failed:" + e.getMessage());
}
}