title: Tycho pomless - Configure / prevent plugin execution for individual modules / parent project
body: <p>I recently started to get my head around using Tycho to build Eclipse plugins with Maven. Currently, I use the Tycho pom-less extension and a single parent POM to configure the build.</p>
  <p>Now I realized, the plugins configured in the parent POM are not only executed during the build of the individual modules but are also executed in the context of the parent project (defined by the parent POM) itself.</p>
  <p>The build section of the parent pom of a MWE using <code>xtend-maven-plugin</code>:</p>
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;           
          &lt;plugin&gt;
              &lt;groupId&gt;org.eclipse.xtend&lt;/groupId&gt;
              &lt;artifactId&gt;xtend-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${xtext.version}&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;compile&lt;/goal&gt;            
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;src/main/xtend-gen&lt;/outputDirectory&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
                      
          &lt;plugin&gt;
              &lt;groupId&gt;org.eclipse.tycho&lt;/groupId&gt;
              &lt;artifactId&gt;tycho-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${tycho.version}&lt;/version&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;      
  &lt;/build&gt;
  </code></pre>
  <p>The respective <code>mvn compile</code> output (relevant INFO parts marked as tags):</p>
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] Reactor Build Order:
  [INFO]
  [INFO] parent-project                                                     [pom]
  [INFO] [bundle] TestTycho                                      [eclipse-plugin]
  [INFO]
  [INFO] -----------------------&lt; POMless:parent-project &gt;-----------------------
  [INFO] Building parent-project 0.0.1-SNAPSHOT                             [1/2]
  [INFO] --------------------------------[ pom ]---------------------------------
  [INFO]
  &lt;[INFO]&gt; --- xtend-maven-plugin:2.23.0:compile (default) @ parent-project ---
  &lt;[INFO]&gt; skip compiling sources because the configured directory '[D:\ParentProjectPomless\src\main\java]' does not exist.
  [INFO]
  [INFO] -------------------------&lt; POMless:TestTycho &gt;--------------------------
  [INFO] Building [bundle] TestTycho 1.0.0-SNAPSHOT                         [2/2]
  [INFO] ---------------------------[ eclipse-plugin ]---------------------------
  [INFO]
  [INFO] --- tycho-packaging-plugin:2.0.0:build-qualifier (default-build-qualifier) @ TestTycho ---
  [INFO] The project's OSGi version is 1.0.0.202009290827
  [INFO]
  [INFO] --- tycho-packaging-plugin:2.0.0:validate-id (default-validate-id) @ TestTycho ---
  [INFO]
  [INFO] --- tycho-packaging-plugin:2.0.0:validate-version (default-validate-version) @ TestTycho ---
  [INFO]
  [INFO] --- xtend-maven-plugin:2.23.0:compile (default) @ TestTycho ---
  [INFO]
  [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ TestTycho ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory D:\ParentProjectPomless\TestTycho\src\main\resources
  [INFO]
  [INFO] --- tycho-compiler-plugin:2.0.0:compile (default-compile) @ TestTycho ---
  [INFO] Compiling 1 source file to D:\ParentProjectPomless\TestTycho\target\classes
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Summary:
  [INFO]
  [INFO] parent-project 0.0.1-SNAPSHOT ...................... SUCCESS [  2.317 s]
  [INFO] [bundle] TestTycho 1.0.0-SNAPSHOT .................. SUCCESS [  2.219 s]
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  <p>My question is, can you somehow control, in a Tycho pom-less environment, which plugins are applied to which of the modules specified in the parent POM? Or is there a possibility to entirely ignore the parent project in the build process and just use the parent POM as a means to configure the plugins used for building the individual modules?</p>
  <p>Usually, I would use pluginManagement or a skip option together with individual POMs to achieve my goal like in the following.</p>
  <p>Build section of parent POM with pluginManagement:</p>
  <pre><code>&lt;build&gt;
      &lt;pluginManagement&gt;
          &lt;plugins&gt;           
              &lt;plugin&gt;
                  &lt;groupId&gt;org.eclipse.xtend&lt;/groupId&gt;
                  &lt;artifactId&gt;xtend-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${xtext.version}&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;            
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;outputDirectory&gt;src/main/xtend-gen&lt;/outputDirectory&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
      
      &lt;plugins&gt;                       
          &lt;plugin&gt;
              &lt;groupId&gt;org.eclipse.tycho&lt;/groupId&gt;
              &lt;artifactId&gt;tycho-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${tycho.version}&lt;/version&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;      
  &lt;/build&gt;
  </code></pre>
  <p>Individual POM of the module (Eclipse plugin):</p>
  <pre><code>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;parent&gt;
      &lt;groupId&gt;withPOM&lt;/groupId&gt;
      &lt;artifactId&gt;parent-project&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
    
  &lt;groupId&gt;TestTycho&lt;/groupId&gt;
  &lt;artifactId&gt;TestTycho&lt;/artifactId&gt;
  &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;eclipse-plugin&lt;/packaging&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.eclipse.xtend&lt;/groupId&gt;
              &lt;artifactId&gt;xtend-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  <p>The respective <code>mvn compile</code> output with <code>xtend-maven-plugin</code> NOT being called on the parent project:</p>
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] Reactor Build Order:
  [INFO]
  [INFO] parent-project                                                     [pom]
  [INFO] TestTycho                                               [eclipse-plugin]
  [INFO]
  [INFO] -----------------------&lt; withPOM:parent-project &gt;-----------------------
  [INFO] Building parent-project 0.0.1-SNAPSHOT                             [1/2]
  [INFO] --------------------------------[ pom ]---------------------------------
  [INFO]
  [INFO] ------------------------&lt; TestTycho:TestTycho &gt;-------------------------
  [INFO] Building TestTycho 1.0.0-SNAPSHOT                                  [2/2]
  [INFO] ---------------------------[ eclipse-plugin ]---------------------------
  [INFO]
  [INFO] --- tycho-packaging-plugin:2.0.0:build-qualifier (default-build-qualifier) @ TestTycho ---
  [INFO] The project's OSGi version is 1.0.0.202009290838
  [INFO]
  [INFO] --- tycho-packaging-plugin:2.0.0:validate-id (default-validate-id) @ TestTycho ---
  [INFO]
  [INFO] --- tycho-packaging-plugin:2.0.0:validate-version (default-validate-version) @ TestTycho ---
  [INFO]
  [INFO] --- xtend-maven-plugin:2.23.0:compile (default) @ TestTycho ---
  [INFO]
  [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ TestTycho ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory D:\ParentProject\TestTycho\src\main\resources
  [INFO]
  [INFO] --- tycho-compiler-plugin:2.0.0:compile (default-compile) @ TestTycho ---
  [INFO] Compiling 1 source file to D:\ParentProject\TestTycho\target\classes
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Summary:
  [INFO]
  [INFO] parent-project 0.0.1-SNAPSHOT ...................... SUCCESS [  0.002 s]
  [INFO] TestTycho 1.0.0-SNAPSHOT ........................... SUCCESS [  4.458 s]
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  <p>As individual modules are not meant to have POMs in a Tycho pom-less environment I wonder if there are other options.</p>