This hack is workable in project with less dependencies only, for large project with many dependencies, it will cause Java class name conflict issue. – Alternatively, use maven-assembly-plugin to extract all dependency jars into raw classes, and group it together. – You can put both log4j.jar and jodatime.jar inside the final.jar, but your classes are unable to call other classes which is inside the unpack log4j.jar, Java jar is designed like this, unless you create a special class loader like one-jar plugin. Update the generated App.java with the following content :Ĥ.1. The following files and folder structure will be created.Ībove folder structure is not enough, create a log4j.properties file and put it in src/main/resources/log4j.properties, just create the resources folder manually. DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false $ mvn archetype:generate -DgroupId= -DartifactId=dateUtils In this tutorial, we will show you how to use Maven build tool, to create a single executable Jar, and how to deal with the project’s dependencies.Ĭreate a Java project from the Maven quick start template.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |