File tree Expand file tree Collapse file tree 2 files changed +7
-35
lines changed
src/main/java/org/codehaus/plexus/archiver/jar Expand file tree Collapse file tree 2 files changed +7
-35
lines changed Original file line number Diff line number Diff line change @@ -49,26 +49,22 @@ public static java.util.jar.Manifest getDefaultManifest()
4949 return defaultManifest ;
5050 }
5151
52- private static String getArchiverVersion ()
52+ static String getArchiverVersion ()
5353 {
54- String version = null ;
55-
5654 try
5755 {
5856 final Properties properties = PropertyUtils .loadProperties ( JdkManifestFactory .class .getResourceAsStream (
5957 "/META-INF/maven/org.codehaus.plexus/plexus-archiver/pom.properties" ) );
6058
61- if ( properties != null )
62- {
63- version = properties . getProperty ( "version" ) ;
64- }
59+ return properties != null
60+ ? properties . getProperty ( "version" )
61+ : null ;
62+
6563 }
6664 catch ( final IOException e )
6765 {
68- version = null ;
66+ throw new AssertionError ( e ) ;
6967 }
70-
71- return version ;
7268 }
7369
7470 public static void merge ( java .util .jar .Manifest target , java .util .jar .Manifest other , boolean overwriteMain )
Original file line number Diff line number Diff line change 3030import java .util .Hashtable ;
3131import java .util .Iterator ;
3232import java .util .Locale ;
33- import java .util .Properties ;
3433import java .util .StringTokenizer ;
3534import java .util .Vector ;
3635import java .util .jar .Attributes ;
3736
3837import org .codehaus .plexus .archiver .ArchiverException ;
39- import org .codehaus .plexus .util .PropertyUtils ;
4038
4139/**
4240 * Holds the data of a jar manifest.
@@ -740,7 +738,7 @@ public static Manifest getDefaultManifest()
740738
741739 String createdBy = "Plexus Archiver" ;
742740
743- final String plexusArchiverVersion = getArchiverVersion ();
741+ final String plexusArchiverVersion = JdkManifestFactory . getArchiverVersion ();
744742
745743 if ( plexusArchiverVersion != null )
746744 {
@@ -752,28 +750,6 @@ public static Manifest getDefaultManifest()
752750 return defaultManifest ;
753751 }
754752
755- private static String getArchiverVersion ()
756- {
757- String version = null ;
758-
759- try
760- {
761- final Properties properties = PropertyUtils .loadProperties ( JdkManifestFactory .class .getResourceAsStream (
762- "/META-INF/maven/org.codehaus.plexus/plexus-archiver/pom.properties" ) );
763-
764- if ( properties != null )
765- {
766- version = properties .getProperty ( "version" );
767- }
768- }
769- catch ( final IOException e )
770- {
771- version = null ;
772- }
773-
774- return version ;
775- }
776-
777753 /**
778754 * Construct an empty manifest
779755 */
You can’t perform that action at this time.
0 commit comments