Bug #11849 small issues: wrong manifest location, no log4j, missing dir
Submitted: 10 Jul 2005 18:57 Modified: 10 Jul 2005 21:39
Reporter: Thomas Matthijs Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:3.1.10 OS:Linux (linux)
Assigned to: Mark Matthews CPU Architecture:Any

[10 Jul 2005 18:57] Thomas Matthijs
Description:
While trying to build mysql-connector-java-3.1.10 from the included sources i noticed some issues
1) You can't compile without log4j however everything in the build.xml suggest you can

2) The manifest location in the build.xml is wrong
${buildDir}/MANIFEST.MF instead of ${buildDir}/META-INF/MANIFEST.MF
 
3) totaly non-issue but hey while i'm here
ant dies instantly complaining about missing src/lib-nodist dir

How to repeat:
See description

Suggested fix:
1)
--- src/com/mysql/jdbc/ConnectionProperties.java.orig   2005-07-10 20:42:46.000000000 +0200
+++ src/com/mysql/jdbc/ConnectionProperties.java        2005-07-10 20:43:16.000000000 +0200
@@ -26,7 +26,6 @@
 
 import com.mysql.jdbc.log.Jdk14Logger;
 import com.mysql.jdbc.log.Log;
-import com.mysql.jdbc.log.Log4JLogger;
 import com.mysql.jdbc.log.StandardLogger;
 
 import java.io.UnsupportedEncodingException;
@@ -2392,7 +2391,7 @@
                                try {
                                        // Is Log4J available?
                                        Class.forName("org.apache.log4j.Level");
-                                       setLogger(Log4JLogger.class.getName());
+                                       setLogger("org.apache.log4j.Level");
                                } catch (Throwable t) {
                                        try {
                                                // Are we running on JDK-1.4?

2) 

--- build.xml       2005-06-23 01:29:13.000000000 +0200
+++ build.xml       2005-07-10 20:45:34.000000000 +0200
@@ -253,7 +253,7 @@
                        includes="**/*.class,**/*.properties*,COPYING,README" 
                        excludes="testsuite/**" 
                        index="true" 
-                       manifest="${buildDir}/MANIFEST.MF"/>
+                       manifest="${buildDir}/META-INF/MANIFEST.MF"/>
        </target>
 
        <target name="dist-trace" depends="init, compile-driver-trace">
@@ -264,7 +264,7 @@
                <mkdir dir="${distDir}" />
 
 
-               <manifest file="${buildDir}/MANIFEST.MF">
+               <manifest file="${buildDir}/META-INF/MANIFEST.MF">
                        <attribute name="Built-By" value="${user.name}" />
 
                        <section name="common">
@@ -282,7 +282,7 @@
                                includes="**/*.class,**/*.properties*,COPYING,README"
                                excludes="testsuite/**"
                                index="true"
-                               manifest="${buildDir}/MANIFEST.MF"
+                               manifest="${buildDir}/META-INF/MANIFEST.MF"
                        />
        </target>
 
3) maybe some mkdir's in init target
[10 Jul 2005 19:02] Thomas Matthijs
Oeps with 
Setlogger("com.mysql.jdbc.log.Log4JLogger");
offcourse
[10 Jul 2005 21:39] Mark Matthews
Check out the nightly build of 3.1 from http://downloads.mysql.com/snapshots.php

All of the issues, sans the last one should be taken care of. The reason the build file complains about lib-nodist is that the .jar files in there aren't redistributable (mainly junit) with our licensing as far as I can tell. If you put junit somewhere in your CLASSPATH the driver should build. Of course, if you just use the "compile-driver" target, junit will never be referenced, as the testsuite isn't compiled with this target.
[12 Sep 2005 19:39] Troy Davis
I've been trying to recompile with taget compile-driver, but it's still complaining about not finding lib-nodist. I've added junit to my classpath as well, no effect. What other libs do I need to compile the driver?
[12 Sep 2005 19:52] Mark Matthews
I'll have to write up a document that shows how to build from source.

We haven't historically distributed a couple of the libraries needed to compile the _full_ package because of license incompatibilites...namely junit.jar and log4j.jar...I'll look into why doing just "compile-driver" seems to require these, it shouldn't.