当前位置: 首页>>代码示例>>Java>>正文


Java ExpressionEvaluationException.getLocalizedMessage方法代码示例

本文整理汇总了Java中org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException.getLocalizedMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ExpressionEvaluationException.getLocalizedMessage方法的具体用法?Java ExpressionEvaluationException.getLocalizedMessage怎么用?Java ExpressionEvaluationException.getLocalizedMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException的用法示例。


在下文中一共展示了ExpressionEvaluationException.getLocalizedMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入方法依赖的package包/类
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
    Log log = helper.getLog();

    try {
        // get the various expressions out of the helper.
        MavenProject project = (MavenProject) helper.evaluate("${project}");
        // MavenSession session = (MavenSession) helper.evaluate("${session}");
        // String target = (String) helper.evaluate("${project.build.directory}");
        // String artifactId = (String) helper.evaluate("${project.artifactId}");

        // ArtifactResolver resolver = (ArtifactResolver) helper.getComponent(ArtifactResolver.class);
        // RuntimeInfo rti = (RuntimeInfo) helper.getComponent(RuntimeInfo.class);
        List compileSourceRoots = project.getCompileSourceRoots();

        for (Object compileSourceRoot : compileSourceRoots) {
            String path = (String) compileSourceRoot;
            applyForJavaSourcesInRoot(path, log);
        }
    } catch (ExpressionEvaluationException e) {
        throw new EnforcerRuleException("Unable to lookup an expression " + e.getLocalizedMessage(), e);
    }
}
 
开发者ID:CloudSlang,项目名称:cloud-slang,代码行数:23,代码来源:SpringCleansingRule.java

示例2: execute

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入方法依赖的package包/类
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
    Log log = helper.getLog();

    try {
        MavenProject currentProject = RuleHelper.getSession(helper).getCurrentProject();

        checkForSubmoduleDependencyManagement(currentProject, log);

        if (failureDetected) {
            throw new EnforcerRuleException("Failing because of forbidden dependency management in sub modules");
        }
    } catch (ExpressionEvaluationException e) {
        throw new EnforcerRuleException("Unable to lookup an expression " + e.getLocalizedMessage(), e);
    }
}
 
开发者ID:1and1,项目名称:ono-extra-enforcer-rules,代码行数:16,代码来源:ForbidDependencyManagementInSubModulesRule.java

示例3: execute

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入方法依赖的package包/类
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
    Log log = helper.getLog();

    try {
        MavenProject project = getProject(helper);

        checkPluginManagementDiffs(project, log);

        if (failureDetected) {
            throw new EnforcerRuleException("Failing because of overridden managed plugins");
        }
    } catch (ExpressionEvaluationException e) {
        throw new EnforcerRuleException("Unable to lookup an expression " + e.getLocalizedMessage(), e);
    }
}
 
开发者ID:1and1,项目名称:ono-extra-enforcer-rules,代码行数:16,代码来源:ForbidOverridingManagedPluginsRule.java

示例4: execute

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入方法依赖的package包/类
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
    try {
        MavenProject project = RuleHelper.getProject(helper);

        if (ruleIsDefinedInProjectOrNotModuleParent(project, helper.getLog())) {
            detectUnmanagedModules(helper, project);
        }
    } catch (ExpressionEvaluationException e) {
        throw new EnforcerRuleException("Unable to lookup an expression " + e.getLocalizedMessage(), e);
    }
}
 
开发者ID:1and1,项目名称:ono-extra-enforcer-rules,代码行数:12,代码来源:ManageAllModulesRule.java

示例5: execute

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入方法依赖的package包/类
public void execute( EnforcerRuleHelper helper )
    throws EnforcerRuleException
{
    try
    {
        if ( StringUtils.isBlank( encoding ) )
        {
            encoding = (String) helper.evaluate( "${project.build.sourceEncoding}" );
        }
        Log log = helper.getLog();
        if ( encoding.equals( StandardCharsets.US_ASCII.name() ) )
        {
            log.warn( "Encoding US-ASCII is hard to detect. Use UTF-8 or ISO-8859-1" );
        }
        String basedir = (String) helper.evaluate( "${basedir}" );
        DirectoryScanner ds = new DirectoryScanner();
        ds.setBasedir( basedir );
        if ( StringUtils.isNotBlank( includes ) )
        {
            ds.setIncludes( includes.split( "[,\\|]" ) );
        }
        if ( StringUtils.isNotBlank( excludes ) )
        {
            ds.setExcludes( excludes.split( "[,\\|]" ) );
        }
        if ( useDefaultExcludes )
        {
            ds.addDefaultExcludes();
        }
        ds.scan();
        StringBuilder filesInMsg = new StringBuilder();
        for ( String file : ds.getIncludedFiles() )
        {
            String fileEncoding = getEncoding( encoding, new File( basedir, file ), log );
            if ( log.isDebugEnabled() )
            {
                log.debug( file + "==>" + fileEncoding );
            }
            if ( fileEncoding != null && !fileEncoding.equals( encoding ) )
            {
                filesInMsg.append( file );
                filesInMsg.append( "==>" );
                filesInMsg.append( fileEncoding );
                filesInMsg.append( "\n" );
                if ( failFast )
                {
                    throw new EnforcerRuleException( filesInMsg.toString() );
                }
            }
        }
        if ( filesInMsg.length() > 0 )
        {
            throw new EnforcerRuleException( "Files not encoded in " + encoding + ":\n" + filesInMsg );
        }
    }
    catch ( IOException ex )
    {
        throw new EnforcerRuleException( "Reading Files", ex );
    }
    catch ( ExpressionEvaluationException e )
    {
        throw new EnforcerRuleException( "Unable to lookup an expression " + e.getLocalizedMessage(), e );
    }
}
 
开发者ID:mojohaus,项目名称:extra-enforcer-rules,代码行数:65,代码来源:RequireEncoding.java


注:本文中的org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException.getLocalizedMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。