org.apache.maven.model.Reporting类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(12.7k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.apache.maven.model.Reporting类的一些代码示例,展示了Reporting类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reporting类的具体详情如下:
包路径:org.apache.maven.model.Reporting
类名称:Reporting

Reporting介绍

[英]Section for management of reports and their configuration.
[中]用于管理报告及其配置的部分。

代码示例

代码示例来源:origin: org.apache.maven/maven-project

validateStringNotEmpty( "modelVersion", result, model.getModelVersion() );
validateId( "groupId", result, model.getGroupId() );
validateId( "artifactId", result, model.getArtifactId() );
validateStringNotEmpty( "packaging", result, model.getPackaging() );
if ( build != null )
  for ( Iterator it = build.getPlugins().iterator(); it.hasNext(); )
  for ( Iterator it = build.getResources().iterator(); it.hasNext(); )
  for ( Iterator it = build.getTestResources().iterator(); it.hasNext(); )
if ( reporting != null )
  for ( Iterator it = reporting.getPlugins().iterator(); it.hasNext(); )
    validateStringNotEmpty( "reporting.plugins.plugin.artifactId", result, p.getArtifactId() );
    validateStringNotEmpty( "reporting.plugins.plugin.groupId", result, p.getGroupId() );

代码示例来源:origin: org.apache.maven/maven-project

Build build = model.getBuild();
  build.setDirectory( alignToBaseDirectory( build.getDirectory(), basedir ) );
  build.setSourceDirectory( alignToBaseDirectory( build.getSourceDirectory(), basedir ) );
  build.setTestSourceDirectory( alignToBaseDirectory( build.getTestSourceDirectory(), basedir ) );
Reporting reporting = model.getReporting();
  reporting.setOutputDirectory( alignToBaseDirectory( reporting.getOutputDirectory(), basedir ) );

代码示例来源:origin: apache/maven

private void assembleReportingInheritance( Model child, Model parent )
{
  // Reports :: aggregate
  Reporting childReporting = child.getReporting();
  Reporting parentReporting = parent.getReporting();
  if ( parentReporting != null )
  {
    if ( childReporting == null )
    {
      childReporting = new Reporting();
      child.setReporting( childReporting );
    }
    childReporting.setExcludeDefaults( parentReporting.isExcludeDefaults() );
    if ( StringUtils.isEmpty( childReporting.getOutputDirectory() ) )
    {
      childReporting.setOutputDirectory( parentReporting.getOutputDirectory() );
    }
    mergeReportPluginLists( childReporting, parentReporting, true );
  }
}

代码示例来源:origin: apache/maven

protected void mergeReporting_OutputDirectory( Reporting target, Reporting source, boolean sourceDominant,
                        Map<Object, Object> context )
{
  String src = source.getOutputDirectory();
  if ( src != null )
  {
    if ( sourceDominant || target.getOutputDirectory() == null )
    {
      target.setOutputDirectory( src );
      target.setLocation( "outputDirectory", source.getLocation( "outputDirectory" ) );
    }
  }
}

代码示例来源:origin: org.apache.maven/maven-project

public static Reporting cloneReporting( Reporting src )
{
  if ( src == null )
  {
    return null;
  }
  
  Reporting result = new Reporting();
  
  result.setExcludeDefaults( src.isExcludeDefaults() );
  result.setOutputDirectory( src.getOutputDirectory() );
  result.setPlugins( cloneList( src.getPlugins(), REPORT_PLUGIN_CLONER ) );
  
  return result;
}

代码示例来源:origin: apache/maven-release

private void unalignFromBaseDirectory( Model releaseModel, File basedir )
  Model rawSuperModel = superPomProvider.getSuperModel( releaseModel.getModelVersion() );
  properties.put( "project.version", releaseModel.getVersion() );
  properties.put( "project.artifactId", releaseModel.getArtifactId() );
  buildingRequest.setUserProperties( properties );
  Build rawSuperBuild = rawSuperModel.getBuild();
  currentBuild.setSourceDirectory( resolvePath( basedir.toPath(), currentBuild.getSourceDirectory(),
                       interpolatedSuperBuild.getSourceDirectory(),
                       rawSuperBuild.getSourceDirectory() ) );
  currentBuild.setScriptSourceDirectory( resolvePath( basedir.toPath(), currentBuild.getScriptSourceDirectory(),
  releaseModel.getReporting().setOutputDirectory( resolvePath( basedir.toPath(),
                           releaseModel.getReporting().getOutputDirectory(),
                           interpolatedSuperModel.getReporting().getOutputDirectory(),
                           rawSuperModel.getReporting().getOutputDirectory() ) );

代码示例来源:origin: mojohaus/versions-maven-plugin

for ( Profile profile : model.getProfiles() )
    addReportPluginAssociations( helper, expressionEvaluator, result, profile.getReporting().getPlugins() );
addProperties( helper, result, null, model.getProperties() );
if ( model.getDependencyManagement() != null )
if ( model.getBuild() != null )
  if ( model.getBuild().getPluginManagement() != null )
                model.getBuild().getPluginManagement().getPlugins() );
  addPluginAssociations( helper, expressionEvaluator, result, model.getBuild().getPlugins() );
if ( model.getReporting() != null )
  addReportPluginAssociations( helper, expressionEvaluator, result, model.getReporting().getPlugins() );
    addReportPluginAssociations( helper, expressionEvaluator, result, profile.getReporting().getPlugins() );

代码示例来源:origin: apache/maven-release

releaseModel.setParent( null );
releaseModel.setProfiles( Collections.<Profile>emptyList() );
releaseModel.setDependencyManagement( null );
releaseProject.getBuild().setPluginManagement( null );
releaseModel.setVersion( releaseVersion );
String originalFinalName = releaseModel.getBuild().getFinalName();
          + releaseProject.getId() );
releaseModel.getBuild().setFinalName( finalName );
releaseModel.getReporting().setPlugins( createReleaseReportPlugins( releaseDescriptor, 
                                  releaseProject ) );

代码示例来源:origin: apache/maven

@Override
public void convertReporting( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
  Reporting reporting = model.getReporting();
  Build build = model.getBuild();
    build = new Build();
    model.setBuild( build );
    PluginManagement pluginManagement = build.getPluginManagement();
    if ( pluginManagement == null )
      build.setPluginManagement( pluginManagement );
    addDom( configuration, "outputDirectory", reporting.getOutputDirectory() );
  for ( ReportPlugin plugin : reporting.getPlugins() )
    if ( !reporting.isExcludeDefaults() && !hasMavenProjectInfoReportsPlugin
      && "org.apache.maven.plugins".equals( plugin.getGroupId() )
      && "maven-project-info-reports-plugin".equals( plugin.getArtifactId() ) )
  if ( !reporting.isExcludeDefaults() && !hasMavenProjectInfoReportsPlugin )

代码示例来源:origin: spring-projects/sts4

File sourceFolder = new File(project.getBuild().getSourceDirectory());
File outputFolder = new File(project.getBuild().getOutputDirectory());
CPE cpe = CPE.source(sourceFolder, outputFolder);
cpe.setOwn(true);
safe(() -> {
  String reportingDir = project.getModel().getReporting().getOutputDirectory();
  if (reportingDir!=null) {
    File apidocs = new File(new File(reportingDir), "apidocs");
for (Resource resource : project.getBuild().getResources()) {
  File sourceFolder = new File(resource.getDirectory());
  String targetPath = resource.getTargetPath();
cpe.setOwn(true);
safe(() -> {
  String reportingDir = project.getModel().getReporting().getOutputDirectory();
  if (reportingDir!=null) {
    File apidocs = new File(new File(reportingDir), "apidocs");

代码示例来源:origin: io.fabric8.forge/devops

Model model = mavenFacet.getModel();
if (model != null) {
  Build build = model.getBuild();
  if (build == null) {
    build = new Build();
    model.setBuild(build);
  List<Extension> extensions = build.getExtensions();
  if (extensions == null) {
    extensions = new ArrayList<>();
    extension.setVersion(EXTENSION_DAV_VERSION);
    extensions.add(extension);
    build.setExtensions(extensions);
    changed = true;
  Reporting reporting = model.getReporting();
  if (reporting == null) {
    reporting = new Reporting();
    model.setReporting(reporting);
  Map<String, ReportPlugin> reportPluginsAsMap = reporting.getReportPluginsAsMap();
    ReportPlugin reportPlugin = new ReportPlugin();
    reportPlugin.setGroupId(PLUGIN_JAVADOC_GROUP_ID);
    reportPlugin.setArtifactId(PLUGIN_JAVADOC_ARTIFACT_ID);
    reportPlugin.setVersion(PLUGIN_JAVADOC_VERSION);
    reporting.addPlugin(reportPlugin);

代码示例来源:origin: org.codehaus.mojo/versions-maven-plugin

addProjectPlugins( plugins, originalModel.getBuild().getPluginManagement().getPlugins(),
          excludePluginManagement );
List<Plugin> buildPlugins = new ArrayList<>( originalModel.getBuild().getPlugins() );
for ( Iterator<Plugin> i = buildPlugins.iterator(); i.hasNext(); )
List<ReportPlugin> reportPlugins = new ArrayList<>( originalModel.getReporting().getPlugins() );
for ( Iterator<ReportPlugin> i = reportPlugins.iterator(); i.hasNext(); )
  if ( reportPlugin.getVersion() == null )
    String parentVersion = parentPluginManagement.get( reportPlugin.getKey() );
    if ( parentVersion != null )
  addProjectPlugins( plugins, toPlugins( profile.getReporting().getPlugins() ), parentReportPlugins );

代码示例来源:origin: org.apache.maven.enforcer/enforcer-rules

List<Plugin> modelPlugins = model.getBuild().getPlugins();
plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), model.getId()
  + ".build.plugins" ) );
List<ReportPlugin> modelReportPlugins = model.getReporting().getPlugins();
plugins.addAll( PluginWrapper.addAll( utils.resolveReportPlugins( modelReportPlugins ), model.getId()
List<Plugin> modelPlugins = model.getBuild().getPluginManagement().getPlugins();
plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), model.getId()
  + ".build.pluginManagement.plugins" ) );
  List<ReportPlugin> modelReportPlugins = profile.getReporting().getPlugins();

代码示例来源:origin: org.apache.maven.plugins/maven-jxr-plugin

for ( Iterator<?> it = project.getModel().getReporting().getPlugins().iterator(); it.hasNext(); )
for ( Iterator<?> it = project.getModel().getBuild().getPlugins().iterator(); it.hasNext(); )

代码示例来源:origin: org.apache.maven.shared/maven-model-converter

if ( v4Model.getBuild() == null )
  v4Model.setBuild( new Build() );
v4Model.getBuild().addPlugin( plugin );
sendInfoMessage( "Adding plugin " + plugin.getGroupId() + ":" + plugin.getArtifactId() );
fireAddPluginEvent( plugin );
plugin = new ReportPlugin();
plugin.setGroupId( getGroupId() );
plugin.setArtifactId( getArtifactId() );
if ( v4Model.getReporting() == null )
  v4Model.setReporting( new Reporting() );
v4Model.getReporting().addPlugin( plugin );
sendInfoMessage( "Adding report " + plugin.getGroupId() + ":" + plugin.getArtifactId() );
fireAddReportEvent( plugin );

代码示例来源:origin: trautonen/coveralls-maven-plugin

ExistingFiles sagaFiles = ExistingFiles.create(sagaReports);
for (MavenProject p : projects) {
  File reportingDirectory = new File(p.getModel().getReporting().getOutputDirectory());
  File buildDirectory = new File(p.getBuild().getDirectory());

代码示例来源:origin: apache/maven-release

Properties properties = modelTarget.getProperties();
Build buildTarget = modelTarget.getBuild();
if ( buildTarget != null )
  rewriteArtifactVersions( toMavenCoordinates( buildTarget.getExtensions() ), 
               model, properties, result, releaseDescriptor, simulate );
  rewriteArtifactVersions( toMavenCoordinates( buildTarget.getPlugins() ), 
               model, properties, result, releaseDescriptor, simulate );
  for ( Plugin plugin : buildTarget.getPlugins() )
for ( Profile profile : modelTarget.getProfiles() )
    rewriteArtifactVersions( toMavenCoordinates( modelBase.getReporting().getPlugins() ), model, properties,
                 result, releaseDescriptor, simulate );

代码示例来源:origin: apache/maven-release

Reporting reporting = project.getModel().getReporting();
  List<ReportPlugin> reportPlugins = reporting.getPlugins();
      String id = ArtifactUtils.versionlessKey( reportPlugin.getGroupId(), reportPlugin.getArtifactId() );
      Artifact artifact = artifactsById.get( id );
      String version = getReleaseVersion( releaseDescriptor, artifact );
      ReportPlugin releaseReportPlugin = new ReportPlugin();
      releaseReportPlugin.setGroupId( reportPlugin.getGroupId() );
      releaseReportPlugin.setArtifactId( reportPlugin.getArtifactId() );

代码示例来源:origin: org.apache.maven.shared/maven-model-converter

v4Model.getBuild().getPlugins().remove( oldBuildPlugin );
sendInfoMessage( "Removing build plugin " + getOldGroupId() + ":" + getOldArtifactId() );
fireRemovePluginEvent( getOldGroupId(), getOldArtifactId() );
  v4Model.getBuild().getPlugins().remove( oldBuildPlugin );
  sendInfoMessage( "Removing old build plugin " + getOldGroupId() + ":" + getOldArtifactId()
    + " because the new one already exist" );
v4Model.getReporting().getPlugins().remove( oldReportPlugin );
sendInfoMessage( "Removing report plugin " + getOldGroupId() + ":" + getOldArtifactId() );
fireRemovePluginEvent( getOldGroupId(), getOldArtifactId() );
  oldReportPlugin.setArtifactId( getNewArtifactId() );
  oldReportPlugin.setGroupId( getNewGroupId() );
  sendInfoMessage( "Relocating report plugin " + getOldGroupId() + ":" + getOldArtifactId() );
  fireRelocateReportEvent( getOldGroupId(), getOldArtifactId(), getNewGroupId(), getNewArtifactId() );
  v4Model.getReporting().getPlugins().remove( oldReportPlugin );
  sendInfoMessage( "Removing old report plugin " + getOldGroupId() + ":" + getOldArtifactId()
    + " because the new one already exist" );

代码示例来源:origin: org.codehaus.mojo/versions-maven-plugin

try
  for ( ReportPlugin plugin : model.getReporting().getPlugins() )
    String coord = plugin.getKey();
    String version = plugin.getVersion();
    if ( version != null && ( !onlyIncludeInherited || getPluginInherited( plugin ) ) )
  for ( Profile profile : model.getProfiles() )
      for ( ReportPlugin plugin : profile.getReporting().getPlugins() )
        String coord = plugin.getKey();
        String version = plugin.getVersion();
        if ( version != null && ( !onlyIncludeInherited || getPluginInherited( plugin ) ) )

相关文章