michael-o commented on code in PR #130: URL: https://github.com/apache/maven-plugin-tools/pull/130#discussion_r941722773
########## maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java: ########## @@ -159,12 +159,42 @@ /** * Set this to "true" to generate the usage section for "plugin-info.html" with * {@code <extensions>true</extensions>}. - * + * * @since 3.7.0 */ @Parameter( defaultValue = "false", property = "maven.plugin.report.hasExtensionsToLoad" ) private boolean hasExtensionsToLoad; + /** + * The Plugin requirements history list. + * <p> + * Can be specified as list of string in format: + * + * <pre> + * <requirementsHistories> + * <requirementsHistory> + * plugin-version requires Maven maven-version and JDK jdk-version + * </requirementsHistory> + * </requirementsHistories> + * </pre> + * + * or as xml: + * + * <pre> + * <requirementsHistories> + * <requirementsHistory> + * <version>plugin version</version> + * <maven>maven version</maven> + * <jdk>jdk version</jdk> + * </requirementsHistory> + * </requirementsHistories> Review Comment: I wouldn't support both, it just causes confusion and inconsistency. I'd go with the second approach. ########## maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report/RequirementsHistory.java: ########## @@ -0,0 +1,99 @@ +package org.apache.maven.plugin.plugin.report; + +/* + * 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. + */ + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.maven.reporting.MavenReportException; + +/** + * Plugin requirements history. + * + * @author Slawomir Jaranowski + */ +public class RequirementsHistory +{ + private static final Pattern REQUIREMENT_PATTERN = + Pattern.compile( "\\s*(.+?)\\s+requires\\s+Maven\\s+(.+?)\\s+and\\s+JDK\\s+(.+?)\\s*" ); Review Comment: See previous comment. ########## maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report/Requirements.java: ########## @@ -0,0 +1,91 @@ +package org.apache.maven.plugin.plugin.report; + +/* + * 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. + */ + +import java.util.Properties; + +/** + * Plugin requirements. + */ +public class Requirements +{ + /** + * The minimum version of Maven to run this plugin. + */ + private String maven; + + /** + * The minimum version of the JDK to run this plugin. + */ + private String jdk; + + /** + * The minimum memory needed to run this plugin. + */ + private String memory; + + /** + * The minimum diskSpace needed to run this plugin. + */ + private String diskSpace; + + /** + * Field others. + */ + private java.util.Properties others; + + public String getMaven() + { + return maven; + } + + public String getJdk() + { + return jdk; + } + + public String getMemory() + { + return memory; + } + + public String getDiskSpace() + { + return diskSpace; + } + + public Properties getOthers() + { + return others; + } + + @Override + public String toString() + { + final StringBuilder sb = new StringBuilder( "Requirements{" ); + sb.append( "maven='" ).append( maven ).append( '\'' ); + sb.append( ", jdk='" ).append( jdk ).append( '\'' ); + sb.append( ", memory='" ).append( memory ).append( '\'' ); + sb.append( ", diskSpace='" ).append( diskSpace ).append( '\'' ); + sb.append( ", others=" ).append( others ); + sb.append( '}' ); + return sb.toString(); + } +} Review Comment: All elements which will go away should be deprecated. -- 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: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org