File tree 2 files changed +7
-35
lines changed
src/main/java/org/codehaus/plexus/archiver/jar
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()
49
49
return defaultManifest ;
50
50
}
51
51
52
- private static String getArchiverVersion ()
52
+ static String getArchiverVersion ()
53
53
{
54
- String version = null ;
55
-
56
54
try
57
55
{
58
56
final Properties properties = PropertyUtils .loadProperties ( JdkManifestFactory .class .getResourceAsStream (
59
57
"/META-INF/maven/org.codehaus.plexus/plexus-archiver/pom.properties" ) );
60
58
61
- if ( properties != null )
62
- {
63
- version = properties . getProperty ( "version" ) ;
64
- }
59
+ return properties != null
60
+ ? properties . getProperty ( "version" )
61
+ : null ;
62
+
65
63
}
66
64
catch ( final IOException e )
67
65
{
68
- version = null ;
66
+ throw new AssertionError ( e ) ;
69
67
}
70
-
71
- return version ;
72
68
}
73
69
74
70
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 30
30
import java .util .Hashtable ;
31
31
import java .util .Iterator ;
32
32
import java .util .Locale ;
33
- import java .util .Properties ;
34
33
import java .util .StringTokenizer ;
35
34
import java .util .Vector ;
36
35
import java .util .jar .Attributes ;
37
36
38
37
import org .codehaus .plexus .archiver .ArchiverException ;
39
- import org .codehaus .plexus .util .PropertyUtils ;
40
38
41
39
/**
42
40
* Holds the data of a jar manifest.
@@ -740,7 +738,7 @@ public static Manifest getDefaultManifest()
740
738
741
739
String createdBy = "Plexus Archiver" ;
742
740
743
- final String plexusArchiverVersion = getArchiverVersion ();
741
+ final String plexusArchiverVersion = JdkManifestFactory . getArchiverVersion ();
744
742
745
743
if ( plexusArchiverVersion != null )
746
744
{
@@ -752,28 +750,6 @@ public static Manifest getDefaultManifest()
752
750
return defaultManifest ;
753
751
}
754
752
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
-
777
753
/**
778
754
* Construct an empty manifest
779
755
*/
You can’t perform that action at this time.
0 commit comments