title: Maven: Using inherited property in dependency classifier causes build failure
body: <p>Given three POM files:</p>
  
  <ul>
  <li>C depends on B.</li>
  <li>B inherits from A.</li>
  <li>I can build A and B</li>
  <li>C fails to build because of its dependency on B.</li>
  </ul>
  
  <p>The full source-code and build output is included below for your review.</p>
  
  <p>Here is A's POM:</p>
  
  <pre><code>&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.foo&lt;/groupId&gt;
      &lt;artifactId&gt;A&lt;/artifactId&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;A&lt;/name&gt;
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;foo releases&lt;/id&gt;
              &lt;name&gt;libs-releases-local&lt;/name&gt;
              &lt;layout&gt;default&lt;/layout&gt;
              &lt;url&gt;http://foo.net/artifactory/libs-releases-local&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.swt&lt;/groupId&gt;
              &lt;artifactId&gt;swt&lt;/artifactId&gt;
              &lt;classifier&gt;${swt.classifier}&lt;/classifier&gt;
              &lt;version&gt;3.6.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;windows-x86&lt;/id&gt;
              &lt;properties&gt;
                  &lt;swt.classifier&gt;win32-x86&lt;/swt.classifier&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Here is B's POM:</p>
  
  <pre><code>&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;parent&gt;
          &lt;groupId&gt;com.foo&lt;/groupId&gt;
          &lt;artifactId&gt;A&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
          &lt;relativePath&gt;../A&lt;/relativePath&gt;
      &lt;/parent&gt;
      &lt;artifactId&gt;B&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;name&gt;B&lt;/name&gt;
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;windows-x86&lt;/id&gt;
              &lt;properties&gt;
                  &lt;swt.classifier&gt;win32-x86&lt;/swt.classifier&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Here is C's POM:</p>
  
  <pre><code>&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.foo&lt;/groupId&gt;
      &lt;artifactId&gt;C&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;C&lt;/name&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
              &lt;artifactId&gt;B&lt;/artifactId&gt;
              &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Here is the build output from C:</p>
  
  <pre><code>------------------------------------------------------------------------
  Building C
     task-segment: [install]
  ------------------------------------------------------------------------
  [compiler:compile]
  Nothing to compile - all classes are up to date
  Downloading: http://foo.net/artifactory/libs-releases-local/org/eclipse/swt/swt/3.6.1/swt-3.6.1-${swt.classifier}.jar
  [WARNING] Unable to get resource 'org.eclipse.swt:swt:jar:${swt.classifier}:3.6.1' from repository foo releases (http://foo.net/artifactory/libs-releases-local): Error transferring file: foo.net
  Downloading: http://repo1.maven.org/maven2/org/eclipse/swt/swt/3.6.1/swt-3.6.1-${swt.classifier}.jar
  Unable to find resource 'org.eclipse.swt:swt:jar:${swt.classifier}:3.6.1' in repository central (http://repo1.maven.org/maven2)
  ------------------------------------------------------------------------
  [ERROR]BUILD ERROR
  ------------------------------------------------------------------------
  Failed to resolve artifact.
  
  Missing:
  ----------
  1) org.eclipse.swt:swt:jar:${swt.classifier}:3.6.1
  </code></pre>
  
  <p>I know this issue is related to <a href="https://issues.apache.org/jira/browse/MNG-3228" rel="nofollow">https://issues.apache.org/jira/browse/MNG-3228</a> but I'm not sure how to fix it. Please help!</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>Adding a classifier to B helped. Now C builds so long as the repository only contains B's jar file. If I upload B's POM file alongside the JAR in the repository, C fails with the aforementioned error (<code>${swt.classifier</code>} not defined). Any ideas?</p>