NIFI-173 changed meta-inf/dependencies to meta-inf/bundled-dependencies

This commit is contained in:
joewitt 2014-12-16 10:38:59 -05:00
parent 3a4c6ed887
commit 8fb78d2a58
2 changed files with 11 additions and 8 deletions

View File

@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
* *
* <pre> * <pre>
* +META-INF/ * +META-INF/
* +-- dependencies/ * +-- bundled-dependencies/
* +-- &lt;JAR files&gt; * +-- &lt;JAR files&gt;
* +-- MANIFEST.MF * +-- MANIFEST.MF
* </pre> * </pre>
@ -186,9 +186,9 @@ public class NarClassLoader extends URLClassLoader {
private void updateClasspath(File root) throws IOException { private void updateClasspath(File root) throws IOException {
addURL(root.toURI().toURL()); // for compiled classes, META-INF/, etc. 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()) { 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()); addURL(dependencies.toURI().toURL());
if (dependencies.isDirectory()) { if (dependencies.isDirectory()) {
@ -200,9 +200,9 @@ public class NarClassLoader extends URLClassLoader {
@Override @Override
protected String findLibrary(final String libname) { 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()) { 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"); final File nativeDir = new File(dependencies, "native");

View File

@ -291,6 +291,9 @@ public class NarMojo extends AbstractMojo {
@Parameter(property = "overWriteIfNewer", required = false, defaultValue = "true") @Parameter(property = "overWriteIfNewer", required = false, defaultValue = "true")
protected boolean overWriteIfNewer; protected boolean overWriteIfNewer;
@Parameter( property = "projectBuildDirectory", required = false, defaultValue = "${project.build.directory}")
protected File projectBuildDirectory;
/** /**
* Used to look up Artifacts in the remote repository. * Used to look up Artifacts in the remote repository.
*/ */
@ -499,12 +502,12 @@ public class NarMojo extends AbstractMojo {
} }
private File getClassesDirectory() { private File getClassesDirectory() {
final File outputDirectory = new File(project.getBasedir(), "target"); final File outputDirectory = projectBuildDirectory;
return new File(outputDirectory, "classes"); return new File(outputDirectory, "classes");
} }
private File getDependenciesDirectory() { private File getDependenciesDirectory() {
return new File(getClassesDirectory(), "META-INF/dependencies"); return new File(getClassesDirectory(), "META-INF/bundled-dependencies");
} }
private void makeNar() throws MojoExecutionException { private void makeNar() throws MojoExecutionException {
@ -518,7 +521,7 @@ public class NarMojo extends AbstractMojo {
} }
public File createArchive() throws MojoExecutionException { public File createArchive() throws MojoExecutionException {
final File outputDirectory = new File(project.getBasedir(), "target"); final File outputDirectory = projectBuildDirectory;
File narFile = getNarFile(outputDirectory, finalName, classifier); File narFile = getNarFile(outputDirectory, finalName, classifier);
MavenArchiver archiver = new MavenArchiver(); MavenArchiver archiver = new MavenArchiver();
archiver.setArchiver(jarArchiver); archiver.setArchiver(jarArchiver);