• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Maven | maven-source-plugin
  1. Maven Source Plugin (3.2.1)
  2. The goal help
  3. Example: Using source plugin

  1. Maven Source Plugin (3.2.1)
    Creates a JAR archive of the source files of the current project.

    Plugin coordinates:
    • Group Id: org.apache.maven.plugins
    • Artifact Id: maven-source-plugin

    Plugin Prefix: source

    The source plugin has the following goals:
    • help: Display help information on maven-source-plugin.

    • jar: This plugin bundles all the sources into a jar archive.

    • test-jar: This plugin bundles all the test sources into a jar archive.

    • jar-no-fork: This goal bundles all the sources into a jar archive. This goal does not fork the build and is suitable for attaching to the build lifecycle.

    • test-jar-no-fork: This goal bundles all the test sources into a jar archive. This goal functions does not fork the build, and is suitable for attaching to the build lifecycle.

    • aggregate: Aggregate sources for all modules in an aggregator project.

    • generated-test-jar: This plugin bundles all the test sources into a jar archive.
  2. The goal help
    The goal help gives general information about the source plugin and lists its goals.
    The parameter detail gives detailed information about the parameters of the goals of the source plugin.

    If you need to use the plugin's coordinates instead of its prefix, you can do that as following:

    You can also use the goal describe of the help plugin to get information about the source plugin and lists its goals:

    The parameter goal gives information about a goal of the source plugin:
  3. Example: Using source goals in the project POM file
    Adjust your pom file with the following:
© 2025  mtitek