Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7411

Artifact with dependencies to not pass transitive dependencies forward

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None

    Description

      Case:

      ProjectA needs to package ProjectB inside in an assembly. So ProjectA declares ProjectB as a dependency.
      ProjectB (type pom) produces a zip artifact, containing all needed dependencies inside.
      My issue is that, when declaring ProjectB as dependency of ProjectA, ProjectA receives all transitive dependencies of ProjectB.
      Is there a way to have ProjectB publish its zip artifact with a pom which has no dependencies? 

      I'm not after quick fixes (optional, exclude, provided, etc. they are not meant for this use case). I want to learn the proper way maven was intended to be used.
      One project has dependencies (for compilation, for packaging), but the artifact it produces should not declare dependencies for being used by another project, because it has all it needs.

      When a plugin attaches an artifact, it is attached to the same pom of the project producing it. What's the proper way to produce a "with dependencies" artifact which would not declare dependencies in the pom it installs in the maven repo, but has the dependencies in the pom which with it is built?

      Attachments

        Activity

          People

            Unassigned Unassigned
            ibilica Ionut Bilica
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: