@@ -86,7 +86,13 @@ public static NarProperties getInstance(final MavenProject project) throws MojoF
86
86
* the properties from input stream
87
87
*/
88
88
public static void inject (final MavenProject project , final InputStream properties ) throws MojoFailureException {
89
- final Properties defaults = PropertyUtils .loadProperties (properties );
89
+ Properties defaults ;
90
+ try {
91
+ defaults = PropertyUtils .loadProperties (properties );
92
+ } catch (IOException e ) {
93
+ // re-throw as a mojo failure
94
+ throw new MojoFailureException ("IOException loading properties" , e );
95
+ }
90
96
final NarProperties nar = getInstance (project );
91
97
nar .properties .putAll (defaults );
92
98
}
@@ -95,7 +101,13 @@ public static void inject(final MavenProject project, final InputStream properti
95
101
96
102
private NarProperties (final MavenProject project , File narFile , String customPropertyLocation ) throws MojoFailureException {
97
103
98
- final Properties defaults = PropertyUtils .loadProperties (NarUtil .class .getResourceAsStream (AOL_PROPERTIES ));
104
+ Properties defaults ;
105
+ try {
106
+ defaults = PropertyUtils .loadProperties (NarUtil .class .getResourceAsStream (AOL_PROPERTIES ));
107
+ } catch (IOException e ) {
108
+ // re-throw as a mojo failure
109
+ throw new MojoFailureException ("IOException loading properties" , e );
110
+ }
99
111
if (defaults == null ) {
100
112
throw new MojoFailureException ("NAR: Could not load default properties file: '" + AOL_PROPERTIES + "'." );
101
113
}
@@ -107,13 +119,14 @@ private NarProperties(final MavenProject project, File narFile, String customPro
107
119
fis = new FileInputStream (narFile );
108
120
this .properties .load (fis );
109
121
}
110
- } catch (final FileNotFoundException e ) {
122
+ } catch (FileNotFoundException e ) {
111
123
if (customPropertyLocation != null ) {
112
124
// We tried loading from a custom location - so throw the exception
113
125
throw new MojoFailureException ("NAR: Could not load custom properties file: '" + customPropertyLocation + "'." );
114
126
}
115
- } catch (final IOException e ) {
116
- // ignore (FIXME)
127
+ } catch (IOException e ) {
128
+ // re-throw as a mojo failure
129
+ throw new MojoFailureException ("IOException loading properties" , e );
117
130
} finally {
118
131
try {
119
132
if (fis != null ) {
0 commit comments