mirror of
https://github.com/apache/maven.git
synced 2025-02-10 12:05:52 +00:00
[MNG-5716] return toolchains that are of expected type
This commit is contained in:
parent
608b430f7d
commit
2252862e2a
@ -48,23 +48,23 @@ public ToolchainPrivate[] getToolchainsForType( String type, MavenSession contex
|
||||
|
||||
List<ToolchainPrivate> toRet = new ArrayList<ToolchainPrivate>();
|
||||
|
||||
if ( pers != null )
|
||||
ToolchainFactory fact = factories.get( type );
|
||||
if ( fact == null )
|
||||
{
|
||||
logger.error( "Missing toolchain factory for type: " + type
|
||||
+ ". Possibly caused by misconfigured project." );
|
||||
}
|
||||
else if ( pers != null )
|
||||
{
|
||||
List<ToolchainModel> lst = pers.getToolchains();
|
||||
if ( lst != null )
|
||||
{
|
||||
for ( ToolchainModel toolchainModel : lst )
|
||||
{
|
||||
ToolchainFactory fact = factories.get( toolchainModel.getType() );
|
||||
if ( fact != null )
|
||||
if ( type.equals( toolchainModel.getType() ) )
|
||||
{
|
||||
toRet.add( fact.createToolchain( toolchainModel ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.error( "Missing toolchain factory for type: " + toolchainModel.getType()
|
||||
+ ". Possibly caused by misconfigured project." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user