Accepting request 978272 from Java:packages

Port out of deprecated plexus-cli classes

OBS-URL: https://build.opensuse.org/request/show/978272
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/plexus-containers?expand=0&rev=10
This commit is contained in:
Dominique Leuenberger 2022-05-20 15:51:11 +00:00 committed by Git OBS Bridge
commit 7988d441b5
4 changed files with 24 additions and 15 deletions

View File

@ -116,11 +116,12 @@ pushd %{comp_name}
%if %{without tests}
-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

View File

@ -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;
+ }
+

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri May 20 12:13:42 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- 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 <fstrba@suse.com>

View File

@ -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