Eclipse launches ANT twice, even sending a launch only once

In Netbeans, after some research, I managed to edit the build.xml file to set up the way to create the IDE of my banner and my manifest file. I had to transfer the project for Eclipse and even find an option for building a jar, but I need to create my own jar with some personalized information.

I added the build.xml file as the ANT build file to my project in eclipse, but when I submit it, eclipse runs twice, generating two jars files at once.

Follow my build.xml file:

<?xml version="1.0" encoding="UTF-8"?> <project name="GerOficios" default="makejar" basedir='.'> <target name="makejar"> <property file="version_info.properties" /> <property name="application.title" value="GerOficios_v6" /> <property name="main.class" value="com/dfmachado/geroficios/View/ListaDeOficiosUI" /> <buildnumber file="build.num" /> <property name="build.version.num" value="${version.number}.${build.number}" /> <tstamp> <format property="TODAY" pattern="dd/MM/yyyy - HH:mm:ss" /> </tstamp> <property name="store.jar.name" value="GerOficios ${build.version.num}" /> <property name="store.dir" value="store" /> <property name="store.jar" value="${store.dir}/${store.jar.name}.jar" /> <echo message="Packaging ${application.title} into a single JAR at ${store.jar}" /> <mkdir dir="${store.dir}" /> <jar destfile="${store.dir}/temp_final.jar" basedir="bin" filesetmanifest="skip"> <zipgroupfileset dir="lib" includes="*.jar" /> <manifest> <attribute name="Main-Class" value="${main.class}" /> <attribute name="SplashScreen-Image" value="com/dfmachado/geroficios/View/image/minerva.png" /> <attribute name="Build-OS" value="${os.name} version ${os.version} on ${os.arch}" /> <attribute name="Java-Version" value="${javac.source}" /> <attribute name="Implementation-Title" value="${application.title}" /> <attribute name="Implementation-Version" value="${build.version.num}" /> <attribute name="Built-By" value="${user.name}" /> <attribute name="Built-Date" value="${TODAY}" /> </manifest> </jar> <zip destfile="${store.jar}"> <zipfileset src="${store.dir}/temp_final.jar" excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA" /> </zip> <delete file="${store.dir}/temp_final.jar" /> </target> </project> 

Just to indicate that an eclipse generates a jar the way it is generated in netbeans, the problem is that ANT runs twice and generates 2 jars, even if I give the command only once, as shown in the figure below: / p>

enter image description here

Running ANT through the command line in the same project and only one file was created, apparently there was a problem in some configuration in eclipse, but I could not find it yet.

+5
source share
1 answer

ANT is a creator added to project builders. Please check it here:

Project → Right Click → Properties → Builders

You can keep it turned on in combination with the Eclipse workspace set to "build automatically" - this will trigger automatic builds.

Or you can deselect the builder from the list of builders and start it manually when necessary!

This SO Q + A is fast (further) read

+4
source

Source: https://habr.com/ru/post/1259835/


All Articles