summaryrefslogtreecommitdiff
path: root/src/main/java/org/apache/maven/plugin/nar/NarInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/apache/maven/plugin/nar/NarInfo.java')
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/NarInfo.java30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/NarInfo.java b/src/main/java/org/apache/maven/plugin/nar/NarInfo.java
index 504d44e..9337ea3 100644
--- a/src/main/java/org/apache/maven/plugin/nar/NarInfo.java
+++ b/src/main/java/org/apache/maven/plugin/nar/NarInfo.java
@@ -48,6 +48,11 @@ public class NarInfo
public NarInfo( String groupId, String artifactId, String version, Log log ) throws MojoExecutionException
{
+ this( groupId, artifactId, version, log, null );
+ }
+
+ public NarInfo( String groupId, String artifactId, String version, Log log, File propertiesFile ) throws MojoExecutionException
+ {
this.groupId = groupId;
this.artifactId = artifactId;
this.version = version;
@@ -55,19 +60,20 @@ public class NarInfo
info = new Properties();
// Fill with general properties.nar file
- File propertiesDir = new File( "src/main/resources/META-INF/nar/" + groupId + "/" + artifactId );
- File propertiesFile = new File( propertiesDir, NarInfo.NAR_PROPERTIES );
- try
- {
- info.load( new FileInputStream( propertiesFile ) );
- }
- catch ( FileNotFoundException e )
- {
- // ignored
- }
- catch ( IOException e )
+ if( propertiesFile != null )
{
- throw new MojoExecutionException( "Problem loading "+propertiesFile, e );
+ try
+ {
+ info.load( new FileInputStream( propertiesFile ) );
+ }
+ catch ( FileNotFoundException e )
+ {
+ // ignored
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( "Problem loading "+propertiesFile, e );
+ }
}
}