本文整理汇总了Java中org.apache.maven.model.ModelBase.getModules方法的典型用法代码示例。如果您正苦于以下问题:Java ModelBase.getModules方法的具体用法?Java ModelBase.getModules怎么用?Java ModelBase.getModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.ModelBase
的用法示例。
在下文中一共展示了ModelBase.getModules方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scanForSubmodulesIn
import org.apache.maven.model.ModelBase; //导入方法依赖的package包/类
private static void scanForSubmodulesIn(ModelBase projectOrProfile, File basedir, Set<File> registered) throws IllegalArgumentException {
for (String module : projectOrProfile.getModules()) {
if (module == null) {
//#205690 apparently in some rare scenarios module can be null, I was not able to reproduce myself
//maven itself checks for null value during validation, but at later stages doesn't always check.
//additional aspect for consideration is that in this case the value is taken from Model class not MavenProject
continue;
}
registerWithSubmodules(FileUtilities.resolveFilePath(basedir, module), registered);
}
}
示例2: mergeModelBase_Modules
import org.apache.maven.model.ModelBase; //导入方法依赖的package包/类
protected void mergeModelBase_Modules( ModelBase target, ModelBase source, boolean sourceDominant,
Map<Object, Object> context )
{
List<String> src = source.getModules();
if ( !src.isEmpty() )
{
List<String> tgt = target.getModules();
List<String> merged = new ArrayList<String>( tgt.size() + src.size() );
merged.addAll( tgt );
merged.addAll( src );
target.setModules( merged );
}
}
示例3: mergeModelBase_Modules
import org.apache.maven.model.ModelBase; //导入方法依赖的package包/类
@Override
protected void mergeModelBase_Modules( ModelBase target, ModelBase source, boolean sourceDominant,
Map<Object, Object> context )
{
List<String> src = source.getModules();
if ( !src.isEmpty() && sourceDominant )
{
List<Integer> indices = new ArrayList<Integer>();
List<String> tgt = target.getModules();
Set<String> excludes = new LinkedHashSet<String>( tgt );
List<String> merged = new ArrayList<String>( tgt.size() + src.size() );
merged.addAll( tgt );
for ( int i = 0, n = tgt.size(); i < n; i++ )
{
indices.add( Integer.valueOf( i ) );
}
for ( int i = 0, n = src.size(); i < n; i++ )
{
String s = src.get( i );
if ( !excludes.contains( s ) )
{
merged.add( s );
indices.add( Integer.valueOf( ~i ) );
}
}
target.setModules( merged );
target.setLocation( "modules", InputLocation.merge( target.getLocation( "modules" ),
source.getLocation( "modules" ), indices ) );
}
}