Answers for "how to add jar file in java file"

1

put jar file in maven

mvn install:install-file \
   -Dfile=<path-to-file> \
   -DgroupId=<group-id> \
   -DartifactId=<artifact-id> \
   -Dversion=<version> \
   -Dpackaging=<packaging> \
   -DgeneratePom=true
Posted by: Guest on April-16-2021
0

add external jar file while building project

<target name="-post-jar">
  <jar jarfile="dist/Combined-dist.jar">
    <zipfileset src="${dist.jar}" excludes="META-INF/*" />
    <zipfileset src="lib/commons-io-1.4.jar" excludes="META-INF/*" />
    <zipfileset src="lib/ninja-utils-3.2.jar" excludes="META-INF/*" />
    <zipfileset src="lib/unicorn-1.0.jar" excludes="META-INF/*" />
    <manifest>
        <attribute name="Main-Class" value="com.example.mypackage.Main"/>
    </manifest>
  </jar>
</target>
Posted by: Guest on June-20-2021

Code answers related to "how to add jar file in java file"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language