TINKERPOP-1493 Groovy project doesn't build on Windows Removed support for user.dir property as it was being prepended to a fully qualified path and the second drive letter was making the path illegal.
Made sure JarFile instances were being closed so that Groovy could delete the directory without encountering file locked errors. Exclude Unix scripts from RAT plugin Tinkergraph integration tests fail but can build when skipping integration tests. Hadoop fails either way. Could be environmental on my end. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/47da7536 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/47da7536 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/47da7536 Branch: refs/heads/TINKERPOP-1564 Commit: 47da7536a207610024d0497167ae7e800739d23b Parents: e97b56d Author: PaulJackson123 <pauljackson...@verizon.net> Authored: Wed Oct 12 22:41:17 2016 -0400 Committer: PaulJackson123 <pauljackson...@verizon.net> Committed: Wed Oct 12 22:41:17 2016 -0400 ---------------------------------------------------------------------- .../groovy/util/DependencyGrabber.groovy | 55 +++++++++++--------- .../util/DependencyGrabberIntegrateTest.java | 2 +- pom.xml | 2 + 3 files changed, 34 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47da7536/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy index 6b5242d..e7ab55b 100644 --- a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy +++ b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabber.groovy @@ -173,21 +173,24 @@ class DependencyGrabber { try { def pathToInstalled = extPath.resolve(artifact.artifact + "-" + artifact.version + ".jar") final JarFile jar = new JarFile(pathToInstalled.toFile()) - final Manifest manifest = jar.getManifest() - def attrLine = manifest.mainAttributes.getValue("Gremlin-Plugin-Dependencies") - def additionalDependencies = [] as Set<URI> - if (attrLine != null) { - def splitLine = attrLine.split(";") - splitLine.each { - def artifactBits = it.split(":") - def additional = new Artifact(artifactBits[0], artifactBits[1], artifactBits[2]) - - final def additionalDep = makeDepsMap(additional) - additionalDependencies.addAll(Grape.resolve([classLoader: this.classLoaderToUse], null, additionalDep)) + try { + final Manifest manifest = jar.getManifest() + def attrLine = manifest.mainAttributes.getValue("Gremlin-Plugin-Dependencies") + def additionalDependencies = [] as Set<URI> + if (attrLine != null) { + def splitLine = attrLine.split(";") + splitLine.each { + def artifactBits = it.split(":") + def additional = new Artifact(artifactBits[0], artifactBits[1], artifactBits[2]) + + final def additionalDep = makeDepsMap(additional) + additionalDependencies.addAll(Grape.resolve([classLoader: this.classLoaderToUse], null, additionalDep)) + } } + return additionalDependencies + } finally { + jar.close() } - - return additionalDependencies } catch (Exception ex) { throw new RuntimeException(ex) } @@ -196,19 +199,23 @@ class DependencyGrabber { private static alterPaths(final String manifestEntry, final Path extPath, final Artifact artifact) { try { def pathToInstalled = extPath.resolve(artifact.artifact + "-" + artifact.version + ".jar") - final JarFile jar = new JarFile(pathToInstalled.toFile()); - final Manifest manifest = jar.getManifest() - def attrLine = manifest.mainAttributes.getValue(manifestEntry) - if (attrLine != null) { - def splitLine = attrLine.split(";") - splitLine.each { - if (it.endsWith("=")) - Files.delete(extPath.resolve(it.substring(0, it.length() - 1))) - else { - def kv = it.split("=") - Files.move(extPath.resolve(kv[0]), extPath.resolve(kv[1]), StandardCopyOption.REPLACE_EXISTING) + final JarFile jar = new JarFile(pathToInstalled.toFile()) + try { + final Manifest manifest = jar.getManifest() + def attrLine = manifest.mainAttributes.getValue(manifestEntry) + if (attrLine != null) { + def splitLine = attrLine.split(";") + splitLine.each { + if (it.endsWith("=")) + Files.delete(extPath.resolve(it.substring(0, it.length() - 1))) + else { + def kv = it.split("=") + Files.move(extPath.resolve(kv[0]), extPath.resolve(kv[1]), StandardCopyOption.REPLACE_EXISTING) + } } } + } finally { + jar.close() } } catch (Exception ex) { throw new RuntimeException(ex) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47da7536/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabberIntegrateTest.java ---------------------------------------------------------------------- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabberIntegrateTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabberIntegrateTest.java index 7b3bba8..517ce8f 100644 --- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabberIntegrateTest.java +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/util/DependencyGrabberIntegrateTest.java @@ -33,7 +33,7 @@ import static org.junit.Assert.assertTrue; */ public class DependencyGrabberIntegrateTest { private static final GroovyClassLoader dummyClassLoader = new GroovyClassLoader(); - private static final File extTestDir = new File(System.getProperty("user.dir"), TestHelper.makeTestDataDirectory(DependencyGrabberIntegrateTest.class)); + private static final File extTestDir = TestHelper.makeTestDataPath(DependencyGrabberIntegrateTest.class); private static final DependencyGrabber dg = new DependencyGrabber(dummyClassLoader, extTestDir.getAbsolutePath()); @AfterClass http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47da7536/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index a09a8c2..e8e68ce 100644 --- a/pom.xml +++ b/pom.xml @@ -286,6 +286,8 @@ limitations under the License. <exclude>**/_bsp/**</exclude> <exclude>DEPENDENCIES</exclude> <exclude>**/.glv</exclude> + <exclude>bin/gremlin.sh</exclude> + <exclude>gremlin-console/bin/gremlin.sh</exclude> </excludes> <licenses> <license implementation="org.apache.rat.analysis.license.ApacheSoftwareLicense20"/>