summaryrefslogtreecommitdiff
path: root/src/main/java/org/apache/maven/plugin/nar/NarSystemMojo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/apache/maven/plugin/nar/NarSystemMojo.java')
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/NarSystemMojo.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/NarSystemMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarSystemMojo.java
index 13d4e18..57b3069 100644
--- a/src/main/java/org/apache/maven/plugin/nar/NarSystemMojo.java
+++ b/src/main/java/org/apache/maven/plugin/nar/NarSystemMojo.java
@@ -49,7 +49,7 @@ public class NarSystemMojo
// get packageName if specified for JNI.
String packageName = null;
String narSystemName = null;
- String narSystemDirectory = null;
+ File narSystemDirectory = null;
boolean jniFound = false;
for ( Iterator i = getLibraries().iterator(); !jniFound && i.hasNext(); )
{
@@ -58,7 +58,7 @@ public class NarSystemMojo
{
packageName = library.getNarSystemPackage();
narSystemName = library.getNarSystemName();
- narSystemDirectory = library.getNarSystemDirectory();
+ narSystemDirectory = new File(getTargetDirectory(), library.getNarSystemDirectory());
jniFound = true;
}
}
@@ -66,14 +66,12 @@ public class NarSystemMojo
if ( !jniFound || packageName == null)
return;
- File narSystemTarget = new File(getMavenProject().getBasedir(), narSystemDirectory);
-
// make sure destination is there
- narSystemTarget.mkdirs();
+ narSystemDirectory.mkdirs();
- getMavenProject().addCompileSourceRoot( narSystemTarget.getPath() );
+ getMavenProject().addCompileSourceRoot( narSystemDirectory.getPath() );
- File fullDir = new File( narSystemTarget, packageName.replace( '.', '/' ) );
+ File fullDir = new File( narSystemDirectory, packageName.replace( '.', '/' ) );
fullDir.mkdirs();
File narSystem = new File( fullDir, narSystemName + ".java" );