本文整理汇总了Java中org.apache.maven.model.Build.setPluginManagement方法的典型用法代码示例。如果您正苦于以下问题:Java Build.setPluginManagement方法的具体用法?Java Build.setPluginManagement怎么用?Java Build.setPluginManagement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.Build
的用法示例。
在下文中一共展示了Build.setPluginManagement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testExecuteInParentWithConfigurationInPluginManagement
import org.apache.maven.model.Build; //导入方法依赖的package包/类
/**
* Test of execute method, of class RequirePropertyDiverges.
*/
@Test
public void testExecuteInParentWithConfigurationInPluginManagement() throws EnforcerRuleException
{
RequirePropertyDiverges mockInstance = createMockRule();
final MavenProject project = createMavenProject( "company", "company-parent-pom" );
final Build build = new Build();
// create pluginManagement
final Plugin pluginInManagement = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0");
final Xpp3Dom configuration = createPluginConfiguration();
pluginInManagement.setConfiguration( configuration );
final PluginManagement pluginManagement = new PluginManagement();
pluginManagement.addPlugin( pluginInManagement );
build.setPluginManagement( pluginManagement );
// create plugins
final Plugin pluginInPlugins = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0");
build.addPlugin( pluginInPlugins );
// add build
project.getOriginalModel().setBuild( build );
//project.getOriginalModel().setBuild( build );
setUpHelper( project, "parentValue" );
mockInstance.execute( helper );
}
示例2: testExecuteInParentWithConfigurationInExecution
import org.apache.maven.model.Build; //导入方法依赖的package包/类
/**
* Test of execute method, of class RequirePropertyDiverges.
*/
@Test
public void testExecuteInParentWithConfigurationInExecution() throws EnforcerRuleException
{
RequirePropertyDiverges mockInstance = createMockRule();
final MavenProject project = createMavenProject( "company", "company-parent-pom" );
final Build build = new Build();
build.setPluginManagement( new PluginManagement() );
final Plugin plugin = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0" );
final Xpp3Dom configuration = createPluginConfiguration();
PluginExecution pluginExecution = new PluginExecution();
pluginExecution.setConfiguration( configuration );
plugin.addExecution( pluginExecution );
build.addPlugin( plugin );
project.getOriginalModel().setBuild( build );
setUpHelper(project, "parentValue");
mockInstance.execute( helper );
}
示例3: createParentProject
import org.apache.maven.model.Build; //导入方法依赖的package包/类
private MavenProject createParentProject() {
final MavenProject project = createMavenProject( "company", "company-parent-pom" );
final Build build = new Build();
build.setPluginManagement( new PluginManagement() );
final Plugin plugin = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0");
final Xpp3Dom configuration = createPluginConfiguration();
plugin.setConfiguration( configuration );
build.addPlugin( plugin );
project.getOriginalModel().setBuild( build );
return project;
}
示例4: assembleBuildInheritance
import org.apache.maven.model.Build; //导入方法依赖的package包/类
@SuppressWarnings( "unchecked" )
public void assembleBuildInheritance( Build childBuild, Build parentBuild, boolean handleAsInheritance )
{
// The build has been set but we want to step in here and fill in
// values that have not been set by the child.
if ( childBuild.getSourceDirectory() == null )
{
childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
}
if ( childBuild.getScriptSourceDirectory() == null )
{
childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
}
if ( childBuild.getTestSourceDirectory() == null )
{
childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
}
if ( childBuild.getOutputDirectory() == null )
{
childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
}
if ( childBuild.getTestOutputDirectory() == null )
{
childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
}
// Extensions are accumulated
mergeExtensionLists( childBuild, parentBuild );
if ( childBuild.getDirectory() == null )
{
childBuild.setDirectory( parentBuild.getDirectory() );
}
if ( childBuild.getDefaultGoal() == null )
{
childBuild.setDefaultGoal( parentBuild.getDefaultGoal() );
}
if ( childBuild.getFinalName() == null )
{
childBuild.setFinalName( parentBuild.getFinalName() );
}
ModelUtils.mergeFilterLists( childBuild.getFilters(), parentBuild.getFilters() );
List<Resource> resources = childBuild.getResources();
if ( ( resources == null ) || resources.isEmpty() )
{
childBuild.setResources( parentBuild.getResources() );
}
resources = childBuild.getTestResources();
if ( ( resources == null ) || resources.isEmpty() )
{
childBuild.setTestResources( parentBuild.getTestResources() );
}
// Plugins are aggregated if Plugin.inherit != false
ModelUtils.mergePluginLists( childBuild, parentBuild, handleAsInheritance );
// Plugin management :: aggregate
PluginManagement dominantPM = childBuild.getPluginManagement();
PluginManagement recessivePM = parentBuild.getPluginManagement();
if ( ( dominantPM == null ) && ( recessivePM != null ) )
{
// FIXME: Filter out the inherited == false stuff!
childBuild.setPluginManagement( recessivePM );
}
else
{
ModelUtils.mergePluginLists( childBuild.getPluginManagement(), parentBuild.getPluginManagement(), false );
}
}
示例5: testShouldNotFailWhenManagedPluginDepReferencesCurrentProject
import org.apache.maven.model.Build; //导入方法依赖的package包/类
public void testShouldNotFailWhenManagedPluginDepReferencesCurrentProject()
throws CycleDetectedException, DuplicateProjectException
{
MavenProject project = createProject( "group", "artifact", "1.0" );
Build build = project.getModel().getBuild();
PluginManagement pMgmt = new PluginManagement();
Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" );
Dependency dep = createDependency( "group", "artifact", "1.0" );
plugin.addDependency( dep );
pMgmt.addPlugin( plugin );
build.setPluginManagement( pMgmt );
new ProjectSorter( Collections.singletonList( project ) );
}