Ant continues to add the wrong jar file to the classpath even after I've changed it

31 Views Asked by At

I have a desktop java app, that runs perfectly in the IDE, but won't run as a stand-alone application. The problem I am having is that I'm upgrading to MYSQL 8 from 5.1. To complicate matters for myself I'm also using JDeveloper now instead of NetBeans. So I'm under a huge learning curve. However the problem is that when I run my ant script against my java files, it uses the old mysql-connector jar file instead of the newer one I've put into the library list. It builds the manifest.mf file with the outdated connector and nothing I've done seems to fix that. I need some guidance.

enter image description here

So the library at the top is the MYSQL connector I want to use. this picture has the definition of the jar file. enter image description here

Here is the Manifest.mf file created by the ANT script, I've highlighted the mysql-connector jar file that it uses, instead of the one I've previously set up in the library.

enter image description here

Here it the copylibs section of the ANT build script.

    <target name="-init-macrodef-copylibs">
        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
            <attribute default="${manifest.file}" name="manifest"/>
            <element name="customize" optional="true"/>
            <sequential>
                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
                <pathconvert property="run.classpath.without.build.classes.dir">
                    <path path="${run.classpath}"/>
                    <map from="${build.classes.dir.resolved}" to=""/>
                </pathconvert>
                <pathconvert pathsep=" " property="jar.classpath">
                    <path path="${run.classpath.without.build.classes.dir}"/>
                    <chainedmapper>
                        <flattenmapper/>
                        <filtermapper>
                            <replacestring from=" " to="%20"/>
                        </filtermapper>
                        <globmapper from="*" to="lib/*"/>
                    </chainedmapper>
                </pathconvert>
                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" manifestencoding="UTF-8" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
                    <manifest>
                        <attribute name="Class-Path" value="${jar.classpath}"/>
                        <customize/>
                    </manifest>
                </copylibs>
            </sequential>
        </macrodef>
    </target>

0

There are 0 best solutions below