slawekjaranowski commented on a change in pull request #285:
URL: https://github.com/apache/maven/pull/285#discussion_r829754730
##########
File path:
maven-core/src/main/java/org/apache/maven/plugin/internal/ValidatingConfigurationListener.java
##########
@@ -94,4 +111,53 @@ private void notify( String fieldName, Object value )
}
}
+ private void warnDeprecated( String fieldName, Object value )
+ {
+ Parameter parameter = mojoDescriptor.getParameterMap().get( fieldName
);
+ String deprecated = parameter.getDeprecated();
+ if ( deprecated != null && !deprecated.isEmpty() )
+ {
+ if ( !toString( value ).equals( toString(
parameter.getDefaultValue() ) ) )
+ {
+ StringBuilder sb = new StringBuilder( " Parameter '" );
+ sb.append( fieldName ).append( '\'' );
+ if ( parameter.getExpression() != null )
+ {
+ String userProperty = parameter.getExpression().replace(
"${", "'" ).replace( '}', '\'' );
+ sb.append( " (User Property " ).append( userProperty
).append( ")" );
+ }
+ sb.append( " is deprecated. " ).append( deprecated );
+
+ logger.warn( MessageUtils.buffer().warning( sb.toString()
).toString() );
+ }
+ }
+ }
+
+ /**
+ * Creates a human-friendly string representation of the specified object.
+ *
+ * @param obj The object to create a string representation for, may be
<code>null</code>.
+ * @return The string representation, never <code>null</code>.
+ */
+ private String toString( Object obj )
Review comment:
https://github.com/apache/maven-assembly-plugin/blob/master/src/main/java/org/apache/maven/plugins/assembly/archive/DefaultAssemblyArchiver.java#L439
So maybe better will be use `DebugConfigurationListener` instead of
duplicate code?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]