When cleaning and building the project with the build.xml file configured in this way, the construction occurs correctly, generating the dist folder, with the lib folder and the respective libraries inside.
<?xml version="1.0" encoding="UTF-8"?>
<project name="EletronicStoreFX" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>Builds, tests, and runs the project EletronicStoreFX.</description>
<import file="nbproject/build-impl.xml"/>
</project>
According to this Tutorial, I'm trying to generate a .jar of the project with the libraries included, so my build.xml was configured this way.
<?xml version="1.0" encoding="UTF-8"?>
<project name="EletronicStoreFX" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>Builds, tests, and runs the project EletronicStoreFX.</description>
<import file="nbproject/build-impl.xml"/>
<target name="-post-jar">
<property name="store.jar.name" value="Eletronic_Storesc"/>
<property name="store.dir" value="store"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging ${store.jar.name} into a single JAR at ${store.jar}"/>
<delete dir="${store.dir}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
<zipgroupfileset dir="dist" includes="*.jar"/>
<zipgroupfileset dir="dist/lib" includes="*.jar"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</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>
However, when cleaning and building so that the .jar is generated, it crashes.
ant -f C:\\Users\\Giovani\\Documents\\NetBeansProjects\\EletronicStoreFX jfx-rebuild
init:
deps-clean:
Updating property file: C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build\built-clean.properties
Deleting directory C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build
clean:
init:
deps-jar:
Created dir: C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build
Updating property file: C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build\built-jar.properties
Created dir: C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build\classes
Created dir: C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build\empty
Created dir: C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build\generated-sources\ap-source-output
Compiling 97 source files to C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build\classes
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Copying 87 files to C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build\classes
Copied 3 empty directories to 1 empty directory under C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build\classes
compile:
Created dir: C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\dist
Packaging Eletronic_Storesc into a single JAR at store/Eletronic_Storesc.jar
Deleting directory C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\store
Created dir: C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\store
C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\nbproject\jfx-impl.xml:3479: The following error occurred while executing this line:
C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\build.xml:13: C:\Users\Giovani\Documents\NetBeansProjects\EletronicStoreFX\dist\lib does not exist.
FALHA NA CONSTRUÇÃO (tempo total: 2 segundos)
Analyzing line 3479 of the error, we land on this line of code from the jfx-impl.xml file:
<target name="-jfx-do-jar" depends="-check-do-jar" unless="do-jar-false">
<antcall target="jar"/>
</target>
From what I've seen, at the moment the .JAR is being created, the lib folder is still not present in the project, does anyone know how to adjust it?