You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Daniel Fernández (Jira)" <ji...@apache.org> on 2022/07/04 23:32:00 UTC

[jira] [Commented] (MASSEMBLY-907) Dependencies are not included when run with mvn install

    [ https://issues.apache.org/jira/browse/MASSEMBLY-907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17562298#comment-17562298 ] 

Daniel Fernández commented on MASSEMBLY-907:
--------------------------------------------

I can confirm as of version 3.4.0 of the plugin this not only happens when doing "{{mvn install}}" but also with "{{mvn deploy}}", which heavily affects my build process. I don't have the involved _failing_ modules included as dependencies in the {{pom.xml}} of the assembly module.

I would disagree that having to add all involved first level modules to the {{pom.xml}} of the assembly project as explained in the first comment in this ticket makes sense, for four reasons IMHO:

*First*, because in my case I'm using a {{<moduleSet>}} with {{<useAllReactorProjects>true</useAllReactorProjects>}}, so I should expect all reactor modules to be processed with their dependencies without needing to add all my large number of reactor modules one by one to the {{pom.xml}}. That would turn assembly maintenance really complex (we are talking dozens of modules at several levels).

*Second*, because all the modules are actually being processed, *but not their dependencies*, which is IMHO unexpected anywhere in Maven unless specifically configured to do otherwise. If the issue was with dependencies not being added to the {{pom.xml}}, it would be more coherent not process these dependencies (reactor modules) at all, instead of processing them, but not their dependencies.

*Third*, because the fact that this works as expected (by me) when doing "{{mvn package}}" but not "{{mvn deploy}}" is not a coherent behaviour.

*Fourth*, because processing of modules in the reactor *and* their transitive dependencies worked as expected (by me) until 3.1.1, when behaviour changed. So this broke many builds.

This is what my {{<moduleSet>}} looks like:

{code:xml}
  <moduleSets>

    <moduleSet>
      <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>org.thymeleaf:*</include>
      </includes>
      <binaries>
        <outputDirectory>/dist</outputDirectory>
        <unpack>false</unpack>
        <dependencySets>
          <dependencySet>
            <outputDirectory>/lib</outputDirectory>
            <scope>runtime</scope>
            <excludes>
              <exclude>org.thymeleaf:*</exclude>
            </excludes>
          </dependencySet>
        </dependencySets>
      </binaries>
    </moduleSet>

    ...

  </moduleSets>
{code}

> Dependencies are not included when run with mvn install
> -------------------------------------------------------
>
>                 Key: MASSEMBLY-907
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-907
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 3.1.1
>            Reporter: Lau Bakman
>            Priority: Major
>         Attachments: 310_install.log, 310_install_verbose.log, 311_install.log, 311_install_verbose.log, 311_package_verbose.log, assembly_deps.zip
>
>
> We have just updated to version 3.1.1 due to MASSEMBLY-873 and have stumbled upon a problem.
> Our project is structured similar to the attached project. When we build our project using "mvn clean package" the project is assembled correctly including dependencies. If we on the other hand build our project using "mvn clean install", only the top level jar files are assembled and all dependencies are missing.
> This worked in version 3.1.0.
> Is this by design? And if it is, is there a way to revert to the old behavior?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)