ddusnoki / jvmtop

Automatically exported from code.google.com/p/jvmtop
0 stars 0 forks source link

ant dist fails because dist directory is not created #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I just cloned the git repo and executed ant dist, which fails with the message:

/home/foo/tmp/jvmtop-git/jvmtop/jvmtop/build.xml:42: Problem creating jar: 
/home/foo/tmp/jvmtop-git/jvmtop/jvmtop/dist/jvmtop.jar (No such file or 
directory) (and the archive is probably corrupt but I could not delete it)

The problem is that the jvmtop/dist directory doesn't exist. The bit about the 
corrupt archive is spurious.

Here's a patch to create the directory. After this change, I find that ant dist 
runs to completion successfully.

$ git diff
diff --git a/jvmtop/build.xml b/jvmtop/build.xml
index 18dc6e4..6417c8e 100644
--- a/jvmtop/build.xml
+++ b/jvmtop/build.xml
@@ -36,6 +36,7 @@
   <target name="dist" depends="compile"
         description="generate the distribution" >
     <!-- Create the distribution directory -->
+    <mkdir dir="${dist}"/>

     <delete file="${dist}/jvmtop.jar" />

$ echo $JAVA_HOME
/usr/lib/jvm/java-1.6.0-openjdk.x86_64

$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.3) (rhel-1.48.1.11.3.el6_2-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Original issue reported on code.google.com by robert.d...@gmail.com on 13 Sep 2013 at 1:56

GoogleCodeExporter commented 9 years ago
Incidentally:

$ ant -version
Apache Ant version 1.7.1 compiled on April 26 2010

Original comment by robert.d...@gmail.com on 13 Sep 2013 at 2:27

GoogleCodeExporter commented 9 years ago
You're right, but this applies only to ant 1.7.x and earlier.
Since ant 1.8.x, the output directories of a <jar> task are created 
automatically.

(see https://issues.apache.org/bugzilla/show_bug.cgi?id=45377 )

But nevertheless, I'll apply your patch to prevent other users from "aged" ant 
versions falling into this pit.

Original comment by patric.r...@gmail.com on 17 Sep 2013 at 4:03

GoogleCodeExporter commented 9 years ago

Original comment by patric.r...@gmail.com on 5 Dec 2013 at 10:21