nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marka...@apache.org
Subject [5/9] incubator-nifi git commit: NIFIDEV-145: Bug fixes and pulled bootstrap into the assembly pom
Date Wed, 10 Dec 2014 16:09:19 GMT
NIFIDEV-145: Bug fixes and pulled bootstrap into the assembly pom


Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/e544191f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/e544191f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/e544191f

Branch: refs/heads/develop
Commit: e544191f1d59dbaf9aec6e1bd708bbe013c6661a
Parents: eed4a9b
Author: Mark Payne <markap14@hotmail.com>
Authored: Tue Dec 9 14:37:31 2014 -0500
Committer: Mark Payne <markap14@hotmail.com>
Committed: Tue Dec 9 14:37:31 2014 -0500

----------------------------------------------------------------------
 assemblies/nifi/pom.xml                         |  5 +++++
 .../java/org/apache/nifi/bootstrap/RunNiFi.java | 22 +++++++++++---------
 2 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e544191f/assemblies/nifi/pom.xml
----------------------------------------------------------------------
diff --git a/assemblies/nifi/pom.xml b/assemblies/nifi/pom.xml
index ec06a23..556b8fe 100644
--- a/assemblies/nifi/pom.xml
+++ b/assemblies/nifi/pom.xml
@@ -120,6 +120,11 @@
             <version>${framework.version}</version>
         </dependency>
         <dependency>
+        	<groupId>org.apache.nifi</groupId>
+        	<artifactId>nifi-bootstrap</artifactId>
+        	<version>0.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.nifi</groupId>
             <artifactId>nifi-resources</artifactId>
             <version>${framework.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e544191f/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
----------------------------------------------------------------------
diff --git a/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java b/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
index ea3e566..54932c8 100644
--- a/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
+++ b/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
@@ -30,7 +30,6 @@ import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
-import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -250,7 +249,13 @@ public class RunNiFi {
 			builder.directory(new File(specifiedWorkingDir));
 		}
 
-		final File workingDir = builder.directory();
+		final File bootstrapConfigAbsoluteFile = bootstrapConfigFile.getAbsoluteFile();
+		final File binDir = bootstrapConfigAbsoluteFile.getParentFile();
+		final File workingDir = binDir.getParentFile();
+		
+		if ( specifiedWorkingDir == null ) {
+			builder.directory(workingDir);
+		}
 		
 		final String libFilename = replaceNull(props.get("lib.dir"), "./lib").trim();
 		File libDir = getFile(libFilename, workingDir);
@@ -295,13 +300,10 @@ public class RunNiFi {
 			throw new RuntimeException("Could not find conf directory at " + confDir.getAbsolutePath());
 		}
 
-		final Path workingDirPath = workingDir.toPath();
 		final List<String> cpFiles = new ArrayList<>(confFiles.length + libFiles.length);
 		cpFiles.add(confDir.getAbsolutePath());
 		for ( final File file : libFiles ) {
-			final Path path = workingDirPath.relativize(file.toPath());
-			final String cpPath = path.toString();
-			cpFiles.add(cpPath);
+			cpFiles.add(file.getAbsolutePath());
 		}
 		
 		final StringBuilder classPathBuilder = new StringBuilder();
@@ -380,12 +382,12 @@ public class RunNiFi {
 	}
 	
 	private File getFile(final String filename, final File workingDir) {
-		File libDir = new File(filename);
-		if ( !libDir.isAbsolute() ) {
-			libDir = new File(workingDir, filename);
+		File file = new File(filename);
+		if ( !file.isAbsolute() ) {
+			file = new File(workingDir, filename);
 		}
 		
-		return libDir;
+		return file;
 	}
 	
 	private String replaceNull(final String value, final String replacement) {


Mime
View raw message