title: Maven Packing Type Based on Profile
body: <p>I am using a found example on stackoverflow that dynamically changes the packaging type based on profile</p>
  
  <p><a href="https://stackoverflow.com/questions/8247720/changing-packaging-based-on-active-profile-in-pom/15134587#15134587">Changing packaging based on active profile in pom</a></p>
  
  <p>This is a snippet of my pom.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0             http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.scene7.is.qa&lt;/groupId&gt;
  &lt;artifactId&gt;jorogumo&lt;/artifactId&gt;
  &lt;packaging&gt;${packaging.type}&lt;/packaging&gt;
  ...
  &lt;profile&gt;
      &lt;id&gt;JorogumoReportingWebApp&lt;/id&gt;
      &lt;properties&gt;
          &lt;packaging.type&gt;war&lt;/packaging.type&gt;
          &lt;final.name&gt;jorogumo&lt;/final.name&gt;
      &lt;/properties&gt;
  ...
  </code></pre>
  
  <p>Based on the upvotes from the answer link above I am assuming this should work, but I receive an error when cleaning</p>
  
  <pre><code>$ mvn clean
  [INFO] Scanning for projects...
  [ERROR] The build could not read 1 project -&gt; [Help 1]
  [ERROR]   
  [ERROR]   The project com.scene7.is.qa:jorogumo:0.0.1-SNAPSHOT     (/Users/xyz/working/_workspaces/Scene7/java/jorogumo/pom.xml) has 1 error
  [ERROR]     Unknown packaging: ${packaging.type} @ line 10, column 13
  </code></pre>
  
  <p>Am I missing something? Or is this the wrong approach?
  My end goal is to share common java classes between the web app and the command line jar.</p>