Snippet Maven

With snippet Maven, you can free your mind

  1. Create a Jar with Dependencies using


    and you run it with


  2. Create a Jar with Dependencies using


    and you run it with


    Compile goal should be added before

    or otherwise the code on your own project is not included.

    Commonly this goal is tied to a build phase to execute automatically. This ensures the JAR is built when executing

    or performing a deployment/release.


  3. Create a Jar with Dependencies using

    You can use the dependency-plugin to generate all dependencies in a separate directory before the package phase and then include that in the classpath of the manifest:


    Alternatively use “${project.build.directory}/classes/lib” as OutputDirectory to integrate all jar-files into the main jar, but then you will need to add custom classloading code to load the jars.

  4. Delete additional directories and files using

    The Maven Clean Plugin will delete the

    directory by default. You may configure it to delete additional directories and files.


    Note: The directory in the fileset is a relative path inside a project, in other words


    is equivalent to:


  5. Set UTF-8 for project when build


  6. Compiler exclude the specified packages and their subpackages


Leave a Reply

Your email address will not be published. Required fields are marked *