diff --git a/nar-bundles/framework-bundle/framework/nar/src/main/java/org/apache/nifi/nar/NarClassLoader.java b/nar-bundles/framework-bundle/framework/nar/src/main/java/org/apache/nifi/nar/NarClassLoader.java index b3b7e7f9c7..946c26ef99 100644 --- a/nar-bundles/framework-bundle/framework/nar/src/main/java/org/apache/nifi/nar/NarClassLoader.java +++ b/nar-bundles/framework-bundle/framework/nar/src/main/java/org/apache/nifi/nar/NarClassLoader.java @@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory; * *
  *	+META-INF/
- *	+-- dependencies/
+ *	+-- bundled-dependencies/
  *	    +-- <JAR files>
  *	+-- MANIFEST.MF
  * 
@@ -186,9 +186,9 @@ public class NarClassLoader extends URLClassLoader { private void updateClasspath(File root) throws IOException { addURL(root.toURI().toURL()); // for compiled classes, META-INF/, etc. - File dependencies = new File(root, "META-INF/dependencies"); + File dependencies = new File(root, "META-INF/bundled-dependencies"); if (!dependencies.isDirectory()) { - LOGGER.warn(narWorkingDirectory + " does not contain META-INF/dependencies!"); + LOGGER.warn(narWorkingDirectory + " does not contain META-INF/bundled-dependencies!"); } addURL(dependencies.toURI().toURL()); if (dependencies.isDirectory()) { @@ -200,9 +200,9 @@ public class NarClassLoader extends URLClassLoader { @Override protected String findLibrary(final String libname) { - File dependencies = new File(narWorkingDirectory, "META-INF/dependencies"); + File dependencies = new File(narWorkingDirectory, "META-INF/bundled-dependencies"); if (!dependencies.isDirectory()) { - LOGGER.warn(narWorkingDirectory + " does not contain META-INF/dependencies!"); + LOGGER.warn(narWorkingDirectory + " does not contain META-INF/bundled-dependencies!"); } final File nativeDir = new File(dependencies, "native"); diff --git a/nar-maven-plugin/src/main/java/nifi/NarMojo.java b/nar-maven-plugin/src/main/java/nifi/NarMojo.java index 5196f73555..9b70ec00cf 100644 --- a/nar-maven-plugin/src/main/java/nifi/NarMojo.java +++ b/nar-maven-plugin/src/main/java/nifi/NarMojo.java @@ -290,6 +290,9 @@ public class NarMojo extends AbstractMojo { */ @Parameter(property = "overWriteIfNewer", required = false, defaultValue = "true") protected boolean overWriteIfNewer; + + @Parameter( property = "projectBuildDirectory", required = false, defaultValue = "${project.build.directory}") + protected File projectBuildDirectory; /** * Used to look up Artifacts in the remote repository. @@ -499,12 +502,12 @@ public class NarMojo extends AbstractMojo { } private File getClassesDirectory() { - final File outputDirectory = new File(project.getBasedir(), "target"); + final File outputDirectory = projectBuildDirectory; return new File(outputDirectory, "classes"); } private File getDependenciesDirectory() { - return new File(getClassesDirectory(), "META-INF/dependencies"); + return new File(getClassesDirectory(), "META-INF/bundled-dependencies"); } private void makeNar() throws MojoExecutionException { @@ -518,7 +521,7 @@ public class NarMojo extends AbstractMojo { } public File createArchive() throws MojoExecutionException { - final File outputDirectory = new File(project.getBasedir(), "target"); + final File outputDirectory = projectBuildDirectory; File narFile = getNarFile(outputDirectory, finalName, classifier); MavenArchiver archiver = new MavenArchiver(); archiver.setArchiver(jarArchiver);