title: Building an RPM containing JDK dependency resolution
body: <p>I'm building oracle jdk 1.6 into an rpm using maven and nexus from a zip file distribution of the jdk.</p>
  
  <p>When done, the rpm refuses to install without the following:</p>
  
  <pre><code>[root@build]# rpm -ivh oracle-jdk-1.6.0_26-1.noarch.rpm
  error: Failed dependencies:
          libXt.so.6()(64bit) is needed by oracle-jdk-1.6.0_26-1.noarch
          libodbc.so()(64bit) is needed by oracle-jdk-1.6.0_26-1.noarch
          libodbcinst.so()(64bit) is needed by oracle-jdk-1.6.0_26-1.noarch
  </code></pre>
  
  <p>Fine. I'm guessing maven created this dependency. The jdk in it's native unzipped form works fine.</p>
  
  <p>How can I configure my pom so that maven will not resolve these dependencies?</p>
  
  <p>How would I configure my pom so that yum -y install will install the missing libraries?</p>
  
  <p>I ask both, as I'm not sure which way I will sway.</p>
  
  <p>Edit: my pom:</p>
  
  <pre><code>&lt;?xml version="1.0"?&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/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.oracle&lt;/groupId&gt;
    &lt;artifactId&gt;jdk&lt;/artifactId&gt;
    &lt;version&gt;1.6.0_26&lt;/version&gt;
    &lt;packaging&gt;pom&lt;/packaging&gt;
    &lt;properties&gt;
      &lt;unix.user&gt;root&lt;/unix.user&gt;
      &lt;rpm.friendly.name&gt;oracle-jdk&lt;/rpm.friendly.name&gt;
      &lt;rpm.install.basedir&gt;/usr/java/jdk/1.6.0_26&lt;/rpm.install.basedir&gt;
      &lt;sourcefile.unzip.dir&gt;${project.build.directory}/jdk1.6.0_26&lt;/sourcefile.unzip.dir&gt;
      &lt;yum.repo.host&gt;localhost&lt;/yum.repo.host&gt;
      &lt;yum.repo.path&gt;/apps/httpd/yumrepo&lt;/yum.repo.path&gt;
    &lt;/properties&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.oracle&lt;/groupId&gt;
        &lt;artifactId&gt;jdk&lt;/artifactId&gt;
        &lt;version&gt;1.6.0_26&lt;/version&gt;
        &lt;type&gt;tar.gz&lt;/type&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;distributionManagement&gt;
      &lt;repository&gt;
        &lt;id&gt;ssh-repository&lt;/id&gt;
        &lt;url&gt;scpexe://${yum.repo.host}${yum.repo.path}&lt;/url&gt;
      &lt;/repository&gt;
    &lt;/distributionManagement&gt;
    &lt;build&gt;
      &lt;extensions&gt;
        &lt;extension&gt;
          &lt;groupId&gt;org.apache.maven.wagon&lt;/groupId&gt;
          &lt;artifactId&gt;wagon-ssh-external&lt;/artifactId&gt;
          &lt;version&gt;1.0-beta-6&lt;/version&gt;
        &lt;/extension&gt;
      &lt;/extensions&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;rpm-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.1-alpha-3&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;generate-rpm&lt;/id&gt;
              &lt;goals&gt;
                &lt;goal&gt;attached-rpm&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
            &lt;name&gt;${rpm.friendly.name}&lt;/name&gt;
            &lt;copyright&gt;2014, JM&lt;/copyright&gt;
            &lt;group&gt;Application/Internet&lt;/group&gt;
            &lt;packager&gt;JM&lt;/packager&gt;
            &lt;needarch&gt;false&lt;/needarch&gt;
            &lt;changelogFile&gt;src/changelog&lt;/changelogFile&gt;
            &lt;mappings&gt;
              &lt;mapping&gt;
                &lt;directory&gt;${rpm.install.basedir}&lt;/directory&gt;
                &lt;username&gt;${unix.user}&lt;/username&gt;
                &lt;groupname&gt;${unix.user}&lt;/groupname&gt;
                &lt;sources&gt;
                  &lt;source&gt;
                    &lt;location&gt;${sourcefile.unzip.dir}&lt;/location&gt;
                  &lt;/source&gt;
                &lt;/sources&gt;
              &lt;/mapping&gt;
            &lt;/mappings&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;unpack&lt;/id&gt;
              &lt;phase&gt;generate-resources&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;unpack-dependencies&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;outputDirectory&gt;${project.build.directory}&lt;/outputDirectory&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;repositories&gt;
      &lt;repository&gt;
        &lt;snapshots&gt;
          &lt;enabled&gt;true&lt;/enabled&gt;
        &lt;/snapshots&gt;
        &lt;id&gt;thirdparty&lt;/id&gt;
        &lt;url&gt;http://myrepo.com:8081/nexus/content/repositories/thirdparty&lt;/url&gt;
      &lt;/repository&gt;
    &lt;/repositories&gt;
  &lt;/project&gt;
  </code></pre>