Maven Assembly: include a dependency with a different classifier

Posted by James Kingsbery on Stack Overflow See other posts from Stack Overflow or by James Kingsbery
Published on 2010-04-22T22:47:17Z Indexed on 2010/04/22 22:53 UTC
Read the original article Hit count: 216

I would like to build two different versions of a WAR in Maven (I know that's a no-no, that's just the way it is given the current situation). In the version of a WAR depicted by an assembly, I want to replace a dependency by the same dependency with a different classifier. For example, I was expecting this assembly to work:

<assembly>
  <id>end-user</id>
  <formats>
    <format>war</format>
  </formats>
  <dependencySets>
    <dependencySet>
      <excludes>
        <exclude>group:artifact:jar:${project.version}</exclude>
      </excludes>
      <includes>
        <include>group:artifact:jar:${project.version}:end-user</include>
      </includes>
    </dependencySet>
  </dependencySets>
</assembly>

This doesn't work, but am I heading in the right direction? I've already read all the pages on the Maven assembly page and the section on the Maven Definitive Guide that seems relevant. Any pointers would be helpful.

© Stack Overflow or respective owner

Related posts about maven

Related posts about maven-assembly-plugin