Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-8025] Restore compatibility #1467

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 37 additions & 42 deletions api/maven-api-model/src/main/mdo/maven.mdo
Original file line number Diff line number Diff line change
Expand Up @@ -652,36 +652,18 @@
<version>4.0.0/4.0.99</version>
<code>
<![CDATA[
Map<String, Plugin> pluginMap;

/**
* Reset the {@code pluginsMap} field to {@code null}
*/
public synchronized void flushPluginMap()
{
this.pluginMap = null;
public void flushPluginMap() {
}

/**
* @return a Map of plugins field with {@code Plugins#getKey()} as key
* @see Plugin#getKey()
*/
public synchronized Map<String, Plugin> getPluginsAsMap()
{
if ( pluginMap == null )
{
pluginMap = new java.util.LinkedHashMap<String, Plugin>();
if ( getPlugins() != null )
{
for ( java.util.Iterator<Plugin> it = getPlugins().iterator(); it.hasNext(); )
{
Plugin plugin = (Plugin) it.next();
pluginMap.put( plugin.getKey(), plugin );
}
}
}

return pluginMap;
public Map<String, Plugin> getPluginsAsMap() {
return getPlugins().stream().collect(Collectors.toMap(plugin -> plugin.getKey(), plugin -> plugin));
}
]]>
</code>
Expand Down Expand Up @@ -2298,6 +2280,17 @@
return ( getInherited() != null ) ? Boolean.parseBoolean( getInherited() ) : true;
}

]]>
</code>
</codeSegment>
<codeSegment>
<version>4.0.0/4.0.99</version>
<code>
<![CDATA[
@Deprecated
public void unsetInheritanceApplied() {
}

]]>
</code>
</codeSegment>
Expand Down Expand Up @@ -2389,40 +2382,28 @@
public void setExtensions(boolean extensions) {
setExtensions(String.valueOf(extensions));
}
]]>
</code>
</codeSegment>
<codeSegment>
<version>4.0.0+</version>
<code>
<![CDATA[
private Map<String, PluginExecution> executionMap = null;

/**
* Reset the {@code executionMap} field to {@code null}
*/
@Deprecated
public void flushExecutionMap() {
this.executionMap = null;
}

/**
* @return a Map of executions field with {@code PluginExecution#getId()} as key
* @see PluginExecution#getId()
*/
public Map<String, PluginExecution> getExecutionsAsMap() {
if (executionMap == null) {
executionMap = new java.util.LinkedHashMap<String, PluginExecution>();
for (java.util.Iterator<PluginExecution> i = getExecutions().iterator(); i.hasNext();) {
PluginExecution exec = (PluginExecution) i.next();
if (executionMap.containsKey(exec.getId())) {
throw new IllegalStateException("You cannot have two plugin executions with the same (or missing) <id/> elements.\nOffending execution\n\nId: \'" + exec.getId() + "\'\nPlugin:\'" + getKey() + "\'\n\n");
}
executionMap.put(exec.getId(), exec);
}
}
return executionMap;
return getExecutions().stream().collect(Collectors.toMap(exec -> exec.getId(), exec -> exec));
}

]]>
</code>
</codeSegment>
<codeSegment>
<version>4.0.0+</version>
<code>
<![CDATA[
/**
* Gets the identifier of the plugin.
*
Expand Down Expand Up @@ -2646,6 +2627,20 @@
setExcludeDefaults(String.valueOf(excludeDefaults));
}

/**
* Reset the <code>reportPluginMap</code> field to <code>null</code>
*/
@Deprecated
public void flushReportPluginMap() {
}

/**
* @return a Map of plugins field with <code>ReportPlugin#getKey()</code> as key
* @see org.apache.maven.model.ReportPlugin#getKey()
*/
public java.util.Map<String, ReportPlugin> getReportPluginsAsMap() {
return getPlugins().stream().collect(Collectors.toMap(report -> report.getKey(), report -> report));
}
]]>
</code>
</codeSegment>
Expand Down
4 changes: 4 additions & 0 deletions maven-embedder/src/main/java/org/fusesource/jansi/Ansi.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ public static boolean isEnabled() {
return org.apache.maven.jline.MessageUtils.isColorEnabled() && org.jline.jansi.Ansi.isEnabled();
}

public static void setEnabled(final boolean flag) {
org.jline.jansi.Ansi.setEnabled(flag);
}

public static Ansi ansi() {
if (isEnabled()) {
return new Ansi();
Expand Down
3 changes: 0 additions & 3 deletions maven-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ under the License.
<exclude>org.apache.maven.model.*#setOtherLocation(java.lang.Object,org.apache.maven.model.InputLocation):METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.ConfigurationContainer#isInheritanceApplied():METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.ConfigurationContainer#setInherited(boolean):METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.ConfigurationContainer#unsetInheritanceApplied():METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.Contributor#addProperty(java.lang.String,java.lang.String):METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.Dependency#clearManagementKey():METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.ModelBase#addProperty(java.lang.String,java.lang.String):METHOD_REMOVED</exclude>
Expand All @@ -132,8 +131,6 @@ under the License.
<exclude>org.apache.maven.model.Notifier#addConfiguration(java.lang.String,java.lang.String):METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.Plugin#getGoals():METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.Plugin#setGoals(java.lang.Object):METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.Reporting#flushReportPluginMap():METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.Reporting#getReportPluginsAsMap():METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.Resource#initMergeId():METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.Scm#setChildScmConnectionInheritAppendPath(boolean):METHOD_REMOVED</exclude>
<exclude>org.apache.maven.model.Scm#setChildScmDeveloperConnectionInheritAppendPath(boolean):METHOD_REMOVED</exclude>
Expand Down