title: custom pom.xml filename in maven multimodule
body: <p>I have a maven3 multimodule project, and for a strange reason i need to customize POM filename for one of my child module (ie: module-pom.xml)</p>
  
  <p>Is it possible to configure this in the parent pom ?</p>
  
  <p>The strange reason is a bit long to explain sorry, but you will have the plain context.</p>
  
  <p><strong>Context</strong></p>
  
  <ul>
  <li><p>I'm working on a closed source project that also use LGPLed projects. this project is called <code>main</code></p></li>
  <li><p>I want <code>main</code> to declare modules of every projects, closed and opened. The full build should be made with a unique <code>mvn clean package</code> command.</p></li>
  <li><p>Inside the <code>main</code> reactor project, i have <code>lgpl-reactor</code> multimodule project containing 3 LGPL modules (API, Plugins and Distribution project). Some developper will have access to <code>lgpl-reactor</code> only, so i also want this project to build from its folder with <code>mvn clean package</code> command, like a fully standalone project.</p></li>
  <li><p>I also have <code>main-dist</code> project that is a maven-assembly-plugin only project (to build the distribution).</p></li>
  </ul>
  
  <p><strong>The problem</strong></p>
  
  <ul>
  <li><p>If I add parent reference to <code>lgpl-reactor</code> pom.xml, the global <code>main</code> build works perfectly, and assembly created by <code>main-dist</code> is valid, but the standalone build of lgpl-reactor fails (main pom.xml not found).</p></li>
  <li><p>If I remove parent reference from <code>lgpl-reactor</code> pom.xml, the standalone <code>lgpl-reactor</code> build works, but assembly created by <code>main-dist</code> is NOT valid (missing.</p></li>
  </ul>
  
  <p><strong>How to solve this ?</strong></p>
  
  <ul>
  <li><p>use another POM file <em>module-pom.xml</em> for <code>lgpl-reactor</code> module declaration inside <code>main</code> modules declaration list. When perfoming the full build from <code>main</code> project, <code>module-pom.xml</code> contains reference to parent POM and is working properly.</p></li>
  <li><p>use the default POM file <em>pom.xml</em> for standalon build of <code>lgpl-reactor</code>. This POM can hardly reference the parent pom with the <code>relativePath</code> property of <code>&lt;parent&gt;</code> tag</p></li>
  </ul>
  
  <p><em><strong>But HOW can i do that ? if possible ? Or is there any better solution ?</em></strong></p>
  
  <p><strong>Directory of the Main Reactor Project</strong></p>
  
  <pre><code>lgpl-lib [LGPL Library]
  lgpl-ext [LGPL Reactor Project]
  closed-core [Closed source module]
  closed-spring [Closed source module]
  closed-web [Closed source module]
  closed-webserver [Closed source module]
  main-dist [Main assembly module]
  pom.xml [Main Reactor POM]
  </code></pre>
  
  <p><strong>Directory of the LGPL Reactor Project</strong></p>
  
  <pre><code>lgpl-api [LGPL API module]
  lgpl-plugins [LGPL Plugins module]
  lgpl-ext-dist [LGPL assembly module]
  main-pom.xml [Main Reactor POM, copy of main pom.xml]
  pom.xml [Standalone LGPL Reactor POM]
  module-pom.xml [Module LGPL Reactor POM]
  </code></pre>
  
  <p><strong>Main Reactor POM</strong> (pom.xml &amp; lgpl-reactor/main-pom.xml)</p>
  
  <pre><code>    ...
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;main.group&lt;/groupId&gt;
      &lt;artifactId&gt;main&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;Main&lt;/name&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      ...
      &lt;modules&gt;
          &lt;module&gt;closed-core&lt;/module&gt;
          &lt;module&gt;closed-web&lt;/module&gt;
          &lt;module&gt;closed-webserver&lt;/module&gt;
          &lt;module&gt;closed-spring&lt;/module&gt;
          &lt;module&gt;lgpl-reactor&lt;/module&gt;
          &lt;module&gt;lgpl-lib&lt;/module&gt;
          &lt;module&gt;main-dist&lt;/module&gt;
      &lt;/modules&gt;
      ...
  </code></pre>
  
  <p><strong>lgpl-reactor/pom.xml</strong></p>
  
  <pre><code>...
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;artifactId&gt;lgpl-reactor&lt;/artifactId&gt;
  &lt;name&gt;LGPL Reactor&lt;/name&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;main.group&lt;/groupId&gt;
      &lt;artifactId&gt;main&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;relativePath&gt;main-pom.xml&lt;/relativePath&gt;
  &lt;/parent&gt;
  ...
      ...
  &lt;modules&gt;
      &lt;module&gt;lgpl-api&lt;/module&gt;
      &lt;module&gt;lgpl-plugins&lt;/module&gt;
      &lt;module&gt;lgpl-ext-dist&lt;/module&gt;
  &lt;/modules&gt;
      ...
  </code></pre>
  
  <p>pom.xml of <code>main-dist</code></p>
  
  <pre><code>&lt;project&gt;
      &lt;parent&gt;
          &lt;groupId&gt;main.group&lt;/groupId&gt;
          &lt;artifactId&gt;main&lt;/artifactId&gt;
          &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
      &lt;artifactId&gt;main-dist&lt;/artifactId&gt;
  
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
      &lt;description&gt;Main Distribution&lt;/description&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;plugins-assembly&lt;/id&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;single&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;descriptors&gt;
                                  &lt;descriptor&gt;assembly.xml&lt;/descriptor&gt;
                              &lt;/descriptors&gt;
                              &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;closed&lt;/groupId&gt;
              &lt;artifactId&gt;closed-webserver&lt;/artifactId&gt;
              &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;closed&lt;/groupId&gt;
              &lt;artifactId&gt;closed-api&lt;/artifactId&gt;
              &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>assembly.xml of <code>main-dist</code></p>
  
  <pre><code>&lt;assembly
      xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"&gt;
      &lt;id&gt;plugins-assembly&lt;/id&gt;
      &lt;formats&gt;
          &lt;format&gt;dir&lt;/format&gt;
          &lt;format&gt;zip&lt;/format&gt;
      &lt;/formats&gt;
      &lt;includeBaseDirectory&gt;false&lt;/includeBaseDirectory&gt;
  
      &lt;fileSets&gt;
          &lt;fileSet&gt;
              &lt;directory&gt;../closed-webserver/conf&lt;/directory&gt;
              &lt;outputDirectory&gt;conf&lt;/outputDirectory&gt;
          &lt;/fileSet&gt;
      &lt;/fileSets&gt;
  
      &lt;dependencySets&gt;
          &lt;dependencySet&gt;
              &lt;excludes&gt;&lt;exclude&gt;main.group:closed-webserver&lt;/exclude&gt;&lt;/excludes&gt;
              &lt;outputDirectory&gt;lib&lt;/outputDirectory&gt;
          &lt;/dependencySet&gt;
      &lt;/dependencySets&gt;
  
      &lt;moduleSets&gt;
          &lt;moduleSet&gt;
              &lt;useAllReactorProjects&gt;true&lt;/useAllReactorProjects&gt;
  
              &lt;includes&gt;
                  &lt;include&gt;main.group:closed-webserver&lt;/include&gt;
              &lt;/includes&gt;
  
              &lt;binaries&gt;
                  &lt;outputFileNameMapping&gt;${module.artifactId}${dashClassifier?}.${module.extension}&lt;/outputFileNameMapping&gt;
                  &lt;unpack&gt;false&lt;/unpack&gt;
                  &lt;includeDependencies&gt;false&lt;/includeDependencies&gt;
              &lt;/binaries&gt;
          &lt;/moduleSet&gt;
  
          &lt;moduleSet&gt;
              &lt;useAllReactorProjects&gt;true&lt;/useAllReactorProjects&gt;
  
              &lt;includes&gt;
                  &lt;include&gt;main.group:closed-spring&lt;/include&gt;
              &lt;/includes&gt;
  
              &lt;binaries&gt;
                  &lt;outputFileNameMapping&gt;${module.artifactId}${dashClassifier?}.${module.extension}&lt;/outputFileNameMapping&gt;
                  &lt;unpack&gt;false&lt;/unpack&gt;
                  &lt;includeDependencies&gt;false&lt;/includeDependencies&gt;
              &lt;/binaries&gt;
  
          &lt;/moduleSet&gt;
  
          &lt;moduleSet&gt;
              &lt;useAllReactorProjects&gt;true&lt;/useAllReactorProjects&gt;
  
              &lt;includes&gt;
                  &lt;include&gt;main.group:lgpl-ext-dist&lt;/include&gt;
              &lt;/includes&gt;
  
              &lt;binaries&gt;
                  &lt;outputDirectory&gt;plugins&lt;/outputDirectory&gt;
                  &lt;unpack&gt;false&lt;/unpack&gt;
                  &lt;includeDependencies&gt;true&lt;/includeDependencies&gt;
              &lt;/binaries&gt;
  
          &lt;/moduleSet&gt;
      &lt;/moduleSets&gt;
  
  &lt;/assembly&gt;
  </code></pre>