I want to make a fat JAR that contains the project classes and jdbc jar file.
I saw this code to added to xml file before </project> tag.
 <target name="-post-jar">
 <property name="store.jar.name" value="AllInOneJar"/>
 <property name="store.dir" value="dist"/>
 <property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
5 <echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
 <jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
 <zipgroupfileset dir="dist" includes="*.jar"/>
 <zipgroupfileset dir="dist/lib" includes="*.jar"/>
9 <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>
When i Paste it I get this error : Malformed POM unrecognised tag 'target' How to solve it in netbeans please.
This is the whole POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany</groupId>
    <artifactId>lib_Management</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.27</version>
        </dependency>
<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>9.4.0.jre11</version>
</dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.8.4</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <id>assemble-all</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
</project>

 
    