Could not find artifact junit:junit:jar:4.12 in central
<p>I use <strong>Artifactory</strong>.</p>

<pre><code>Intranet                           |      Internet
---------------------------------------------------------------------
client &lt;------&gt; Artifactory &lt;------|----&gt; Remote repository: jcenter
</code></pre>

<p>When I run (after removing the .m2 content related to JUnit)</p>

<pre><code>mvn clean package -U
</code></pre>

<p>on the client, I get the following error:</p>

<blockquote>
  <p>[ERROR] Failed to execute goal on project MyProject: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: <strong>Could not find artifact junit:junit:jar:4.12 in central</strong> (<a href="http://my-own-server:8081/artifactory/libs-release" rel="nofollow">http://my-own-server:8081/artifactory/libs-release</a>) -> [Help 1]</p>
</blockquote>

<p>part of the following output:</p>

<pre><code>[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MyProject Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.pom
Downloaded: http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.pom (24 KB at 164.0 KB/sec)
Downloading: http://my-own-server:8081/artifactory/libs-release/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.pom
[WARNING] The POM for com.oracle:ojdbc7:jar:12.1.0.1 is missing, no dependency information available
Downloading: http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.484s
[INFO] Finished at: Thu Feb 25 17:19:01 EET 2016
[INFO] Final Memory: 8M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MyProject: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release) -&gt; [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
</code></pre>

<p>How can I fix this problem?</p>

<hr>

<h3>Details:</h3>

<ol>
<li><p>The <strong>connection</strong> between Artifactory and the remote repository <strong>works</strong>.</p>

<ul>
<li>tested from Artifactory, using the Test button</li>
<li>the other .jar files are brought into .m2/repository (E.g.: log4j-1.2.17.jar)</li>
</ul></li>
<li><p>The <strong>junit/junit/4.12</strong> folder is <strong>created</strong> under <strong>.m2/repository</strong>, but it contains only the following files:</p>

<ul>
<li>_maven.repositories</li>
<li>junit-4.12.jar.lastUpdated</li>
<li>junit-4.12.pom</li>
<li>junit-4.12.pom.sha1</li>
</ul></li>
<li><p>The <strong>jcenter remote repository</strong> contains JUnit 4.12: <a href="http://jcenter.bintray.com/junit/junit/4.12/" rel="nofollow">http://jcenter.bintray.com/junit/junit/4.12/</a></p></li>
<li><p>Running </p>

<pre><code>mvn clean package -U -X
</code></pre>

<p>will show the following output</p>

<pre><code>...
Downloading: http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.jar
[DEBUG] Writing resolution tracking file C:\Users\first.last\.m2\repository\junit\junit\4.12\junit-4.12.jar.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.903s
[INFO] Finished at: Thu Feb 25 17:25:51 EET 2016
[INFO] Final Memory: 9M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MyProject: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release) -&gt; [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project MyProject: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
        at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:189)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
        ... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:183)
        ... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
        ... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:947)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
        at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
</code></pre></li>
<li><p>If I <strong>upload manually</strong> the <strong>junit-4.12.jar</strong> file in <a href="http://my-own-server:8081/artifactory/webapp/#/artifacts/browse/tree/General/libs-release-local" rel="nofollow">http://my-own-server:8081/artifactory/webapp/#/artifacts/browse/tree/General/libs-release-local</a> , it <strong>works</strong>, but I'd like to keep that folder only for the files that are not in the official remote repositories (like ojdbc7.jar).</p></li>
<li><p>The following URL <a href="http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.jar?trace" rel="nofollow">http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.jar?trace</a> contains:</p>

