diff --git a/plexus-component-metadata.spec b/plexus-component-metadata.spec index 28dacf1..d3ff602 100644 --- a/plexus-component-metadata.spec +++ b/plexus-component-metadata.spec @@ -114,13 +114,14 @@ pushd %{comp_name} %{mvn_file} :%{comp_name} %{base_name}/%{comp_name} %{mvn_build} \ %if %{without tests} - -f \ + -f \ %endif + -- \ %if %{?pkg_vcmp:%pkg_vcmp java-devel >= 9}%{!?pkg_vcmp:0} - -- -Dmaven.compiler.release=8 + -Dmaven.compiler.release=8 \ %endif + -Dsource=8 -# empty line, keep popd %install diff --git a/plexus-metadata-generator-cli.patch b/plexus-metadata-generator-cli.patch index e471bcd..49e507f 100644 --- a/plexus-metadata-generator-cli.patch +++ b/plexus-metadata-generator-cli.patch @@ -9,7 +9,7 @@ diff -urEbwBN plexus-containers-plexus-containers-2.1.0/plexus-component-metadat +import java.util.Collections; + +import org.apache.commons.cli.CommandLine; -+import org.apache.commons.cli.OptionBuilder; ++import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.tools.cli.AbstractCli; @@ -17,11 +17,11 @@ diff -urEbwBN plexus-containers-plexus-containers-2.1.0/plexus-component-metadat +public class PlexusMetadataGeneratorCli + extends AbstractCli +{ -+ public static final char SOURCE_DIRECTORY = 's'; -+ public static final char SOURCE_ENCODING = 'e'; -+ public static final char CLASSES_DIRECTORY = 'c'; -+ public static final char OUTPUT_FILE = 'o'; -+ public static final char DESCRIPTORS_DIRECTORY = 'm'; ++ public static final String SOURCE_DIRECTORY = "s"; ++ public static final String SOURCE_ENCODING = "e"; ++ public static final String CLASSES_DIRECTORY = "c"; ++ public static final String OUTPUT_FILE = "o"; ++ public static final String DESCRIPTORS_DIRECTORY = "m"; + + public static void main( String[] args ) + throws Exception @@ -39,11 +39,11 @@ diff -urEbwBN plexus-containers-plexus-containers-2.1.0/plexus-component-metadat + @SuppressWarnings("static-access") + public Options buildCliOptions( Options options ) + { -+ options.addOption( OptionBuilder.withLongOpt( "source" ).hasArg().withDescription( "Source directory." ).create( SOURCE_DIRECTORY ) ); -+ options.addOption( OptionBuilder.withLongOpt( "encoding" ).hasArg().withDescription( "Source file encoding." ).create( SOURCE_ENCODING ) ); -+ options.addOption( OptionBuilder.withLongOpt( "classes" ).hasArg().withDescription( "Classes directory." ).create( CLASSES_DIRECTORY ) ); -+ options.addOption( OptionBuilder.withLongOpt( "output" ).hasArg().withDescription( "Output directory." ).create( OUTPUT_FILE ) ); -+ options.addOption( OptionBuilder.withLongOpt( "descriptors" ).hasArg().withDescription( "Descriptors directory." ).create( DESCRIPTORS_DIRECTORY ) ); ++ options.addOption( Option.builder( SOURCE_DIRECTORY ).longOpt( "source" ).hasArg().desc( "Source directory." ).build() ); ++ options.addOption( Option.builder( SOURCE_ENCODING ).longOpt( "encoding" ).hasArg().desc( "Source file encoding." ).build() ); ++ options.addOption( Option.builder( CLASSES_DIRECTORY ).longOpt( "classes" ).hasArg().desc( "Classes directory." ).build() ); ++ options.addOption( Option.builder( OUTPUT_FILE ).longOpt( "output" ).hasArg().desc( "Output directory." ).build() ); ++ options.addOption( Option.builder( DESCRIPTORS_DIRECTORY ).longOpt( "descriptors" ).hasArg().desc( "Descriptors directory." ).build() ); + return options; + } + diff --git a/plexus-metadata-generator.changes b/plexus-metadata-generator.changes index 9be59bb..b0b4081 100644 --- a/plexus-metadata-generator.changes +++ b/plexus-metadata-generator.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri May 20 12:13:42 UTC 2022 - Fridrich Strba + +- Modified patch: + * plexus-metadata-generator-cli.patch + + Do not use the deprecated plexus-cli functions, but port + the generator to the recommended replacement + ------------------------------------------------------------------- Sun Mar 20 17:43:54 UTC 2022 - Fridrich Strba diff --git a/plexus-metadata-generator.spec b/plexus-metadata-generator.spec index 1ff8b13..3d0b36a 100644 --- a/plexus-metadata-generator.spec +++ b/plexus-metadata-generator.spec @@ -85,7 +85,7 @@ Group: Documentation/HTML mkdir -p lib build-jar-repository -s lib %{base_name} objectweb-asm/asm objectweb-asm/asm-commons plexus/classworlds plexus/utils jdom2/jdom2 commons-cli qdox plexus/cli %if %{with tests} -build-jar-repository -s lib hamcrest/core +build-jar-repository -s lib hamcrest/core xbean/xbean-reflect %endif %patch1 -p1