Cannot add local jar files in maven project
<p>I'm trying to repackage log4j so I can use it with Android. In order to do so, I have to use <a href="https://code.google.com/archive/p/openbeans/" rel="nofollow noreferrer">openbeans</a> library and replace each <code>java.beans</code> with <code>com.googlecode.openbeans</code>.</p>

<p>Obviously this is not sufficient, since before repacking the through maven log4j I've to include <code>openbeans-1.0.jar</code> in the project.</p>

<p>So I've found <a href="https://stackoverflow.com/a/4955695/4480180">this</a> method.</p>

<p>I've installed openbeans through the following command:</p>

<pre><code>mvn install:install-file -Dfile=/home/luca/openbeans-1.0.jar -DgroupId=com.googlecode -DartifactId=openbeans -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true
</code></pre>

<p>I've checked that the correct execution of the command checking if the <code>.jar</code> exists in the following path (and it does):</p>

<p><code>~/.m2/repository/com/googlecode/openbeans/1.0/openbeans-1.0.jar</code></p>

<p>Then I edited the <code>pom.xml</code> file adding:</p>

<pre><code>&lt;dependency&gt;
  &lt;groupId&gt;com.googlecode&lt;/groupId&gt;
  &lt;artifactId&gt;openbeans&lt;/artifactId&gt;
  &lt;version&gt;1.0&lt;/version&gt;
&lt;/dependency&gt;
</code></pre>

<p>But if I try <code>mvn package</code> then this error is returned:</p>

<pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.2:run (rmdir_tests_output) on project log4j: Execution rmdir_tests_output of goal org.apache.maven.plugins:maven-antrun-plugin:1.2:run failed: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.2 or one of its dependencies could not be resolved: Failure to find com.googlecode:openbeans:jar:1.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -&gt; [Help 1]
</code></pre>

<p>Like the <code>install-file</code> didn't worked.</p>

<p>I've tried also with <a href="https://stackoverflow.com/a/22300875/4480180">this</a> method, using the following code (obviously I copied the <code>.jar</code> in the project root dir):</p>

<pre><code>&lt;dependency&gt;
  &lt;groupId&gt;com.googlecode&lt;/groupId&gt;
  &lt;artifactId&gt;openbeans&lt;/artifactId&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  &lt;scope&gt;system&lt;/scope&gt;
  &lt;systemPath&gt;${project.basedir}/openbeans-1.0.jar&lt;/systemPath&gt;
&lt;/dependency&gt;
</code></pre>

<p>And here the error returned is:</p>

<pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:compile (default-compile) on project log4j: Compilation failure
[ERROR] /home/luca/apache-log4j-1.2.17/src/main/java/org/apache/log4j/config/PropertyGetter.java:[31,21] error: package com.googlecode does not exist
</code></pre>

<p>What is wrong in what I'm doing?</p>