<pre><code>Request ID: ...
Repo Path ID: libs-release:junit/junit/4.12/junit-4.12.jar
Method Name: GET
User: admin
Time: 2016-02-25T18:02:35.664+02:00
Thread: http-nio-8081-exec-346
Steps: 
2016-02-25T18:02:35.664+02:00 Received request
2016-02-25T18:02:35.664+02:00 Request source = &lt;ip&gt;, Last modified = 01-01-70 01:59:59 +02:00, If modified since = -1, Thread name = http-nio-8081-exec-346
2016-02-25T18:02:35.664+02:00 Executing any BeforeDownloadRequest user plugins that may exist
2016-02-25T18:02:35.664+02:00 Retrieving info
2016-02-25T18:02:35.664+02:00 Consulting the virtual repo download strategy
2016-02-25T18:02:35.664+02:00 Trying to retrieve resource info from the local storage
2016-02-25T18:02:35.664+02:00 Unable to find resource in libs-release:junit/junit/4.12/junit-4.12.jar
2016-02-25T18:02:35.664+02:00 Searching for info in aggregated repositories
2016-02-25T18:02:35.664+02:00 Preparing list of aggregated repositories to search in
2016-02-25T18:02:35.664+02:00 Appending the virtual repository 'libs-release'
2016-02-25T18:02:35.664+02:00 Appending the virtual repository 'libs-release'
2016-02-25T18:02:35.664+02:00 Appending the virtual repository 'libs-release'
2016-02-25T18:02:35.664+02:00 Appending collective local repositories
2016-02-25T18:02:35.664+02:00 Appending collective local cache repositories
2016-02-25T18:02:35.664+02:00 Appending collective remote repositories
2016-02-25T18:02:35.664+02:00 Intercepting info request with 'MavenMetadataInterceptor'
2016-02-25T18:02:35.664+02:00 Intercepting info request with 'PomInterceptor'
2016-02-25T18:02:35.664+02:00 Processing request as a release resource
2016-02-25T18:02:35.664+02:00 Searching for the resource within libs-release-local
2016-02-25T18:02:35.664+02:00 Unable to find resource in libs-release-local:junit/junit/4.12/junit-4.12.jar
2016-02-25T18:02:35.664+02:00 Searching for the resource within ext-release-local
2016-02-25T18:02:35.664+02:00 Unable to find resource in ext-release-local:junit/junit/4.12/junit-4.12.jar
2016-02-25T18:02:35.664+02:00 Searching for the resource within jcenter-cache
2016-02-25T18:02:35.664+02:00 Unable to find resource in jcenter-cache:junit/junit/4.12/junit-4.12.jar
2016-02-25T18:02:35.664+02:00 Searching for the resource within jcenter
2016-02-25T18:02:35.664+02:00 Returning an unfound resource
2016-02-25T18:02:35.664+02:00 Requested resource is found = false
2016-02-25T18:02:35.664+02:00 Request is HEAD = false
2016-02-25T18:02:35.664+02:00 Request is for a checksum = false
2016-02-25T18:02:35.664+02:00 Target repository is not remote or doesn't store locally = true
2016-02-25T18:02:35.664+02:00 Requested resource was not modified = false
2016-02-25T18:02:35.664+02:00 Responding with unfound resource
2016-02-25T18:02:35.664+02:00 Setting default response status to '404' reason to 'Resource not found'
2016-02-25T18:02:35.664+02:00 Response is an instance of UnfoundRepoResourceReason
2016-02-25T18:02:35.664+02:00 Configured to hide un-authorized resources = false
2016-02-25T18:02:35.664+02:00 Original response status is auth related = false
2016-02-25T18:02:35.664+02:00 Using original response status of '404' and message 'Could not find resource'
2016-02-25T18:02:35.664+02:00 Sending error with status 404 and message 'Could not find resource'
2016-02-25T18:02:35.664+02:00 Executing any AfterDownloadErrorAction user plugins that may exist
2016-02-25T18:02:35.664+02:00 Response code wasn't modified by the user plugins
2016-02-25T18:02:35.664+02:00 Sending response with the status '404' and the message 'Could not find resource'
</code></pre></li>
<li><p>My <strong>pom.xml</strong> contains:</p>

<pre><code>&lt;dependencies&gt;
    &lt;!-- JUnit --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;4.12&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    ...
&lt;/dependencies&gt;
</code></pre></li>
<li><p><strong>Software</strong> versions:</p>

<ul>
<li>Artifactory Version 4.5.1</li>
<li>Apache Maven 3.0.5</li>
</ul></li>
</ol>