title: Adding a system dependency to Maven
body: <p>I am working with Apache Spark through Maven, and I am trying to modify the source by including a 3rd party jar and trying to utilize some methods within it. </p>
  
  <p>I get the following error when compiling the Spark project using</p>
  
  <pre class="lang-sh prettyprint-override"><code>mvn -Dhadoop.version=2.2.0 -Dscala-2.11 -DskipTests clean package
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>not found: object edu
  [ERROR] import edu.xxx.cs.aggr._
  </code></pre>
  
  <p>I modified <code>ResultTask.scala</code> to contain an import statement. So, maven is unable to find the jar I am trying to use and link it with the project. </p>
  
  <p>I have added a dependency to the pom.xml file such as this: </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
      &lt;groupId&gt;edu.xxx.cs&lt;/groupId&gt;
      &lt;artifactId&gt;aggr&lt;/artifactId&gt;
      &lt;version&gt;0.99&lt;/version&gt;
      &lt;scope&gt;system&lt;/scope&gt;
      &lt;systemPath&gt;${basedir}/aggr.jar&lt;/systemPath&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The jar file I am trying to link is located in the same directory as the spark pom.xml file. I added this dependency to pom.xml. I inserted it in between 2 existing dependencies within the pom.xml file. I'm not sure whats wrong, but I would just like the jar to get linked for now, so that I can use the methods within it. I'm also not sure if I should be using anything specific for the groupId, artifactId, and version. edu.xxx.cs.aggr is the root package which contains other source files and packages. I would appreciate any help. </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I used </p>
  
  <pre><code>mvn install:install-file -Dfile=&lt;path-to-file&gt; -DgroupId=edu.xxx.cs -DartifactId=aggr -Dversion=0.99 -Dpackaging=jar to install the jar to the .m2 repo. I checked the repo to see if it was installed, and it was.
  </code></pre>
  
  <p>I changed the dependency in pom.xml to</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;edu.purdue.cs&lt;/groupId&gt;
          &lt;artifactId&gt;aggr&lt;/artifactId&gt;
          &lt;version&gt;0.99&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>I still get the same error.</p>