Hey Leute,
ich versuch mich das erste mal an Apache Ant und scheitere beim erstellen einer ausführbaren Jar datei.
Also er erstellt zwar die Jar, aber die is 150kb groß, statt wie wenn IntelliJ es macht 7MB, die Jar funktioniert auch, mein Programm geht auf, aber irgendwie Funktionieren die Funktionen nicht.
Hier mal meine Build.xml
ich versuch mich das erste mal an Apache Ant und scheitere beim erstellen einer ausführbaren Jar datei.
Also er erstellt zwar die Jar, aber die is 150kb groß, statt wie wenn IntelliJ es macht 7MB, die Jar funktioniert auch, mein Programm geht auf, aber irgendwie Funktionieren die Funktionen nicht.
Hier mal meine Build.xml
Code:
<project xmlns:ivy="antlib:org.apache.ivy.ant"
name="transfer-mainline" default="main" basedir=".">
<description>
Build XML Validation for Okto-tranfser-mainline
</description>
<property name="projectName" value="XMLValidation" />
<property name="src.dir" location="src" />
<property name="build.dir" location="bin" />
<property name="dist.dir" location="dist" />
<property name="dist.lib.dir" location="dist/lib" />
<property name="lib.dir" value="C:\Users\xxxx\IdeaProjects\Libraries" />
<property name="main-class" value="net.oktopos.transfer.Main" />
<target name="init">
<mkdir dir="${build.dir}" />
</target>
<path id="classpath">
<fileset dir="${basedir}/">
<include name="${lib.dir}/*.jar" />
</fileset>
<pathelement location="${lib.dir}/commons-codec-1.6.jar" />
<pathelement location="${lib.dir}/commons-logging-1.1.3.jar" />
<pathelement location="${lib.dir}/fluent-hc-4.3.6.jar" />
<pathelement location="${lib.dir}/guava-18.0.jar" />
<pathelement location="${lib.dir}/hamcrest-all-1.3.jar" />
<pathelement location="${lib.dir}/httpclient-4.3.6.jar" />
<pathelement location="${lib.dir}/httpclient-cache-4.3.6.jar" />
<pathelement location="${lib.dir}/httpcore-4.3.3.jar" />
<pathelement location="${lib.dir}/httpmime-4.3.6.jar" />
<pathelement location="${lib.dir}/ini4j-0.5.2-SNAPSHOT.jar" />
<pathelement location="${lib.dir}/ini4j-0.5.2-SNAPSHOT-jdk14.jar" />
<pathelement location="${lib.dir}/jcalendar-1.4.jar" />
<pathelement location="${lib.dir}/jgoodies-common-1.2.0.jar" />
<pathelement location="${lib.dir}/jgoodies-looks-2.4.1.jar" />
<pathelement location="${lib.dir}/joda-time-2.4.jar" />
<pathelement location="${lib.dir}/json-simple-1.1.1.jar" />
<pathelement location="${lib.dir}/junit-4.6.jar" />
<pathelement location="${lib.dir}/junit-4.10.jar" />
<pathelement location="${lib.dir}/mockito-all-1.9.5.jar" />
</path>
<target name="compile" depends="init" description="compile the source ">
<echo message="${lib.dir}" />
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}" classpathref="classpath" />
</target>
<pathconvert property="classpath.name" pathsep=" ">
<path refid="classpath" />
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*.jar" to="lib/*.jar" />
</chainedmapper>
</mapper>
</pathconvert>
<target name="copy-dependencies">
<copy todir="${dist.lib.dir}">
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="**/*javadoc.jar" />
</copy>
</target>
<target name="jar" depends="compile, copy-dependencies" description="package, output to JAR">
<echo message="classpath.name : ${classpath.name} " />
<mkdir dir="${dist.dir}" />
<mkdir dir="${dist.lib.dir}" />
<jar jarfile="${dist.dir}/${projectName}.jar" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}" />
<attribute name="Class-Path" value="${classpath.name}" />
</manifest>
</jar>
</target>
<target name="clean" description="clean up">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<target name="main" depends="clean, compile, jar" />
</project>