[MNG-7642] Restore compatibility with flatten-maven-plugin (#947)

Revert "[MNG-7505] Remove ReportingConverter (#906)"
This reverts commit adf89ef63f.
This commit is contained in:
Guillaume Nodet 2023-01-09 16:06:48 +01:00 committed by GitHub
parent fc2d94f077
commit 1968951a53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 107 additions and 0 deletions

View File

@ -76,6 +76,7 @@
import org.apache.maven.model.plugin.LifecycleBindingsInjector;
import org.apache.maven.model.plugin.PluginConfigurationExpander;
import org.apache.maven.model.plugin.ReportConfigurationExpander;
import org.apache.maven.model.plugin.ReportingConverter;
import org.apache.maven.model.profile.DefaultProfileActivationContext;
import org.apache.maven.model.profile.ProfileActivationContext;
import org.apache.maven.model.profile.ProfileInjector;
@ -625,6 +626,15 @@ public DefaultModelBuilder setProfileActivationFilePathInterpolator(
versionProcessor);
}
/**
* @deprecated since Maven 4
* @see DefaultModelBuilderFactory#setReportingConverter(ReportingConverter)
*/
@Deprecated
public DefaultModelBuilder setReportingConverter(ReportingConverter reportingConverter) {
return this;
}
@Override
public DefaultTransformerContextBuilder newTransformerContextBuilder() {
return new DefaultTransformerContextBuilder();

View File

@ -50,9 +50,11 @@
import org.apache.maven.model.path.UrlNormalizer;
import org.apache.maven.model.plugin.DefaultPluginConfigurationExpander;
import org.apache.maven.model.plugin.DefaultReportConfigurationExpander;
import org.apache.maven.model.plugin.DefaultReportingConverter;
import org.apache.maven.model.plugin.LifecycleBindingsInjector;
import org.apache.maven.model.plugin.PluginConfigurationExpander;
import org.apache.maven.model.plugin.ReportConfigurationExpander;
import org.apache.maven.model.plugin.ReportingConverter;
import org.apache.maven.model.profile.DefaultProfileInjector;
import org.apache.maven.model.profile.DefaultProfileSelector;
import org.apache.maven.model.profile.ProfileInjector;
@ -183,6 +185,11 @@ public DefaultModelBuilderFactory setReportConfigurationExpander(
return this;
}
@Deprecated
public DefaultModelBuilderFactory setReportingConverter(ReportingConverter reportingConverter) {
return this;
}
public DefaultModelBuilderFactory setProfileActivationFilePathInterpolator(
ProfileActivationFilePathInterpolator profileActivationFilePathInterpolator) {
this.profileActivationFilePathInterpolator = profileActivationFilePathInterpolator;
@ -294,6 +301,11 @@ protected ReportConfigurationExpander newReportConfigurationExpander() {
return new DefaultReportConfigurationExpander();
}
@Deprecated
protected ReportingConverter newReportingConverter() {
return new DefaultReportingConverter();
}
private ModelSourceTransformer newModelSourceTransformer() {
return new DefaultModelSourceTransformer();
}

View File

@ -0,0 +1,42 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.model.plugin;
import javax.inject.Named;
import javax.inject.Singleton;
import org.apache.maven.model.Model;
import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.ModelProblemCollector;
/**
* Handles conversion of the <code>&lt;reporting&gt;</code> section into the configuration of Maven Site Plugin 3.x,
* i.e. <code>reportPlugins</code> and <code>outputDirectory</code> parameters.
*
* @author Benjamin Bentmann
* @deprecated since maven 4.0, this class is now a no-op class and is only here for compatibility
*/
@Named
@Singleton
@Deprecated
public class DefaultReportingConverter implements ReportingConverter {
@Override
public void convertReporting(Model model, ModelBuildingRequest request, ModelProblemCollector problems) {}
}

View File

@ -0,0 +1,43 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.model.plugin;
import org.apache.maven.model.Model;
import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.ModelProblemCollector;
/**
* Handles conversion of the <code>&lt;reporting&gt;</code> section into the configuration of Maven Site Plugin 3.x,
* i.e. <code>reportPlugins</code> and <code>outputDirectory</code> parameters.
*
* @author Benjamin Bentmann
* @deprecated since maven 4.0, this interface is not used anymore and is only here for compatibility
*/
@Deprecated
public interface ReportingConverter {
/**
* Converts values from model's reporting section into the configuration for Maven Site Plugin 3.x.
*
* @param model The model whose reporting section should be converted, must not be <code>null</code>.
* @param request The model building request that holds further settings, must not be {@code null}.
* @param problems The container used to collect problems that were encountered, must not be {@code null}.
*/
void convertReporting(Model model, ModelBuildingRequest request, ModelProblemCollector problems);
}